Skip to content

Commit 449d14e

Browse files
committed
Do actual DCE in LoopUnroll (try 4)
Turns out simplifyLoopIVs sometimes returns a non-dead instruction in it's DeadInsts out param. I had done a bit of NFC cleanup which was only NFC if simplifyLoopIVs obeyed it's documentation. I'm simplfy dropping that part of the change. Commit message from try 3: Recommitting after fixing a bug found post commit. Amusingly, try 1 had been correct, and by reverting to incorporate last minute review feedback, I introduce the bug. Oops. :) Original commit message: The problem was that recursively deleting an instruction can delete instructions beyond the current iterator (via a dead phi), thus invalidating iteration. Test case added in LoopUnroll/dce.ll to cover this case. LoopUnroll does a limited DCE pass after unrolling, but if you have a chain of dead instructions, it only deletes the last one. Improve the code to recursively delete all trivially dead instructions. Differential Revision: https://reviews.llvm.org/D102511
1 parent 76b8754 commit 449d14e

11 files changed

+77
-63
lines changed

llvm/lib/Transforms/Utils/LoopUnroll.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -220,26 +220,24 @@ void llvm::simplifyLoopAfterUnroll(Loop *L, bool SimplifyIVs, LoopInfo *LI,
220220
}
221221
}
222222

223-
// At this point, the code is well formed. We now do a quick sweep over the
224-
// inserted code, doing constant propagation and dead code elimination as we
225-
// go.
223+
// At this point, the code is well formed. Perform constprop, instsimplify,
224+
// and dce.
226225
const DataLayout &DL = L->getHeader()->getModule()->getDataLayout();
226+
SmallVector<WeakTrackingVH, 16> DeadInsts;
227227
for (BasicBlock *BB : L->getBlocks()) {
228228
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E;) {
229229
Instruction *Inst = &*I++;
230-
231230
if (Value *V = SimplifyInstruction(Inst, {DL, nullptr, DT, AC}))
232231
if (LI->replacementPreservesLCSSAForm(Inst, V))
233232
Inst->replaceAllUsesWith(V);
234233
if (isInstructionTriviallyDead(Inst))
235-
BB->getInstList().erase(Inst);
234+
DeadInsts.emplace_back(Inst);
236235
}
236+
// We can't do recursive deletion until we're done iterating, as we might
237+
// have a phi which (potentially indirectly) uses instructions later in
238+
// the block we're iterating through.
239+
RecursivelyDeleteTriviallyDeadInstructions(DeadInsts);
237240
}
238-
239-
// TODO: after peeling or unrolling, previously loop variant conditions are
240-
// likely to fold to constants, eagerly propagating those here will require
241-
// fewer cleanup passes to be run. Alternatively, a LoopEarlyCSE might be
242-
// appropriate.
243241
}
244242

245243
/// Unroll the given loop by Count. The loop must be in LCSSA form. Unrolling

llvm/test/Transforms/LoopUnroll/AArch64/full-unroll-trip-count-upper-bound.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
; }
1212
;
1313
; This test is meant to check that this loop is unrolled into four iterations.
14+
; Note that the load on the last iteration is dead and thus doesn't appear in
15+
; the output.
1416

