Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/LoopInterchange/pr43326-ideal-access-pattern.ll
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

73 lines
3.3 KiB
LLVM

; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 -pass-remarks-missed='loop-interchange' -pass-remarks-output=%t -S \
; RUN: -verify-dom-info -verify-loop-info -verify-loop-lcssa -stats 2>&1
; RUN: FileCheck --input-file=%t --check-prefix=REMARKS %s
; Triply nested loop, should be able to do interchange three times
; to get the ideal access pattern.
; void f(int e[restrict 10][10][10], int f[restrict 10][10][10]) {
; for (int a = 0; a < 10; a++) {
; for (int b = 0; b < 10; b++) {
; for (int c = 0; c < 10; c++) {
; f[c][b][a] = e[c][b][a];
; }
; }
; }
; }
; REMARKS: --- !Analysis
; REMARKS-NEXT: Pass: loop-interchange
; REMARKS-NEXT: Name: Dependence
; REMARKS-NEXT: Function: pr43326-triply-nested
; REMARKS-NEXT: Args:
; REMARKS-NEXT: - String: Computed dependence info, invoking the transform.
; REMARKS-NEXT: ...
; REMARKS: --- !Passed
; REMARKS-NEXT: Pass: loop-interchange
; REMARKS-NEXT: Name: Interchanged
; REMARKS-NEXT: Function: pr43326-triply-nested
; REMARKS: --- !Passed
; REMARKS-NEXT: Pass: loop-interchange
; REMARKS-NEXT: Name: Interchanged
; REMARKS-NEXT: Function: pr43326-triply-nested
; REMARKS: --- !Passed
; REMARKS-NEXT: Pass: loop-interchange
; REMARKS-NEXT: Name: Interchanged
; REMARKS-NEXT: Function: pr43326-triply-nested
define void @pr43326-triply-nested(ptr noalias %e, ptr noalias %f) {
entry:
br label %for.outermost.header
for.outermost.header: ; preds = %entry, %for.outermost.latch
%indvars.outermost = phi i64 [ 0, %entry ], [ %indvars.outermost.next, %for.outermost.latch ]
br label %for.middle.header
for.cond.cleanup: ; preds = %for.outermost.latch
ret void
for.middle.header: ; preds = %for.outermost.header, %for.middle.latch
%indvars.middle = phi i64 [ 0, %for.outermost.header ], [ %indvars.middle.next, %for.middle.latch ]
br label %for.innermost
for.outermost.latch: ; preds = %for.middle.latch
%indvars.outermost.next = add nuw nsw i64 %indvars.outermost, 1
%exitcond.outermost = icmp ne i64 %indvars.outermost.next, 10
br i1 %exitcond.outermost, label %for.outermost.header, label %for.cond.cleanup
for.middle.latch: ; preds = %for.innermost
%indvars.middle.next = add nuw nsw i64 %indvars.middle, 1
%exitcond.middle = icmp ne i64 %indvars.middle.next, 10
br i1 %exitcond.middle, label %for.middle.header, label %for.outermost.latch
for.innermost: ; preds = %for.middle.header, %for.innermost
%indvars.innermost = phi i64 [ 0, %for.middle.header ], [ %indvars.innermost.next, %for.innermost ]
%arrayidx12 = getelementptr inbounds [10 x [10 x i32]], ptr %e, i64 %indvars.innermost, i64 %indvars.middle, i64 %indvars.outermost
%0 = load i32, ptr %arrayidx12
%arrayidx18 = getelementptr inbounds [10 x [10 x i32]], ptr %f, i64 %indvars.innermost, i64 %indvars.middle, i64 %indvars.outermost
store i32 %0, ptr %arrayidx18
%indvars.innermost.next = add nuw nsw i64 %indvars.innermost, 1
%exitcond.innermost = icmp ne i64 %indvars.innermost.next, 10
br i1 %exitcond.innermost, label %for.innermost, label %for.middle.latch
}