Skip to content

Commit a8280c4

Browse files
authored
[LoopInterchange] Fix incorrect GEPs in tests (NFC) (llvm#147223)
These tests were missing the leading zero(s) in the GEP.
1 parent db03408 commit a8280c4

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

llvm/test/Transforms/LoopInterchange/legality-check.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ for.j.header:
175175
for.k:
176176
%k = phi i32 [ 0, %for.j.header ], [ %k.inc, %for.k ]
177177
%k.inc = add nuw nsw i32 %k, 1
178-
%idx.store = getelementptr inbounds [20 x [20 x [20 x i32]]], ptr @b, i32 %i, i32 %j, i32 %k
179-
%idx.load = getelementptr inbounds [20 x [20 x [20 x i32]]], ptr @b, i32 %i, i32 5, i32 %k.inc
178+
%idx.store = getelementptr inbounds [20 x [20 x [20 x i32]]], ptr @b, i32 0, i32 %i, i32 %j, i32 %k
179+
%idx.load = getelementptr inbounds [20 x [20 x [20 x i32]]], ptr @b, i32 0, i32 %i, i32 5, i32 %k.inc
180180
%0 = load i32, ptr %idx.load, align 4
181181
store i32 %0, ptr %idx.store, align 4
182182
%cmp.k = icmp slt i32 %k.inc, 19

llvm/test/Transforms/LoopInterchange/profitability-vectorization-heuristic.ll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ for.i.header:
3333
for.j.body:
3434
%j = phi i64 [ 1, %for.i.header ], [ %j.next, %for.j.body ]
3535
%j.dec = add nsw i64 %j, -1
36-
%a.load.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @A, i64 %i, i64 %j.dec
37-
%b.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @B, i64 %i, i64 %j
38-
%c.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @C, i64 %i, i64 %j
36+
%a.load.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @A, i64 0, i64 %i, i64 %j.dec
37+
%b.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @B, i64 0, i64 %i, i64 %j
38+
%c.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @C, i64 0, i64 %i, i64 %j
3939
%a = load float, ptr %a.load.index, align 4
4040
%b = load float, ptr %b.index, align 4
4141
%c = load float, ptr %c.index, align 4
4242
%add.0 = fadd float %a, %b
43-
%a.store.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @A, i64 %i, i64 %j
43+
%a.store.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @A, i64 0, i64 %i, i64 %j
4444
store float %add.0, ptr %a.store.index, align 4
4545
%add.1 = fadd float %c, 1.0
4646
store float %add.1, ptr %c.index, align 4
@@ -84,12 +84,12 @@ for.i.header:
8484
for.j.body:
8585
%j = phi i64 [ 1, %for.i.header ], [ %j.next, %for.j.body ]
8686
%j.dec = add nsw i64 %j, -1
87-
%a.load.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @A, i64 %i, i64 %j
88-
%b.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @B, i64 %i, i64 %j
87+
%a.load.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @A, i64 0, i64 %i, i64 %j
88+
%b.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @B, i64 0, i64 %i, i64 %j
8989
%a = load float, ptr %a.load.index, align 4
9090
%b = load float, ptr %b.index, align 4
9191
%add = fadd float %a, %b
92-
%a.store.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @A, i64 %i, i64 %j.dec
92+
%a.store.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @A, i64 0, i64 %i, i64 %j.dec
9393
store float %add, ptr %a.store.index, align 4
9494
%j.next = add nuw nsw i64 %j, 1
9595
%cmp.j = icmp eq i64 %j.next, 256

llvm/test/Transforms/LoopInterchange/profitability-vectorization.ll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ for.i.header:
4848
for.j.body:
4949
%j = phi i64 [ 1, %for.i.header ], [ %j.next, %for.j.body ]
5050
%j.dec = add nsw i64 %j, -1
51-
%a.0.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @A, i64 %j.dec, i64 %i
52-
%b.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @B, i64 %j, i64 %i
53-
%c.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @C, i64 %i, i64 %j
54-
%d.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @D, i64 %i, i64 %j
55-
%e.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @E, i64 %i, i64 %j
56-
%f.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @F, i64 %i, i64 %j
51+
%a.0.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @A, i64 0, i64 %j.dec, i64 %i
52+
%b.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @B, i64 0, i64 %j, i64 %i
53+
%c.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @C, i64 0, i64 %i, i64 %j
54+
%d.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @D, i64 0, i64 %i, i64 %j
55+
%e.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @E, i64 0, i64 %i, i64 %j
56+
%f.index = getelementptr nuw inbounds [256 x [256 x float]], ptr @F, i64 0, i64 %i, i64 %j
5757
%a.0 = load float, ptr %a.0.index, align 4
5858
%b = load float, ptr %b.index, align 4
5959
%c = load float, ptr %c.index, align 4

0 commit comments

Comments
 (0)