Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/LoopInterchange/inner-indvar-depend-on-outer-indvar-remark.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

118 lines
3.2 KiB
LLVM

; REQUIRES: asserts
; RUN: opt < %s -passes=loop-interchange -verify-dom-info -verify-loop-info -S -debug 2>&1 | FileCheck %s
@A = common global [100 x [100 x i64]] zeroinitializer
@N = dso_local local_unnamed_addr global i64 100, align 8
; for(int i=0;i<100;i++)
; for(int j=0;j<i;j++)
; A[j][i] = A[j][i]+k;
;
; Inner loop induction variable exit condition depends on the
; outer loop induction variable, i.e., triangular loops.
;
; CHECK: Loop structure not understood by pass
; CHECK: Cannot prove legality, not interchanging loops 'for1.header' and 'for2'
;
define void @interchange_01(i64 %k) {
entry:
br label %for1.header
for1.header:
%i = phi i64 [ 0, %entry ], [ %i.next, %for1.inc10 ]
br label %for2
for2:
%j = phi i64 [ %j.next, %for2 ], [ 0, %for1.header ]
%arrayidx5 = getelementptr inbounds [100 x [100 x i64]], ptr @A, i64 0, i64 %j, i64 %i
%lv = load i64, ptr %arrayidx5
%add = add nsw i64 %lv, %k
store i64 %add, ptr %arrayidx5
%j.next = add nuw nsw i64 %j, 1
%exitcond = icmp eq i64 %j, %i
br i1 %exitcond, label %for1.inc10, label %for2
for1.inc10:
%i.next = add nuw nsw i64 %i, 1
%exitcond26 = icmp eq i64 %i, 99
br i1 %exitcond26, label %for.end12, label %for1.header
for.end12:
ret void
}
; for(int i=0;i<100;i++)
; for(int j=0;j+i<100;j++)
; A[j][i] = A[j][i]+k;
;
; Inner loop induction variable exit condition depends on the
; outer loop induction variable, i.e., triangular loops.
;
; CHECK: Loop structure not understood by pass
; CHECK: Cannot prove legality, not interchanging loops 'for1.header' and 'for2'
;
define void @interchange_02(i64 %k) {
entry:
br label %for1.header
for1.header:
%i = phi i64 [ 0, %entry ], [ %i.next, %for1.inc10 ]
br label %for2
for2:
%j = phi i64 [ %j.next, %for2 ], [ 0, %for1.header ]
%arrayidx5 = getelementptr inbounds [100 x [100 x i64]], ptr @A, i64 0, i64 %j, i64 %i
%lv = load i64, ptr %arrayidx5
%add = add nsw i64 %lv, %k
store i64 %add, ptr %arrayidx5
%0 = add nuw nsw i64 %j, %i
%j.next = add nuw nsw i64 %j, 1
%exitcond = icmp eq i64 %0, 100
br i1 %exitcond, label %for1.inc10, label %for2
for1.inc10:
%i.next = add nuw nsw i64 %i, 1
%exitcond26 = icmp eq i64 %i, 99
br i1 %exitcond26, label %for.end12, label %for1.header
for.end12:
ret void
}
; for(int i=0;i<100;i++)
; for(int j=0;i>j;j++)
; A[j][i] = A[j][i]+k;
;
; Inner loop induction variable exit condition depends on the
; outer loop induction variable, i.e., triangular loops.
; CHECK: Loop structure not understood by pass
; CHECK: Cannot prove legality, not interchanging loops 'for1.header' and 'for2'
;
define void @interchange_03(i64 %k) {
entry:
br label %for1.header
for1.header:
%i = phi i64 [ 0, %entry ], [ %i.next, %for1.inc10 ]
br label %for2
for2:
%j = phi i64 [ %j.next, %for2 ], [ 0, %for1.header ]
%arrayidx5 = getelementptr inbounds [100 x [100 x i64]], ptr @A, i64 0, i64 %j, i64 %i
%lv = load i64, ptr %arrayidx5
%add = add nsw i64 %lv, %k
store i64 %add, ptr %arrayidx5
%j.next = add nuw nsw i64 %j, 1
%exitcond = icmp ne i64 %i, %j
br i1 %exitcond, label %for2, label %for1.inc10
for1.inc10:
%i.next = add nuw nsw i64 %i, 1
%exitcond26 = icmp eq i64 %i, 99
br i1 %exitcond26, label %for.end12, label %for1.header
for.end12:
ret void
}