Skip to content

Commit 6efcb44

Browse files
committed
Revert "[InstCombine] Accumulate the limit only on the instructions that require"
This reverts commit 0fb1679.
1 parent 0fb1679 commit 6efcb44

File tree

8 files changed

+54
-85
lines changed

8 files changed

+54
-85
lines changed

llvm/lib/Analysis/Loads.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -539,16 +539,6 @@ static bool areNonOverlapSameBaseLoadAndStore(const Value *LoadPtr,
539539
return LoadRange.intersectWith(StoreRange).isEmptySet();
540540
}
541541

542-
static bool maybeAvailableLoadStore(Instruction *Inst) {
543-
switch (Inst->getOpcode()) {
544-
case Instruction::Load:
545-
case Instruction::Store:
546-
return true;
547-
default:
548-
return isa<MemSetInst>(Inst);
549-
}
550-
}
551-
552542
static Value *getAvailableLoadStore(Instruction *Inst, const Value *Ptr,
553543
Type *AccessTy, bool AtLeastAtomic,
554544
const DataLayout &DL, bool *IsLoadCSE) {
@@ -663,7 +653,7 @@ Value *llvm::findAvailablePtrLoadStore(
663653
++(*NumScanedInst);
664654

665655
// Don't scan huge blocks.
666-
if (maybeAvailableLoadStore(Inst) && MaxInstsToScan-- == 0)
656+
if (MaxInstsToScan-- == 0)
667657
return nullptr;
668658

669659
--ScanFrom;
@@ -744,7 +734,7 @@ Value *llvm::FindAvailableLoadedValue(LoadInst *Load, BatchAAResults &AA,
744734
if (Inst.isDebugOrPseudoInst())
745735
continue;
746736

747-
if (maybeAvailableLoadStore(&Inst) && MaxInstsToScan-- == 0)
737+
if (MaxInstsToScan-- == 0)
748738
return nullptr;
749739

750740
Available = getAvailableLoadStore(&Inst, StrippedPtr, AccessTy,

llvm/test/Transforms/Coroutines/coro-retcon-resume-values.ll

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,15 @@ define i32 @main() {
3838
; CHECK-NEXT: entry:
3939
; CHECK-NEXT: [[TMP0:%.*]] = tail call ptr @allocate(i32 12)
4040
; CHECK-NEXT: store i32 1, ptr [[TMP0]], align 4
41-
; CHECK-NEXT: tail call void @llvm.experimental.noalias.scope.decl(metadata [[META0:![0-9]+]])
4241
; CHECK-NEXT: [[N_VAL3_SPILL_ADDR_I:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP0]], i64 4
43-
; CHECK-NEXT: store i32 1, ptr [[N_VAL3_SPILL_ADDR_I]], align 4, !noalias [[META0]]
42+
; CHECK-NEXT: store i32 1, ptr [[N_VAL3_SPILL_ADDR_I]], align 4, !noalias [[META0:![0-9]+]]
4443
; CHECK-NEXT: [[INPUT_SPILL_ADDR_I:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP0]], i64 8
4544
; CHECK-NEXT: store i32 2, ptr [[INPUT_SPILL_ADDR_I]], align 4, !noalias [[META0]]
46-
; CHECK-NEXT: tail call void @llvm.experimental.noalias.scope.decl(metadata [[META3:![0-9]+]])
4745
; CHECK-NEXT: [[INPUT_RELOAD_ADDR13_I:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP0]], i64 8
4846
; CHECK-NEXT: [[N_VAL3_RELOAD_ADDR11_I:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP0]], i64 4
49-
; CHECK-NEXT: store i32 3, ptr [[N_VAL3_RELOAD_ADDR11_I]], align 4, !noalias [[META3]]
47+
; CHECK-NEXT: store i32 3, ptr [[N_VAL3_RELOAD_ADDR11_I]], align 4, !noalias [[META3:![0-9]+]]
5048
; CHECK-NEXT: store i32 4, ptr [[INPUT_RELOAD_ADDR13_I]], align 4, !noalias [[META3]]
51-
; CHECK-NEXT: tail call void @llvm.experimental.noalias.scope.decl(metadata [[META6:![0-9]+]])
52-
; CHECK-NEXT: tail call void @print(i32 7), !noalias [[META6]]
49+
; CHECK-NEXT: tail call void @print(i32 7), !noalias [[META6:![0-9]+]]
5350
; CHECK-NEXT: tail call void @deallocate(ptr nonnull [[TMP0]]), !noalias [[META6]]
5451
; CHECK-NEXT: ret i32 0
5552
;

llvm/test/Transforms/JumpThreading/unreachable-loops.ll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,11 @@ define i32 @constant_phi_leads_to_self_reference(ptr %ptr) {
191191
; CHECK-LABEL: @constant_phi_leads_to_self_reference(
192192
; CHECK-NEXT: [[A9:%.*]] = alloca i1, align 1
193193
; CHECK-NEXT: br label [[F6:%.*]]
194-
; CHECK: BB5.thread:
194+
; CHECK: T3:
195195
; CHECK-NEXT: br label [[BB5:%.*]]
196+
; CHECK: BB5:
197+
; CHECK-NEXT: [[L10:%.*]] = load i1, ptr [[A9]], align 1
198+
; CHECK-NEXT: br i1 [[L10]], label [[BB6:%.*]], label [[F6]]
196199
; CHECK: BB6:
197200
; CHECK-NEXT: [[LGV3:%.*]] = load i1, ptr [[PTR:%.*]], align 1
198201
; CHECK-NEXT: [[C4:%.*]] = icmp sle i1 [[C4]], true
@@ -201,8 +204,7 @@ define i32 @constant_phi_leads_to_self_reference(ptr %ptr) {
201204
; CHECK: F6:
202205
; CHECK-NEXT: ret i32 0
203206
; CHECK: F7:
204-
; CHECK-NEXT: [[L10_PR:%.*]] = load i1, ptr [[A9]], align 1
205-
; CHECK-NEXT: br i1 [[L10_PR]], label [[BB5]], label [[F6]]
207+
; CHECK-NEXT: br label [[BB5]]
206208
;
207209
%A9 = alloca i1, align 1
208210
br i1 false, label %BB4, label %F6

llvm/test/Transforms/LowerMatrixIntrinsics/multiply-fused.ll

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -263,17 +263,21 @@ define void @multiply_reuse_load(ptr noalias %A, ptr noalias %B, ptr noalias %C)
263263
; CHECK-NEXT: store <2 x double> [[TMP7]], ptr [[C:%.*]], align 8
264264
; CHECK-NEXT: [[VEC_GEP34:%.*]] = getelementptr i8, ptr [[C]], i64 32
265265
; CHECK-NEXT: store <2 x double> [[TMP9]], ptr [[VEC_GEP34]], align 8
266+
; CHECK-NEXT: [[TMP10:%.*]] = getelementptr i8, ptr [[A]], i64 16
267+
; CHECK-NEXT: [[COL_LOAD35:%.*]] = load <2 x double>, ptr [[TMP10]], align 8
268+
; CHECK-NEXT: [[VEC_GEP36:%.*]] = getelementptr i8, ptr [[A]], i64 48
269+
; CHECK-NEXT: [[COL_LOAD37:%.*]] = load <2 x double>, ptr [[VEC_GEP36]], align 8
266270
; CHECK-NEXT: [[COL_LOAD38:%.*]] = load <2 x double>, ptr [[A]], align 8
267271
; CHECK-NEXT: [[VEC_GEP39:%.*]] = getelementptr i8, ptr [[A]], i64 32
268272
; CHECK-NEXT: [[COL_LOAD40:%.*]] = load <2 x double>, ptr [[VEC_GEP39]], align 8
269273
; CHECK-NEXT: [[SPLAT_SPLAT43:%.*]] = shufflevector <2 x double> [[COL_LOAD38]], <2 x double> poison, <2 x i32> zeroinitializer
270-
; CHECK-NEXT: [[TMP10:%.*]] = fmul contract <2 x double> [[COL_LOAD17]], [[SPLAT_SPLAT43]]
274+
; CHECK-NEXT: [[TMP11:%.*]] = fmul contract <2 x double> [[COL_LOAD35]], [[SPLAT_SPLAT43]]
271275
; CHECK-NEXT: [[SPLAT_SPLAT46:%.*]] = shufflevector <2 x double> [[COL_LOAD38]], <2 x double> poison, <2 x i32> <i32 1, i32 1>
272-
; CHECK-NEXT: [[TMP12:%.*]] = call contract <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[COL_LOAD19]], <2 x double> [[SPLAT_SPLAT46]], <2 x double> [[TMP10]])
276+
; CHECK-NEXT: [[TMP12:%.*]] = call contract <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[COL_LOAD37]], <2 x double> [[SPLAT_SPLAT46]], <2 x double> [[TMP11]])
273277
; CHECK-NEXT: [[SPLAT_SPLAT49:%.*]] = shufflevector <2 x double> [[COL_LOAD40]], <2 x double> poison, <2 x i32> zeroinitializer
274-
; CHECK-NEXT: [[TMP13:%.*]] = fmul contract <2 x double> [[COL_LOAD17]], [[SPLAT_SPLAT49]]
278+
; CHECK-NEXT: [[TMP13:%.*]] = fmul contract <2 x double> [[COL_LOAD35]], [[SPLAT_SPLAT49]]
275279
; CHECK-NEXT: [[SPLAT_SPLAT52:%.*]] = shufflevector <2 x double> [[COL_LOAD40]], <2 x double> poison, <2 x i32> <i32 1, i32 1>
276-
; CHECK-NEXT: [[TMP14:%.*]] = call contract <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[COL_LOAD19]], <2 x double> [[SPLAT_SPLAT52]], <2 x double> [[TMP13]])
280+
; CHECK-NEXT: [[TMP14:%.*]] = call contract <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[COL_LOAD37]], <2 x double> [[SPLAT_SPLAT52]], <2 x double> [[TMP13]])
277281
; CHECK-NEXT: [[TMP15:%.*]] = getelementptr i8, ptr [[A]], i64 80
278282
; CHECK-NEXT: [[COL_LOAD53:%.*]] = load <2 x double>, ptr [[TMP15]], align 8
279283
; CHECK-NEXT: [[VEC_GEP54:%.*]] = getelementptr i8, ptr [[A]], i64 112
@@ -309,18 +313,22 @@ define void @multiply_reuse_load(ptr noalias %A, ptr noalias %B, ptr noalias %C)
309313
; CHECK-NEXT: [[TMP25:%.*]] = fmul contract <2 x double> [[COL_LOAD74]], [[SPLAT_SPLAT88]]
310314
; CHECK-NEXT: [[SPLAT_SPLAT91:%.*]] = shufflevector <2 x double> [[COL_LOAD79]], <2 x double> poison, <2 x i32> <i32 1, i32 1>
311315
; CHECK-NEXT: [[TMP26:%.*]] = call contract <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[COL_LOAD76]], <2 x double> [[SPLAT_SPLAT91]], <2 x double> [[TMP25]])
316+
; CHECK-NEXT: [[TMP27:%.*]] = getelementptr i8, ptr [[A]], i64 64
317+
; CHECK-NEXT: [[COL_LOAD92:%.*]] = load <2 x double>, ptr [[TMP27]], align 8
318+
; CHECK-NEXT: [[VEC_GEP93:%.*]] = getelementptr i8, ptr [[A]], i64 96
319+
; CHECK-NEXT: [[COL_LOAD94:%.*]] = load <2 x double>, ptr [[VEC_GEP93]], align 8
312320
; CHECK-NEXT: [[TMP28:%.*]] = getelementptr i8, ptr [[A]], i64 80
313321
; CHECK-NEXT: [[COL_LOAD95:%.*]] = load <2 x double>, ptr [[TMP28]], align 8
314322
; CHECK-NEXT: [[VEC_GEP96:%.*]] = getelementptr i8, ptr [[A]], i64 112
315323
; CHECK-NEXT: [[COL_LOAD97:%.*]] = load <2 x double>, ptr [[VEC_GEP96]], align 8
316324
; CHECK-NEXT: [[SPLAT_SPLAT101:%.*]] = shufflevector <2 x double> [[COL_LOAD95]], <2 x double> poison, <2 x i32> zeroinitializer
317-
; CHECK-NEXT: [[TMP27:%.*]] = call contract <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[COL_LOAD77]], <2 x double> [[SPLAT_SPLAT101]], <2 x double> [[TMP24]])
325+
; CHECK-NEXT: [[TMP29:%.*]] = call contract <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[COL_LOAD92]], <2 x double> [[SPLAT_SPLAT101]], <2 x double> [[TMP24]])
318326
; CHECK-NEXT: [[SPLAT_SPLAT104:%.*]] = shufflevector <2 x double> [[COL_LOAD95]], <2 x double> poison, <2 x i32> <i32 1, i32 1>
319-
; CHECK-NEXT: [[TMP30:%.*]] = call contract <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[COL_LOAD79]], <2 x double> [[SPLAT_SPLAT104]], <2 x double> [[TMP27]])
327+
; CHECK-NEXT: [[TMP30:%.*]] = call contract <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[COL_LOAD94]], <2 x double> [[SPLAT_SPLAT104]], <2 x double> [[TMP29]])
320328
; CHECK-NEXT: [[SPLAT_SPLAT108:%.*]] = shufflevector <2 x double> [[COL_LOAD97]], <2 x double> poison, <2 x i32> zeroinitializer
321-
; CHECK-NEXT: [[TMP29:%.*]] = call contract <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[COL_LOAD77]], <2 x double> [[SPLAT_SPLAT108]], <2 x double> [[TMP26]])
329+
; CHECK-NEXT: [[TMP31:%.*]] = call contract <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[COL_LOAD92]], <2 x double> [[SPLAT_SPLAT108]], <2 x double> [[TMP26]])
322330
; CHECK-NEXT: [[SPLAT_SPLAT111:%.*]] = shufflevector <2 x double> [[COL_LOAD97]], <2 x double> poison, <2 x i32> <i32 1, i32 1>
323-
; CHECK-NEXT: [[TMP32:%.*]] = call contract <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[COL_LOAD79]], <2 x double> [[SPLAT_SPLAT111]], <2 x double> [[TMP29]])
331+
; CHECK-NEXT: [[TMP32:%.*]] = call contract <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[COL_LOAD94]], <2 x double> [[SPLAT_SPLAT111]], <2 x double> [[TMP31]])
324332
; CHECK-NEXT: [[TMP33:%.*]] = getelementptr i8, ptr [[C]], i64 64
325333
; CHECK-NEXT: store <2 x double> [[TMP30]], ptr [[TMP33]], align 8
326334
; CHECK-NEXT: [[VEC_GEP112:%.*]] = getelementptr i8, ptr [[C]], i64 96