1517
; UNROLL-LABEL: @test
1618
; UNROLL: load i32, i32*
1719
; UNROLL: load i32, i32*
1820
; UNROLL: load i32, i32*
19-
; UNROLL: load i32, i32*
2021
; UNROLL-NOT: load i32, i32*
2122
; NOUNROLL-LABEL: @test
2223
; NOUNROLL: load i32, i32*
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2+
; RUN: opt -loop-unroll -S < %s | FileCheck %s
3+
4+
; Can't recursively delete %c.addr.07 without deleting %conv1
5+
; and thus invalidating iteration.
6+
define void @PR50368(i32 %c, i64 %x) {
7+
; CHECK-LABEL: @PR50368(
8+
; CHECK-NEXT: entry:
9+
; CHECK-NEXT: br label [[LOOP_PEEL_BEGIN:%.*]]
10+
; CHECK: loop.peel.begin:
11+
; CHECK-NEXT: br label [[LOOP_PEEL:%.*]]
12+
; CHECK: loop.peel:
13+
; CHECK-NEXT: br i1 false, label [[EXIT:%.*]], label [[LOOP_PEEL_NEXT:%.*]]
14+
; CHECK: loop.peel.next:
15+
; CHECK-NEXT: br label [[LOOP_PEEL_NEXT1:%.*]]
16+
; CHECK: loop.peel.next1:
17+
; CHECK-NEXT: br label [[ENTRY_PEEL_NEWPH:%.*]]
18+
; CHECK: entry.peel.newph:
19+
; CHECK-NEXT: br label [[LOOP:%.*]]
20+
; CHECK: loop:
21+
; CHECK-NEXT: br i1 false, label [[EXIT_LOOPEXIT:%.*]], label [[LOOP]], !llvm.loop [[LOOP0:![0-9]+]]
22+
; CHECK: exit.loopexit:
23+
; CHECK-NEXT: br label [[EXIT]]
24+
; CHECK: exit:
25+
; CHECK-NEXT: ret void
26+
;
27+
entry:
28+
br label %loop
29+
30+
loop:
31+
%0 = phi i64 [ 0, %loop ], [ %x, %entry ]
32+
%c.addr.07 = phi i32 [ %conv1, %loop ], [ %c, %entry ]
33+
%conv1 = trunc i64 undef to i32
34+
br i1 false, label %exit, label %loop
35+
36+
exit:
37+
ret void
38+
}
39+
40+
41+
define void @dead_chain(i64 %a) {
42+
; CHECK-LABEL: @dead_chain(
43+
; CHECK-NEXT: entry:
44+
; CHECK-NEXT: br label [[LOOP:%.*]]
45+
; CHECK: loop:
46+
; CHECK-NEXT: ret void
47+
;
48+
entry:
49+
br label %loop
50+
51+
loop:
52+
%conv1 = trunc i64 %a to i32
53+
%and = and i32 %conv1, 15
54+
%shl = shl i32 %and, 15
55+
br i1 true, label %exit, label %loop
56+
57+
exit:
58+
ret void
59+
}
60+

llvm/test/Transforms/LoopUnroll/full-unroll-invariant.ll

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,7 @@ define i32 @test2(i8 %a) {
3434
; CHECK-NEXT: entry:
3535
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
3636
; CHECK: for.body:
37-
; CHECK-NEXT: [[ZEXT:%.*]] = zext i8 [[A:%.*]] to i32
38-
; CHECK-NEXT: [[AND:%.*]] = and i32 [[ZEXT]], 31
39-
; CHECK-NEXT: [[ZEXT_1:%.*]] = zext i8 [[A]] to i32
40-
; CHECK-NEXT: [[AND_1:%.*]] = and i32 [[ZEXT_1]], 31
41-
; CHECK-NEXT: [[ZEXT_2:%.*]] = zext i8 [[A]] to i32
42-
; CHECK-NEXT: [[AND_2:%.*]] = and i32 [[ZEXT_2]], 31
43-
; CHECK-NEXT: [[ZEXT_3:%.*]] = zext i8 [[A]] to i32
44-
; CHECK-NEXT: [[AND_3:%.*]] = and i32 [[ZEXT_3]], 31
45-
; CHECK-NEXT: [[ZEXT_4:%.*]] = zext i8 [[A]] to i32
46-
; CHECK-NEXT: [[AND_4:%.*]] = and i32 [[ZEXT_4]], 31
47-
; CHECK-NEXT: [[ZEXT_5:%.*]] = zext i8 [[A]] to i32
48-
; CHECK-NEXT: [[AND_5:%.*]] = and i32 [[ZEXT_5]], 31
49-
; CHECK-NEXT: [[ZEXT_6:%.*]] = zext i8 [[A]] to i32
50-
; CHECK-NEXT: [[AND_6:%.*]] = and i32 [[ZEXT_6]], 31
51-
; CHECK-NEXT: [[ZEXT_7:%.*]] = zext i8 [[A]] to i32
52-
; CHECK-NEXT: [[AND_7:%.*]] = and i32 [[ZEXT_7]], 31
53-
; CHECK-NEXT: [[ZEXT_8:%.*]] = zext i8 [[A]] to i32
54-
; CHECK-NEXT: [[AND_8:%.*]] = and i32 [[ZEXT_8]], 31
55-
; CHECK-NEXT: [[ZEXT_9:%.*]] = zext i8 [[A]] to i32
37+
; CHECK-NEXT: [[ZEXT_9:%.*]] = zext i8 [[A:%.*]] to i32
5638
; CHECK-NEXT: [[AND_9:%.*]] = and i32 [[ZEXT_9]], 31
5739
; CHECK-NEXT: [[SHL_9:%.*]] = shl i32 [[AND_9]], 15
5840
; CHECK-NEXT: ret i32 [[SHL_9]]
@@ -79,16 +61,7 @@ define i32 @test3(i8 %a) {
7961
; CHECK-NEXT: entry:
8062
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
8163
; CHECK: for.body:
82-
; CHECK-NEXT: [[ZEXT:%.*]] = zext i8 [[A:%.*]] to i32
83-
; CHECK-NEXT: [[ZEXT_1:%.*]] = zext i8 [[A]] to i32
84-
; CHECK-NEXT: [[ZEXT_2:%.*]] = zext i8 [[A]] to i32
85-
; CHECK-NEXT: [[ZEXT_3:%.*]] = zext i8 [[A]] to i32
86-
; CHECK-NEXT: [[ZEXT_4:%.*]] = zext i8 [[A]] to i32
87-
; CHECK-NEXT: [[ZEXT_5:%.*]] = zext i8 [[A]] to i32
88-
; CHECK-NEXT: [[ZEXT_6:%.*]] = zext i8 [[A]] to i32
89-
; CHECK-NEXT: [[ZEXT_7:%.*]] = zext i8 [[A]] to i32
90-
; CHECK-NEXT: [[ZEXT_8:%.*]] = zext i8 [[A]] to i32
91-
; CHECK-NEXT: [[ZEXT_9:%.*]] = zext i8 [[A]] to i32
64+
; CHECK-NEXT: [[ZEXT_9:%.*]] = zext i8 [[A:%.*]] to i32
9265
; CHECK-NEXT: [[DIV_9:%.*]] = udiv i32 [[ZEXT_9]], 31
9366
; CHECK-NEXT: ret i32 [[DIV_9]]
9467
;

llvm/test/Transforms/LoopUnroll/nonlatchcondbr.ll

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ define void @test1(i32* noalias %A) {
4040
; CHECK: for.body.3:
4141
; CHECK-NEXT: br i1 false, label [[FOR_BODY_FOR_BODY_CRIT_EDGE_3:%.*]], label [[FOR_END:%.*]]
4242
; CHECK: for.body.for.body_crit_edge.3:
43-
; CHECK-NEXT: [[ARRAYIDX_PHI_TRANS_INSERT_3:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 4
4443
; CHECK-NEXT: unreachable
4544
;
4645
entry:
@@ -124,7 +123,7 @@ define void @test2(i32* noalias %A) {
124123
; CHECK: for.body.for.body_crit_edge.3:
125124
; CHECK-NEXT: [[ARRAYIDX_PHI_TRANS_INSERT_3:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 [[INC_3]]
126125
; CHECK-NEXT: [[DOTPRE_3]] = load i32, i32* [[ARRAYIDX_PHI_TRANS_INSERT_3]], align 4
127-
; CHECK-NEXT: br label [[FOR_HEADER]], !llvm.loop !0
126+
; CHECK-NEXT: br label [[FOR_HEADER]], !llvm.loop [[LOOP0:![0-9]+]]
128127
;
129128
entry:
130129
br i1 true, label %for.preheader, label %for.end
@@ -202,7 +201,7 @@ define void @test3(i32* noalias %A, i1 %cond) {
202201
; CHECK: for.body.for.body_crit_edge.3:
203202
; CHECK-NEXT: [[ARRAYIDX_PHI_TRANS_INSERT_3:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 [[INC_3]]
204203
; CHECK-NEXT: [[DOTPRE_3]] = load i32, i32* [[ARRAYIDX_PHI_TRANS_INSERT_3]], align 4
205-
; CHECK-NEXT: br label [[FOR_HEADER]], !llvm.loop !2
204+
; CHECK-NEXT: br label [[FOR_HEADER]], !llvm.loop [[LOOP2:![0-9]+]]
206205
;
207206
entry:
208207
%0 = load i32, i32* %A, align 4

llvm/test/Transforms/LoopUnroll/optsize-loop-size.ll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ define i32 @test(i32 %a, i32 %b, i32 %c) optsize {
1212
; CHECK-NEXT: store i32 [[B:%.*]], i32* [[ARRAYINIT_ELEMENT]], align 4
1313
; CHECK-NEXT: [[ARRAYINIT_ELEMENT1:%.*]] = getelementptr inbounds [3 x i32], [3 x i32]* [[REF_TMP]], i64 0, i64 2
1414
; CHECK-NEXT: store i32 [[C:%.*]], i32* [[ARRAYINIT_ELEMENT1]], align 4
15-
; CHECK-NEXT: [[ADD_PTR_I_I:%.*]] = getelementptr inbounds [3 x i32], [3 x i32]* [[REF_TMP]], i64 0, i64 3
1615
; CHECK-NEXT: [[CMP_I_I_I3:%.*]] = icmp slt i32 [[A]], [[B]]
1716
; CHECK-NEXT: [[SPEC_SELECT_I_I4:%.*]] = select i1 [[CMP_I_I_I3]], i32* [[ARRAYINIT_ELEMENT]], i32* [[ARRAYINIT_BEGIN]]
1817
; CHECK-NEXT: [[INCDEC_PTR_I_I5:%.*]] = getelementptr inbounds [3 x i32], [3 x i32]* [[REF_TMP]], i64 0, i64 2
@@ -22,7 +21,6 @@ define i32 @test(i32 %a, i32 %b, i32 %c) optsize {
2221
; CHECK-NEXT: [[DOTPRE2:%.*]] = load i32, i32* [[INCDEC_PTR_I_I5]], align 4
2322
; CHECK-NEXT: [[CMP_I_I_I:%.*]] = icmp slt i32 [[DOTPRE]], [[DOTPRE2]]
2423
; CHECK-NEXT: [[SPEC_SELECT_I_I:%.*]] = select i1 [[CMP_I_I_I]], i32* [[INCDEC_PTR_I_I5]], i32* [[SPEC_SELECT_I_I4]]
25-
; CHECK-NEXT: [[INCDEC_PTR_I_I:%.*]] = getelementptr inbounds i32, i32* [[INCDEC_PTR_I_I5]], i64 1
2624
; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[SPEC_SELECT_I_I]], align 4
2725
; CHECK-NEXT: ret i32 [[TMP1]]
2826
;

llvm/test/Transforms/LoopUnroll/pr45939-peel-count-and-complete-unroll.ll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ define void @test1() {
163163
; PEEL8-NEXT: [[ARRAYIDX_7:%.*]] = getelementptr inbounds [8 x i32], [8 x i32]* @a, i64 0, i64 [[INDVARS_IV_NEXT_6]]
164164
; PEEL8-NEXT: [[TMP15:%.*]] = trunc i64 [[INDVARS_IV_NEXT_6]] to i32
165165
; PEEL8-NEXT: store i32 [[TMP15]], i32* [[ARRAYIDX_7]], align 4
166-
; PEEL8-NEXT: [[INDVARS_IV_NEXT_7:%.*]] = add nuw nsw i64 [[INDVARS_IV_NEXT_6]], 1
167166
; PEEL8-NEXT: br label [[FOR_EXIT]]
168167
; PEEL8: for.exit:
169168
; PEEL8-NEXT: ret void
@@ -206,7 +205,7 @@ define void @test1() {
206205
; PEEL2UNROLL2-NEXT: store i32 [[TMP3]], i32* [[ARRAYIDX_1]], align 4
207206
; PEEL2UNROLL2-NEXT: [[INDVARS_IV_NEXT_1]] = add nuw nsw i64 [[INDVARS_IV_NEXT]], 1
208207
; PEEL2UNROLL2-NEXT: [[EXITCOND_1:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT_1]], 8
209-
; PEEL2UNROLL2-NEXT: br i1 [[EXITCOND_1]], label [[FOR_BODY]], label [[FOR_EXIT_LOOPEXIT:%.*]], !llvm.loop !0
208+
; PEEL2UNROLL2-NEXT: br i1 [[EXITCOND_1]], label [[FOR_BODY]], label [[FOR_EXIT_LOOPEXIT:%.*]], !llvm.loop [[LOOP0:![0-9]+]]
210209
; PEEL2UNROLL2: for.exit.loopexit:
211210
; PEEL2UNROLL2-NEXT: br label [[FOR_EXIT]]
212211
; PEEL2UNROLL2: for.exit:

llvm/test/Transforms/LoopUnroll/scevunroll.ll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
define i32 @sansCanonical(i32* %base) nounwind {
1111
; CHECK-LABEL: @sansCanonical(
1212
; CHECK-NEXT: entry:
13-
; CHECK-NEXT: [[ZEXT:%.*]] = zext i32 0 to i64
1413
; CHECK-NEXT: br label [[WHILE_BODY:%.*]]
1514
; CHECK: while.body:
1615
; CHECK-NEXT: [[ADR:%.*]] = getelementptr inbounds i32, i32* [[BASE:%.*]], i64 9
@@ -39,7 +38,6 @@ define i32 @sansCanonical(i32* %base) nounwind {
3938
; CHECK-NEXT: [[ADR_8:%.*]] = getelementptr inbounds i32, i32* [[BASE]], i64 1
4039
; CHECK-NEXT: [[TMP_8:%.*]] = load i32, i32* [[ADR_8]], align 8
4140
; CHECK-NEXT: [[SUM_NEXT_8:%.*]] = add i32 [[SUM_NEXT_7]], [[TMP_8]]
42-
; CHECK-NEXT: [[TMP_9:%.*]] = load i32, i32* [[BASE]], align 8
4341
; CHECK-NEXT: ret i32 [[SUM_NEXT_8]]
4442
;
4543
entry:

llvm/test/Transforms/LoopUnroll/unroll-header-exiting-with-phis.ll

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,18 @@ define i16 @full_unroll(i16* %A) {
1010
; CHECK-NEXT: entry:
1111
; CHECK-NEXT: br label [[FOR_COND:%.*]]
1212
; CHECK: for.cond:
13-
; CHECK-NEXT: [[TMP2:%.*]] = load i16, i16* [[A:%.*]], align 2
1413
; CHECK-NEXT: br label [[FOR_COND_CLEANUP3:%.*]]
1514
; CHECK: for.cond.cleanup:
1615
; CHECK-NEXT: [[DOTLCSSA10_LCSSA:%.*]] = phi i16 [ [[TMP2_2:%.*]], [[FOR_COND_CLEANUP3_2:%.*]] ]
1716
; CHECK-NEXT: [[TMP3:%.*]] = call i16 @func(i16 [[DOTLCSSA10_LCSSA]])
1817
; CHECK-NEXT: ret i16 0
1918
; CHECK: for.cond.cleanup3:
20-
; CHECK-NEXT: [[PTR_1:%.*]] = getelementptr inbounds i16, i16* [[A]], i64 1
21-
; CHECK-NEXT: [[TMP2_1:%.*]] = load i16, i16* [[PTR_1]], align 2
2219
; CHECK-NEXT: br label [[FOR_COND_CLEANUP3_1:%.*]]
2320
; CHECK: for.cond.cleanup3.1:
24-
; CHECK-NEXT: [[PTR_2:%.*]] = getelementptr inbounds i16, i16* [[A]], i64 2
21+
; CHECK-NEXT: [[PTR_2:%.*]] = getelementptr inbounds i16, i16* [[A:%.*]], i64 2
2522
; CHECK-NEXT: [[TMP2_2]] = load i16, i16* [[PTR_2]], align 2
2623
; CHECK-NEXT: br label [[FOR_COND_CLEANUP3_2]]
2724
; CHECK: for.cond.cleanup3.2:
28-
; CHECK-NEXT: [[PTR_3:%.*]] = getelementptr inbounds i16, i16* [[A]], i64 3
29-
; CHECK-NEXT: [[TMP2_3:%.*]] = load i16, i16* [[PTR_3]], align 2
3025
; CHECK-NEXT: br i1 false, label [[FOR_COND_CLEANUP3_3:%.*]], label [[FOR_COND_CLEANUP:%.*]]
3126
; CHECK: for.cond.cleanup3.3:
3227
; CHECK-NEXT: unreachable
@@ -59,22 +54,18 @@ define i16 @partial_unroll(i16* %A) {
5954
; CHECK-NEXT: br label [[FOR_COND:%.*]]
6055
; CHECK: for.cond:
6156
; CHECK-NEXT: [[I_0:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INC9_2:%.*]], [[FOR_COND_CLEANUP3_2:%.*]] ]
62-
; CHECK-NEXT: [[PTR:%.*]] = getelementptr inbounds i16, i16* [[A:%.*]], i64 [[I_0]]
63-
; CHECK-NEXT: [[TMP2:%.*]] = load i16, i16* [[PTR]], align 2
6457
; CHECK-NEXT: br label [[FOR_COND_CLEANUP3:%.*]]
6558
; CHECK: for.cond.cleanup:
6659
; CHECK-NEXT: [[DOTLCSSA10_LCSSA:%.*]] = phi i16 [ [[TMP2_1:%.*]], [[FOR_COND_CLEANUP3_1:%.*]] ]
6760
; CHECK-NEXT: [[TMP3:%.*]] = call i16 @func(i16 [[DOTLCSSA10_LCSSA]])
6861
; CHECK-NEXT: ret i16 0
6962
; CHECK: for.cond.cleanup3:
7063
; CHECK-NEXT: [[INC9:%.*]] = add nuw nsw i64 [[I_0]], 1
71-
; CHECK-NEXT: [[PTR_1:%.*]] = getelementptr inbounds i16, i16* [[A]], i64 [[INC9]]
64+
; CHECK-NEXT: [[PTR_1:%.*]] = getelementptr inbounds i16, i16* [[A:%.*]], i64 [[INC9]]
7265
; CHECK-NEXT: [[TMP2_1]] = load i16, i16* [[PTR_1]], align 2
7366
; CHECK-NEXT: br label [[FOR_COND_CLEANUP3_1]]
7467
; CHECK: for.cond.cleanup3.1:
7568
; CHECK-NEXT: [[INC9_1:%.*]] = add nuw nsw i64 [[INC9]], 1
76-
; CHECK-NEXT: [[PTR_2:%.*]] = getelementptr inbounds i16, i16* [[A]], i64 [[INC9_1]]
77-
; CHECK-NEXT: [[TMP2_2:%.*]] = load i16, i16* [[PTR_2]], align 2
7869
; CHECK-NEXT: [[CMP_2:%.*]] = icmp ult i64 [[INC9_1]], 200
7970
; CHECK-NEXT: br i1 [[CMP_2]], label [[FOR_COND_CLEANUP3_2]], label [[FOR_COND_CLEANUP:%.*]]
8071
; CHECK: for.cond.cleanup3.2:

llvm/test/Transforms/LoopUnroll/unroll-unconditional-latch.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ define double @test_with_lcssa(double %arg1, double* %arg2) {
6868
; CHECK-NEXT: [[RES_LCSSA:%.*]] = phi double [ [[RES_1]], [[LOOP_LATCH]] ]
6969
; CHECK-NEXT: ret double [[RES_LCSSA]]
7070
; CHECK: loop.latch.1:
71-
; CHECK-NEXT: [[PTR_1:%.*]] = getelementptr inbounds double, double* [[ARG2]], i64 2
7271
; CHECK-NEXT: unreachable
7372
;
7473

llvm/test/Transforms/LoopUnrollAndJam/unroll-and-jam.ll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
141141
; CHECK-NEXT: [[ADD_LCSSA_EPIL_2:%.*]] = phi i32 [ [[ADD_EPIL_2]], [[FOR_INNER_EPIL_2]] ]
142142
; CHECK-NEXT: [[ARRAYIDX6_EPIL_2:%.*]] = getelementptr inbounds i32, i32* [[A]], i32 [[ADD8_EPIL_1]]
143143
; CHECK-NEXT: store i32 [[ADD_LCSSA_EPIL_2]], i32* [[ARRAYIDX6_EPIL_2]], align 4, !tbaa !0
144-
; CHECK-NEXT: [[ADD8_EPIL_2:%.*]] = add nuw i32 [[ADD8_EPIL_1]], 1
145-
; CHECK-NEXT: [[EPIL_ITER_SUB_2:%.*]] = sub i32 [[EPIL_ITER_SUB_1]], 1
146144
; CHECK-NEXT: br label [[FOR_END_LOOPEXIT_EPILOG_LCSSA]]
147145
define void @test1(i32 %I, i32 %J, i32* noalias nocapture %A, i32* noalias nocapture readonly %B) #0 {
148146
entry:

0 commit comments

Comments
 (0)