llvm/test/Transforms/PhaseOrdering/early-arg-attrs-inference.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
define i32 @f(ptr noalias %p, i32 %c) {
55
; CHECK-LABEL: define noundef i32 @f
6-
; CHECK-SAME: (ptr noalias readnone captures(none) [[P:%.*]], i32 [[C:%.*]]) local_unnamed_addr {
6+
; CHECK-SAME: (ptr noalias readonly captures(none) [[P:%.*]], i32 [[C:%.*]]) local_unnamed_addr {
77
; CHECK-NEXT: tail call void @g()
88
; CHECK-NEXT: tail call void @g()
99
; CHECK-NEXT: tail call void @g()

llvm/test/Transforms/PhaseOrdering/pr137810-forward-load.ll

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,37 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
22
; RUN: opt -O2 -S < %s | FileCheck %s
33

4+
; FIXME: It can return true.
45
define i1 @main(ptr %i2) {
56
; CHECK-LABEL: define noundef i1 @main(
6-
; CHECK-SAME: ptr writeonly captures(none) initializes((0, 3)) [[I2:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
7-
; CHECK-NEXT: [[TRUE:.*:]]
7+
; CHECK-SAME: ptr captures(none) initializes((0, 3)) [[I2:%.*]]) local_unnamed_addr {
8+
; CHECK-NEXT: [[I1:%.*]] = alloca [3 x i8], align 1
89
; CHECK-NEXT: store i8 0, ptr [[I2]], align 1
910
; CHECK-NEXT: [[I3:%.*]] = getelementptr inbounds nuw i8, ptr [[I2]], i64 1
1011
; CHECK-NEXT: store i8 1, ptr [[I3]], align 1
1112
; CHECK-NEXT: [[I4:%.*]] = getelementptr inbounds nuw i8, ptr [[I2]], i64 2
1213
; CHECK-NEXT: store i8 2, ptr [[I4]], align 1
13-
; CHECK-NEXT: ret i1 true
14+
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 3, ptr nonnull [[I1]])
15+
; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) [[I1]], ptr noundef nonnull align 1 dereferenceable(3) [[I2]], i64 3, i1 false)
16+
; CHECK-NEXT: [[I51:%.*]] = load i8, ptr [[I2]], align 1
17+
; CHECK-NEXT: [[I6:%.*]] = icmp eq i8 [[I51]], 0
18+
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds nuw i8, ptr [[I2]], i64 1
19+
; CHECK-NEXT: [[I82:%.*]] = load i8, ptr [[TMP1]], align 1
20+
; CHECK-NEXT: [[I9:%.*]] = icmp eq i8 [[I82]], 1
21+
; CHECK-NEXT: [[I10:%.*]] = select i1 [[I6]], i1 [[I9]], i1 false
22+
; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds nuw i8, ptr [[I2]], i64 2
23+
; CHECK-NEXT: [[I123:%.*]] = load i8, ptr [[TMP2]], align 1
24+
; CHECK-NEXT: [[I13:%.*]] = icmp eq i8 [[I123]], 2
25+
; CHECK-NEXT: [[I14:%.*]] = select i1 [[I10]], i1 [[I13]], i1 false
26+
; CHECK-NEXT: br i1 [[I14]], label %[[TRUE:.*]], label %[[FALSE:.*]]
27+
; CHECK: [[COMMON_RET:.*]]:
28+
; CHECK-NEXT: ret i1 [[I14]]
29+
; CHECK: [[TRUE]]:
30+
; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 3, ptr nonnull [[I1]])
31+
; CHECK-NEXT: br label %[[COMMON_RET]]
32+
; CHECK: [[FALSE]]:
33+
; CHECK-NEXT: call void @assert_failed(ptr nonnull [[I1]])
34+
; CHECK-NEXT: br label %[[COMMON_RET]]
1435
;
1536
%i1 = alloca [3 x i8], align 1
1637
store i8 0, ptr %i2, align 1

llvm/test/Transforms/SLPVectorizer/revec-shufflevector.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,14 @@ define void @test6(ptr %in0, ptr %in1, ptr %in2) {
231231
; COMBINE-NEXT: [[TMP7:%.*]] = fmul <32 x float> [[TMP6]], [[TMP2]]
232232
; COMBINE-NEXT: [[GEP10:%.*]] = getelementptr inbounds nuw i8, ptr [[IN1]], i64 32
233233
; COMBINE-NEXT: [[GEP11:%.*]] = getelementptr inbounds nuw i8, ptr [[IN2:%.*]], i64 128
234+
; COMBINE-NEXT: [[TMP8:%.*]] = load <8 x float>, ptr [[IN0]], align 16
234235
; COMBINE-NEXT: store <32 x float> [[TMP7]], ptr [[IN2]], align 16
235236
; COMBINE-NEXT: [[LOAD5:%.*]] = load <16 x i8>, ptr [[GEP10]], align 1
236237
; COMBINE-NEXT: [[TMP9:%.*]] = uitofp <16 x i8> [[LOAD5]] to <16 x float>
237238
; COMBINE-NEXT: [[TMP10:%.*]] = shufflevector <4 x float> [[LOAD2]], <4 x float> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
238-
; COMBINE-NEXT: [[TMP11:%.*]] = shufflevector <8 x float> [[TMP0]], <8 x float> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
239+
; COMBINE-NEXT: [[TMP11:%.*]] = shufflevector <8 x float> [[TMP8]], <8 x float> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
239240
; COMBINE-NEXT: [[TMP12:%.*]] = shufflevector <16 x float> [[TMP10]], <16 x float> [[TMP11]], <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 16, i32 17, i32 18, i32 19, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
240-
; COMBINE-NEXT: [[TMP13:%.*]] = shufflevector <8 x float> [[TMP0]], <8 x float> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
241+
; COMBINE-NEXT: [[TMP13:%.*]] = shufflevector <8 x float> [[TMP8]], <8 x float> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
241242
; COMBINE-NEXT: [[TMP14:%.*]] = shufflevector <4 x float> [[TMP13]], <4 x float> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
242243
; COMBINE-NEXT: [[TMP15:%.*]] = shufflevector <16 x float> [[TMP12]], <16 x float> [[TMP14]], <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 16, i32 17, i32 18, i32 19, i32 poison, i32 poison, i32 poison, i32 poison>
243244
; COMBINE-NEXT: [[TMP16:%.*]] = shufflevector <16 x float> [[TMP15]], <16 x float> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 0, i32 1, i32 2, i32 3>

llvm/test/Transforms/SampleProfile/pseudo-probe-instcombine.ll

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -106,56 +106,6 @@ define i32 @load(ptr nocapture %a, ptr nocapture %b) {
106106
ret i32 %5
107107
}
108108

109-
;; Check the load is deleted.
110-
define i32 @load_not_pseudo(ptr noalias %arg, ptr noalias %arg1) {
111-
; CHECK-LABEL: @load_not_pseudo(
112-
; CHECK-NEXT: bb:
113-
; CHECK-NEXT: store i32 1, ptr [[ARG1:%.*]], align 4
114-
; CHECK-NEXT: store i32 1, ptr [[ARG2:%.*]], align 4
115-
; CHECK-NEXT: ret i32 1
116-
;
117-
bb:
118-
store i32 1, ptr %arg, align 4
119-
store i32 1, ptr %arg1, align 4
120-
%i = load i32, ptr %arg, align 4
121-
ret i32 %i
122-
}
123-
124-
;; Check the load is deleted.
125-
define i32 @load_not_pseudo_2(ptr noalias %arg, ptr noalias %arg1) {
126-
; CHECK-LABEL: @load_not_pseudo_2(
127-
; CHECK-NEXT: bb:
128-
; CHECK-NEXT: store i32 1, ptr [[ARG:%.*]], align 4
129-
; CHECK-NEXT: [[ARG1_1:%.*]] = getelementptr inbounds nuw i8, ptr [[ARG1:%.*]], i64 4
130-
; CHECK-NEXT: store i32 1, ptr [[ARG1_1]], align 4
131-
; CHECK-NEXT: ret i32 1
132-
;
133-
bb:
134-
store i32 1, ptr %arg, align 4
135-
%arg1_1 = getelementptr inbounds i32, ptr %arg1, i32 1
136-
store i32 1, ptr %arg1_1, align 4
137-
%i = load i32, ptr %arg, align 4
138-
ret i32 %i
139-
}
140-
141-
;; Check the load is not deleted.
142-
define i32 @load_not_pseudo_3(ptr noalias %arg, ptr noalias %arg1, ptr noalias %arg2) {
143-
; CHECK-LABEL: @load_not_pseudo_3(
144-
; CHECK-NEXT: bb:
145-
; CHECK-NEXT: store i32 1, ptr [[ARG:%.*]], align 4
146-
; CHECK-NEXT: store i32 1, ptr [[ARG1:%.*]], align 4
147-
; CHECK-NEXT: store i32 1, ptr [[ARG2:%.*]], align 4
148-
; CHECK-NEXT: [[I:%.*]] = load i32, ptr [[ARG]], align 4
149-
; CHECK-NEXT: ret i32 [[I]]
150-
;
151-
bb:
152-
store i32 1, ptr %arg, align 4
153-
store i32 1, ptr %arg1, align 4
154-
store i32 1, ptr %arg2, align 4
155-
%i = load i32, ptr %arg, align 4
156-
ret i32 %i
157-
}
158-
159109
;; Check the first store is deleted.
160110
define void @dse(ptr %p) {
161111
; CHECK-LABEL: @dse(

0 commit comments

Comments
 (0)