From e44b11d9b6baa0bfc3d864d455a4b5717499f05b Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 2 Jan 2023 11:16:09 +0100 Subject: [PATCH] [ValueTracking] Treat branch on undef as UB as well MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We were already treating branch on poison as UB, but branch on undef is also UB. Move the checks into the correct function. From LangRef for br: > If ‘cond’ is poison or undef, this instruction has undefined behavior. From LangRef for switch: > If ‘value’ is poison or undef, this instruction has undefined behavior. There is a minor regression in dont-distribute-phi.ll, apparently we handle that pattern in logical but not bitwise form. --- llvm/lib/Analysis/ValueTracking.cpp | 18 +++---- .../Attributor/ArgumentPromotion/control-flow.ll | 6 +-- .../Attributor/IPConstantProp/return-argument.ll | 8 +-- .../Attributor/IPConstantProp/return-constant.ll | 12 ++--- .../Attributor/IPConstantProp/return-constants.ll | 14 +++--- ...lve-after-each-resolving-undefs-for-function.ll | 4 +- llvm/test/Transforms/Attributor/align.ll | 24 ++++----- .../Transforms/Attributor/dereferenceable-1.ll | 6 +-- .../Attributor/dereferenceable-2-inseltpoison.ll | 4 +- .../Transforms/Attributor/dereferenceable-2.ll | 4 +- .../test/Transforms/Attributor/memory_locations.ll | 28 +++++------ .../Attributor/multiple-offsets-pointer-info.ll | 10 ++-- llvm/test/Transforms/Attributor/nocapture-1.ll | 20 ++++---- llvm/test/Transforms/Attributor/nonnull.ll | 12 ++--- llvm/test/Transforms/Attributor/norecurse.ll | 4 +- llvm/test/Transforms/Attributor/nounwind.ll | 2 +- llvm/test/Transforms/Attributor/potential.ll | 26 +++++----- llvm/test/Transforms/Attributor/range.ll | 14 +++--- .../Attributor/reduced/crash_ptr2int_cgscc.ll | 2 +- llvm/test/Transforms/Attributor/returned.ll | 4 +- .../Transforms/Attributor/undefined_behavior.ll | 34 ++++++------- .../Transforms/Attributor/value-simplify-assume.ll | 56 ++++++++++----------- .../Attributor/value-simplify-instances.ll | 40 +++++++-------- .../Attributor/value-simplify-pointer-info.ll | 16 +++--- .../Attributor/value-simplify-reachability.ll | 8 +-- llvm/test/Transforms/Attributor/value-simplify.ll | 58 +++++++++++----------- llvm/test/Transforms/Attributor/willreturn.ll | 4 +- .../Transforms/InstCombine/dont-distribute-phi.ll | 9 ++-- 28 files changed, 225 insertions(+), 222 deletions(-) diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 5a4d748..03cbb6c 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -5746,6 +5746,15 @@ void llvm::getGuaranteedWellDefinedOps( if (I->getFunction()->hasRetAttribute(Attribute::NoUndef)) Operands.insert(I->getOperand(0)); break; + case Instruction::Switch: + Operands.insert(cast(I)->getCondition()); + break; + case Instruction::Br: { + auto *BR = cast(I); + if (BR->isConditional()) + Operands.insert(BR->getCondition()); + break; + } default: break; } @@ -5762,15 +5771,6 @@ void llvm::getGuaranteedNonPoisonOps(const Instruction *I, case Instruction::SRem: Operands.insert(I->getOperand(1)); break; - case Instruction::Switch: - Operands.insert(cast(I)->getCondition()); - break; - case Instruction::Br: { - auto *BR = cast(I); - if (BR->isConditional()) - Operands.insert(BR->getCondition()); - break; - } default: break; } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll index bf49e34..8ac931e 100644 --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll @@ -6,7 +6,7 @@ define internal i32 @callee(i1 %C, ptr %P) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: read) ; CHECK-LABEL: define {{[^@]+}}@callee -; CHECK-SAME: (i1 [[C:%.*]], ptr nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CHECK: T: @@ -36,9 +36,9 @@ define i32 @foo(i1 %C, ptr %P) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@foo -; CGSCC-SAME: (i1 [[C:%.*]], ptr nocapture nofree readonly [[P:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree readonly [[P:%.*]]) #[[ATTR1:[0-9]+]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[X:%.*]] = call i32 @callee(i1 [[C]], ptr nocapture nofree readonly [[P]]) #[[ATTR2:[0-9]+]] +; CGSCC-NEXT: [[X:%.*]] = call i32 @callee(i1 noundef [[C]], ptr nocapture nofree readonly [[P]]) #[[ATTR2:[0-9]+]] ; CGSCC-NEXT: ret i32 [[X]] ; entry: diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll b/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll index 99e3b5b..4c25fc4 100644 --- a/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll @@ -6,7 +6,7 @@ define internal ptr @incdec(i1 %C, ptr %V) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@incdec -; TUNIT-SAME: (i1 [[C:%.*]], ptr noalias nofree noundef nonnull returned writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr noalias nofree noundef nonnull returned writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] { ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: T: ; TUNIT-NEXT: ret ptr [[V]] @@ -15,7 +15,7 @@ define internal ptr @incdec(i1 %C, ptr %V) { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@incdec -; CGSCC-SAME: (i1 [[C:%.*]], ptr nofree noundef nonnull returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr nofree noundef nonnull returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] { ; CGSCC-NEXT: [[X:%.*]] = load i32, ptr [[V]], align 4 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: T: @@ -74,9 +74,9 @@ define void @caller(i1 %C) personality ptr @__gxx_personality_v0 { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@caller -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] personality ptr @__gxx_personality_v0 { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR2:[0-9]+]] personality ptr @__gxx_personality_v0 { ; CGSCC-NEXT: [[Q:%.*]] = alloca i32, align 4 -; CGSCC-NEXT: [[W:%.*]] = call align 4 ptr @incdec(i1 [[C]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[Q]]) #[[ATTR3:[0-9]+]] +; CGSCC-NEXT: [[W:%.*]] = call align 4 ptr @incdec(i1 noundef [[C]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[Q]]) #[[ATTR3:[0-9]+]] ; CGSCC-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR4:[0-9]+]] ; CGSCC-NEXT: [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0 ; CGSCC-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR3]] diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll b/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll index 2d14f38..16bdda2 100644 --- a/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll @@ -17,8 +17,8 @@ define i1 @invokecaller(i1 %C) personality ptr @__gxx_personality_v0 { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@invokecaller -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] personality ptr @__gxx_personality_v0 { -; CGSCC-NEXT: [[X:%.*]] = call i32 @foo(i1 [[C]]) #[[ATTR2:[0-9]+]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR0:[0-9]+]] personality ptr @__gxx_personality_v0 { +; CGSCC-NEXT: [[X:%.*]] = call i32 @foo(i1 noundef [[C]]) #[[ATTR2:[0-9]+]] ; CGSCC-NEXT: br label [[OK:%.*]] ; CGSCC: OK: ; CGSCC-NEXT: [[Y:%.*]] = icmp ne i32 [[X]], 0 @@ -39,7 +39,7 @@ FAIL: define internal i32 @foo(i1 %C) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@foo -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: T: ; TUNIT-NEXT: ret i32 undef @@ -48,7 +48,7 @@ define internal i32 @foo(i1 %C) { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@foo -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1:[0-9]+]] { ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: T: ; CGSCC-NEXT: ret i32 52 @@ -72,8 +72,8 @@ define i1 @caller(i1 %C) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@caller -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; CGSCC-NEXT: [[X:%.*]] = call i32 @foo(i1 [[C]]) #[[ATTR3:[0-9]+]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[X:%.*]] = call i32 @foo(i1 noundef [[C]]) #[[ATTR3:[0-9]+]] ; CGSCC-NEXT: [[Y:%.*]] = icmp ne i32 [[X]], 0 ; CGSCC-NEXT: ret i1 [[Y]] ; diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll b/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll index 4327e6d..239bce9 100644 --- a/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll @@ -9,7 +9,7 @@ define internal %0 @foo(i1 %Q) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@foo -; CHECK-SAME: (i1 [[Q:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-SAME: (i1 noundef [[Q:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] ; CHECK: T: ; CHECK-NEXT: [[MRV:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 @@ -36,7 +36,7 @@ F: ; preds = %0 define internal %0 @bar(i1 %Q) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@bar -; CHECK-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (i1 noundef [[Q:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: [[A:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 ; CHECK-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] ; CHECK: T: @@ -67,8 +67,8 @@ define %0 @caller(i1 %Q) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@caller -; CGSCC-SAME: (i1 [[Q:%.*]]) #[[ATTR1:[0-9]+]] { -; CGSCC-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR2:[0-9]+]] +; CGSCC-SAME: (i1 noundef [[Q:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 noundef [[Q]]) #[[ATTR2:[0-9]+]] ; CGSCC-NEXT: ret [[TMP0]] [[X]] ; %X = call %0 @foo(i1 %Q) @@ -100,11 +100,11 @@ define i32 @caller2(i1 %Q) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@caller2 -; CGSCC-SAME: (i1 [[Q:%.*]]) #[[ATTR1]] { -; CGSCC-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR2]] +; CGSCC-SAME: (i1 noundef [[Q:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 noundef [[Q]]) #[[ATTR2]] ; CGSCC-NEXT: [[A:%.*]] = extractvalue [[TMP0]] [[X]], 0 ; CGSCC-NEXT: [[B:%.*]] = extractvalue [[TMP0]] [[X]], 1 -; CGSCC-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 [[Q]]) #[[ATTR2]] +; CGSCC-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 noundef [[Q]]) #[[ATTR2]] ; CGSCC-NEXT: [[C:%.*]] = extractvalue [[TMP0]] [[Y]], 0 ; CGSCC-NEXT: [[D:%.*]] = extractvalue [[TMP0]] [[Y]], 1 ; CGSCC-NEXT: [[M:%.*]] = add i32 [[A]], [[C]] diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll b/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll index 7eb42f7..f397410 100644 --- a/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll @@ -5,7 +5,7 @@ define internal i32 @testf(i1 %c) { ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@testf -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR0:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: br i1 [[C]], label [[IF_COND:%.*]], label [[IF_END:%.*]] ; CGSCC: if.cond: @@ -35,7 +35,7 @@ define internal i32 @test1(i1 %c) { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: br label [[IF_THEN:%.*]] ; CGSCC: if.then: -; CGSCC-NEXT: [[CALL:%.*]] = call i32 @testf(i1 [[C]]) #[[ATTR2:[0-9]+]] +; CGSCC-NEXT: [[CALL:%.*]] = call i32 @testf(i1 noundef [[C]]) #[[ATTR2:[0-9]+]] ; CGSCC-NEXT: [[RES:%.*]] = icmp eq i32 [[CALL]], 10 ; CGSCC-NEXT: br i1 [[RES]], label [[RET1:%.*]], label [[RET2:%.*]] ; CGSCC: ret1: diff --git a/llvm/test/Transforms/Attributor/align.ll b/llvm/test/Transforms/Attributor/align.ll index 5ffa951..b7abe99 100644 --- a/llvm/test/Transforms/Attributor/align.ll +++ b/llvm/test/Transforms/Attributor/align.ll @@ -701,7 +701,7 @@ define void @test12-6(i32* align 4 %p) { define void @test13(i1 %c, i32* align 32 %dst) #0 { ; TUNIT: Function Attrs: nofree noinline norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; TUNIT-LABEL: define {{[^@]+}}@test13 -; TUNIT-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR7:[0-9]+]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR7:[0-9]+]] { ; TUNIT-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; TUNIT: truebb: ; TUNIT-NEXT: br label [[END:%.*]] @@ -714,7 +714,7 @@ define void @test13(i1 %c, i32* align 32 %dst) #0 { ; ; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; CGSCC-LABEL: define {{[^@]+}}@test13 -; CGSCC-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] { ; CGSCC-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; CGSCC: truebb: ; CGSCC-NEXT: br label [[END:%.*]] @@ -739,7 +739,7 @@ end: define void @test13-1(i1 %c, i32* align 32 %dst) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write) ; TUNIT-LABEL: define {{[^@]+}}@test13-1 -; TUNIT-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] { ; TUNIT-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; TUNIT: truebb: ; TUNIT-NEXT: br label [[END:%.*]] @@ -752,7 +752,7 @@ define void @test13-1(i1 %c, i32* align 32 %dst) { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write) ; CGSCC-LABEL: define {{[^@]+}}@test13-1 -; CGSCC-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9:[0-9]+]] { ; CGSCC-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; CGSCC: truebb: ; CGSCC-NEXT: br label [[END:%.*]] @@ -777,7 +777,7 @@ end: define void @test13-2(i1 %c, i32* align 32 %dst) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write) ; TUNIT-LABEL: define {{[^@]+}}@test13-2 -; TUNIT-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { ; TUNIT-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; TUNIT: truebb: ; TUNIT-NEXT: br label [[END:%.*]] @@ -790,7 +790,7 @@ define void @test13-2(i1 %c, i32* align 32 %dst) { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write) ; CGSCC-LABEL: define {{[^@]+}}@test13-2 -; CGSCC-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] { ; CGSCC-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; CGSCC: truebb: ; CGSCC-NEXT: br label [[END:%.*]] @@ -815,7 +815,7 @@ end: define void @test13-3(i1 %c, i32* align 32 %dst) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write) ; TUNIT-LABEL: define {{[^@]+}}@test13-3 -; TUNIT-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { ; TUNIT-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; TUNIT: truebb: ; TUNIT-NEXT: br label [[END:%.*]] @@ -828,7 +828,7 @@ define void @test13-3(i1 %c, i32* align 32 %dst) { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write) ; CGSCC-LABEL: define {{[^@]+}}@test13-3 -; CGSCC-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] { ; CGSCC-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; CGSCC: truebb: ; CGSCC-NEXT: br label [[END:%.*]] @@ -1053,7 +1053,7 @@ declare void @align4_callee(i8* align(4) %p) define internal i8* @aligned_8_return(i8* %a, i1 %c1, i1 %c2) norecurse { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@aligned_8_return -; TUNIT-SAME: (i8* noalias nofree readnone align 16 "no-capture-maybe-returned" [[A:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR9]] { +; TUNIT-SAME: (i8* noalias nofree readnone align 16 "no-capture-maybe-returned" [[A:%.*]], i1 noundef [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR9]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i8*, align 8 ; TUNIT-NEXT: br i1 [[C1]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: @@ -1070,7 +1070,7 @@ define internal i8* @aligned_8_return(i8* %a, i1 %c1, i1 %c2) norecurse { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@aligned_8_return -; CGSCC-SAME: (i8* noalias nofree readnone align 16 "no-capture-maybe-returned" [[A:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR10]] { +; CGSCC-SAME: (i8* noalias nofree readnone align 16 "no-capture-maybe-returned" [[A:%.*]], i1 noundef [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR10]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i8*, align 8 ; CGSCC-NEXT: br i1 [[C1]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: @@ -1109,8 +1109,8 @@ define i8* @aligned_8_return_caller(i8* align(16) %a, i1 %c1, i1 %c2) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@aligned_8_return_caller -; CGSCC-SAME: (i8* nofree readnone align 16 [[A:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR12:[0-9]+]] { -; CGSCC-NEXT: [[R:%.*]] = call align 8 i8* @aligned_8_return(i8* noalias nofree readnone align 16 [[A]], i1 [[C1]], i1 [[C2]]) #[[ATTR13]] +; CGSCC-SAME: (i8* nofree readnone align 16 [[A:%.*]], i1 noundef [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR12:[0-9]+]] { +; CGSCC-NEXT: [[R:%.*]] = call align 8 i8* @aligned_8_return(i8* noalias nofree readnone align 16 [[A]], i1 noundef [[C1]], i1 [[C2]]) #[[ATTR13]] ; CGSCC-NEXT: ret i8* [[R]] ; %r = call i8* @aligned_8_return(i8* %a, i1 %c1, i1 %c2) diff --git a/llvm/test/Transforms/Attributor/dereferenceable-1.ll b/llvm/test/Transforms/Attributor/dereferenceable-1.ll index ec3a106..6c1e0cb 100644 --- a/llvm/test/Transforms/Attributor/dereferenceable-1.ll +++ b/llvm/test/Transforms/Attributor/dereferenceable-1.ll @@ -209,7 +209,7 @@ define i32* @f7_0(i32* %ptr) { define void @f7_1(i32* %ptr, i1 %c) { ; CHECK: Function Attrs: nounwind willreturn ; CHECK-LABEL: define {{[^@]+}}@f7_1 -; CHECK-SAME: (i32* noundef nonnull align 4 dereferenceable(4) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (i32* noundef nonnull align 4 dereferenceable(4) [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: [[A:%.*]] = tail call i32 @unkown_f(i32* noundef nonnull align 4 dereferenceable(4) [[PTR]]) #[[ATTR1]] ; CHECK-NEXT: [[PTR_0:%.*]] = load i32, i32* [[PTR]], align 4 ; CHECK-NEXT: [[B:%.*]] = tail call i32 @unkown_f(i32* noundef nonnull align 4 dereferenceable(4) [[PTR]]) #[[ATTR1]] @@ -240,7 +240,7 @@ if.false: define void @f7_2(i1 %c) { ; CHECK: Function Attrs: nounwind willreturn ; CHECK-LABEL: define {{[^@]+}}@f7_2 -; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: [[PTR:%.*]] = tail call nonnull align 4 dereferenceable(4) i32* @unkown_ptr() #[[ATTR1]] ; CHECK-NEXT: [[A:%.*]] = tail call i32 @unkown_f(i32* noundef nonnull align 4 dereferenceable(4) [[PTR]]) #[[ATTR1]] ; CHECK-NEXT: [[ARG_A_0:%.*]] = load i32, i32* [[PTR]], align 4 @@ -843,7 +843,7 @@ declare void @llvm.assume(i1) define void @max_offset(i1 %c) { ; CHECK: Function Attrs: nounwind willreturn ; CHECK-LABEL: define {{[^@]+}}@max_offset -; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CHECK: t: diff --git a/llvm/test/Transforms/Attributor/dereferenceable-2-inseltpoison.ll b/llvm/test/Transforms/Attributor/dereferenceable-2-inseltpoison.ll index 781f73c..503e9f7 100644 --- a/llvm/test/Transforms/Attributor/dereferenceable-2-inseltpoison.ll +++ b/llvm/test/Transforms/Attributor/dereferenceable-2-inseltpoison.ll @@ -162,7 +162,7 @@ exit: define void @not_entry_not_guaranteed_to_execute(i8* %ptr, i1 %cond) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute -; CHECK-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; CHECK-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] ; CHECK: loads: @@ -189,7 +189,7 @@ exit: define void @partial_in_entry(i16* %ptr, i1 %cond) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@partial_in_entry -; CHECK-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; CHECK-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] ; CHECK: loads: diff --git a/llvm/test/Transforms/Attributor/dereferenceable-2.ll b/llvm/test/Transforms/Attributor/dereferenceable-2.ll index da0946a..05f576e 100644 --- a/llvm/test/Transforms/Attributor/dereferenceable-2.ll +++ b/llvm/test/Transforms/Attributor/dereferenceable-2.ll @@ -162,7 +162,7 @@ exit: define void @not_entry_not_guaranteed_to_execute(i8* %ptr, i1 %cond) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute -; CHECK-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; CHECK-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] ; CHECK: loads: @@ -189,7 +189,7 @@ exit: define void @partial_in_entry(i16* %ptr, i1 %cond) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@partial_in_entry -; CHECK-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; CHECK-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] ; CHECK: loads: diff --git a/llvm/test/Transforms/Attributor/memory_locations.ll b/llvm/test/Transforms/Attributor/memory_locations.ll index dd65eba..d25aa7fd 100644 --- a/llvm/test/Transforms/Attributor/memory_locations.ll +++ b/llvm/test/Transforms/Attributor/memory_locations.ll @@ -483,7 +483,7 @@ define void @writeonly_global_via_arg_internal() { define i8 @recursive_not_readnone(ptr %ptr, i1 %c) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@recursive_not_readnone -; TUNIT-SAME: (ptr nocapture nofree writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8:[0-9]+]] { +; TUNIT-SAME: (ptr nocapture nofree writeonly [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR8:[0-9]+]] { ; TUNIT-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: @@ -495,7 +495,7 @@ define i8 @recursive_not_readnone(ptr %ptr, i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@recursive_not_readnone -; CGSCC-SAME: (ptr nocapture nofree writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree writeonly [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR9:[0-9]+]] { ; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: @@ -519,7 +519,7 @@ f: define internal i8 @recursive_not_readnone_internal(ptr %ptr, i1 %c) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@recursive_not_readnone_internal -; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR8]] { ; TUNIT-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: @@ -531,7 +531,7 @@ define internal i8 @recursive_not_readnone_internal(ptr %ptr, i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@recursive_not_readnone_internal -; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR9]] { +; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR9]] { ; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: @@ -562,9 +562,9 @@ define i8 @readnone_caller(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@readnone_caller -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR10:[0-9]+]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR10:[0-9]+]] { ; CGSCC-NEXT: [[A:%.*]] = alloca i8, align 1 -; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 [[C]]) #[[ATTR13:[0-9]+]] +; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 noundef [[C]]) #[[ATTR13:[0-9]+]] ; CGSCC-NEXT: ret i8 [[R]] ; %a = alloca i8 @@ -575,7 +575,7 @@ define i8 @readnone_caller(i1 %c) { define internal i8 @recursive_readnone_internal2(ptr %ptr, i1 %c) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@recursive_readnone_internal2 -; TUNIT-SAME: (ptr nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (ptr nocapture nofree nonnull writeonly [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR8]] { ; TUNIT-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: @@ -587,7 +587,7 @@ define internal i8 @recursive_readnone_internal2(ptr %ptr, i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@recursive_readnone_internal2 -; CGSCC-SAME: (ptr nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR9]] { +; CGSCC-SAME: (ptr nocapture nofree nonnull writeonly [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR9]] { ; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: @@ -617,8 +617,8 @@ define i8 @readnone_caller2(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@readnone_caller2 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR10]] { -; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_readnone_internal2(ptr undef, i1 [[C]]) #[[ATTR13]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR10]] { +; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_readnone_internal2(ptr undef, i1 noundef [[C]]) #[[ATTR13]] ; CGSCC-NEXT: ret i8 [[R]] ; %r = call i8 @recursive_readnone_internal2(ptr undef, i1 %c) @@ -628,7 +628,7 @@ define i8 @readnone_caller2(i1 %c) { define internal i8 @recursive_not_readnone_internal3(ptr %ptr, i1 %c) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@recursive_not_readnone_internal3 -; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR8]] { ; TUNIT-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: @@ -640,7 +640,7 @@ define internal i8 @recursive_not_readnone_internal3(ptr %ptr, i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@recursive_not_readnone_internal3 -; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR9]] { +; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR9]] { ; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: @@ -671,9 +671,9 @@ define i8 @readnone_caller3(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@readnone_caller3 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR10]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR10]] { ; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 -; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal3(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 [[C]]) #[[ATTR13]] +; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal3(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef [[C]]) #[[ATTR13]] ; CGSCC-NEXT: ret i8 [[R]] ; %alloc = alloca i8 diff --git a/llvm/test/Transforms/Attributor/multiple-offsets-pointer-info.ll b/llvm/test/Transforms/Attributor/multiple-offsets-pointer-info.ll index e5eee9b..f2e9e6b 100644 --- a/llvm/test/Transforms/Attributor/multiple-offsets-pointer-info.ll +++ b/llvm/test/Transforms/Attributor/multiple-offsets-pointer-info.ll @@ -296,7 +296,7 @@ entry: define i8 @phi_gep_simplifiable_1(i1 %cnd1, i1 %cnd2) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn ; CHECK-LABEL: define {{[^@]+}}@phi_gep_simplifiable_1 -; CHECK-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR2]] { +; CHECK-SAME: (i1 noundef [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 ; CHECK-NEXT: br i1 [[CND1]], label [[THEN:%.*]], label [[ELSE:%.*]] @@ -342,7 +342,7 @@ join: define i8 @phi_gep_simplifiable_2(i1 %cnd1, i1 %cnd2) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write) ; CHECK-LABEL: define {{[^@]+}}@phi_gep_simplifiable_2 -; CHECK-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (i1 noundef [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 ; CHECK-NEXT: br i1 [[CND1]], label [[THEN:%.*]], label [[ELSE:%.*]] @@ -383,7 +383,7 @@ join: define i8 @phi_gep_not_simplifiable_1(i1 %cnd1, i1 %cnd2) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn ; CHECK-LABEL: define {{[^@]+}}@phi_gep_not_simplifiable_1 -; CHECK-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR2]] { +; CHECK-SAME: (i1 noundef [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 ; CHECK-NEXT: [[GEP23:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 23 @@ -422,7 +422,7 @@ join: define i8 @phi_gep_not_simplifiable_2(i1 %cnd1, i1 %cnd2) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn ; CHECK-LABEL: define {{[^@]+}}@phi_gep_not_simplifiable_2 -; CHECK-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR2]] { +; CHECK-SAME: (i1 noundef [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 ; CHECK-NEXT: [[GEP23:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 23 @@ -460,7 +460,7 @@ join: define i8 @phi_offsets(i1 %cnd1, i1 %cnd2) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@phi_offsets -; CHECK-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (i1 noundef [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 ; CHECK-NEXT: br i1 [[CND1]], label [[THEN:%.*]], label [[ELSE:%.*]] diff --git a/llvm/test/Transforms/Attributor/nocapture-1.ll b/llvm/test/Transforms/Attributor/nocapture-1.ll index 2f58307..9b58957 100644 --- a/llvm/test/Transforms/Attributor/nocapture-1.ll +++ b/llvm/test/Transforms/Attributor/nocapture-1.ll @@ -372,7 +372,7 @@ define void @test1_1(ptr %x1_1, ptr %y1_1, i1 %c) { define ptr @test1_2(ptr %x1_2, ptr %y1_2, i1 %c) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(write) ; TUNIT-LABEL: define {{[^@]+}}@test1_2 -; TUNIT-SAME: (ptr nocapture nofree readnone [[X1_2:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 [[C:%.*]]) #[[ATTR7]] { +; TUNIT-SAME: (ptr nocapture nofree readnone [[X1_2:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 noundef [[C:%.*]]) #[[ATTR7]] { ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: ; TUNIT-NEXT: call void @test1_1(ptr noalias nocapture nofree readnone undef, ptr noalias nocapture nofree readnone [[Y1_2]], i1 noundef [[C]]) #[[ATTR17]] @@ -383,7 +383,7 @@ define ptr @test1_2(ptr %x1_2, ptr %y1_2, i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(write) ; CGSCC-LABEL: define {{[^@]+}}@test1_2 -; CGSCC-SAME: (ptr nocapture nofree readnone [[X1_2:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 [[C:%.*]]) #[[ATTR10]] { +; CGSCC-SAME: (ptr nocapture nofree readnone [[X1_2:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 noundef [[C:%.*]]) #[[ATTR10]] { ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: ; CGSCC-NEXT: call void @test1_1(ptr noalias nocapture nofree readnone undef, ptr noalias nocapture nofree readnone [[Y1_2]], i1 noundef [[C]]) #[[ATTR19]] @@ -464,7 +464,7 @@ define void @test4_1(ptr %x4_1, i1 %c) { define ptr @test4_2(ptr %x4_2, ptr %y4_2, ptr %z4_2, i1 %c) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(write) ; TUNIT-LABEL: define {{[^@]+}}@test4_2 -; TUNIT-SAME: (ptr nocapture nofree readnone [[X4_2:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], ptr nocapture nofree readnone [[Z4_2:%.*]], i1 [[C:%.*]]) #[[ATTR7]] { +; TUNIT-SAME: (ptr nocapture nofree readnone [[X4_2:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], ptr nocapture nofree readnone [[Z4_2:%.*]], i1 noundef [[C:%.*]]) #[[ATTR7]] { ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: ; TUNIT-NEXT: call void @test4_1(ptr noalias nocapture nofree noundef readnone align 4294967296 null, i1 noundef [[C]]) #[[ATTR17]] @@ -475,7 +475,7 @@ define ptr @test4_2(ptr %x4_2, ptr %y4_2, ptr %z4_2, i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(write) ; CGSCC-LABEL: define {{[^@]+}}@test4_2 -; CGSCC-SAME: (ptr nocapture nofree readnone [[X4_2:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], ptr nocapture nofree readnone [[Z4_2:%.*]], i1 [[C:%.*]]) #[[ATTR10]] { +; CGSCC-SAME: (ptr nocapture nofree readnone [[X4_2:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], ptr nocapture nofree readnone [[Z4_2:%.*]], i1 noundef [[C:%.*]]) #[[ATTR10]] { ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: ; CGSCC-NEXT: call void @test4_1(ptr noalias nocapture nofree noundef readnone align 4294967296 null, i1 noundef [[C]]) #[[ATTR19]] @@ -731,8 +731,8 @@ define i1 @nocaptureDereferenceableOrNullICmp(ptr dereferenceable_or_null(4) %x) ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@nocaptureDereferenceableOrNullICmp ; CHECK-SAME: (ptr nocapture nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR0]] { -; CHECK-NEXT: [[TMP2:%.*]] = icmp eq ptr [[X]], null -; CHECK-NEXT: ret i1 [[TMP2]] +; CHECK-NEXT: [[TMP1:%.*]] = icmp eq ptr [[X]], null +; CHECK-NEXT: ret i1 [[TMP1]] ; %1 = icmp eq ptr %x, null ret i1 %1 @@ -742,14 +742,14 @@ define i1 @captureDereferenceableOrNullICmp(ptr dereferenceable_or_null(4) %x) n ; TUNIT: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@captureDereferenceableOrNullICmp ; TUNIT-SAME: (ptr nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR9:[0-9]+]] { -; TUNIT-NEXT: [[TMP2:%.*]] = icmp eq ptr [[X]], null -; TUNIT-NEXT: ret i1 [[TMP2]] +; TUNIT-NEXT: [[TMP1:%.*]] = icmp eq ptr [[X]], null +; TUNIT-NEXT: ret i1 [[TMP1]] ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@captureDereferenceableOrNullICmp ; CGSCC-SAME: (ptr nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR12:[0-9]+]] { -; CGSCC-NEXT: [[TMP2:%.*]] = icmp eq ptr [[X]], null -; CGSCC-NEXT: ret i1 [[TMP2]] +; CGSCC-NEXT: [[TMP1:%.*]] = icmp eq ptr [[X]], null +; CGSCC-NEXT: ret i1 [[TMP1]] ; %1 = icmp eq ptr %x, null ret i1 %1 diff --git a/llvm/test/Transforms/Attributor/nonnull.ll b/llvm/test/Transforms/Attributor/nonnull.ll index 09bebee..0dfd455 100644 --- a/llvm/test/Transforms/Attributor/nonnull.ll +++ b/llvm/test/Transforms/Attributor/nonnull.ll @@ -31,7 +31,7 @@ define ptr @test2(ptr nonnull %p) { define ptr @test2A(i1 %c, ptr %ret) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@test2A -; CHECK-SAME: (i1 [[C:%.*]], ptr nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-SAME: (i1 noundef [[C:%.*]], ptr nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] ; CHECK: A: ; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR13:[0-9]+]] [ "nonnull"(ptr [[RET]]) ] @@ -52,7 +52,7 @@ B: define ptr @test2B(i1 %c, ptr %ret) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@test2B -; CHECK-SAME: (i1 [[C:%.*]], ptr nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR2]] { +; CHECK-SAME: (i1 noundef [[C:%.*]], ptr nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] ; CHECK: A: ; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR13]] [ "dereferenceable"(ptr [[RET]], i32 4) ] @@ -74,7 +74,7 @@ B: ; can we still mark the other one which is trivially nonnull define ptr @scc_binder(i1 %c) { ; CHECK-LABEL: define {{[^@]+}}@scc_binder -; CHECK-SAME: (i1 [[C:%.*]]) { +; CHECK-SAME: (i1 noundef [[C:%.*]]) { ; CHECK-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] ; CHECK: rec: ; CHECK-NEXT: [[TMP1:%.*]] = call ptr @test3(i1 noundef [[C]]) @@ -140,7 +140,7 @@ define ptr @test4() { define ptr @test5_helper(i1 %c) { ; TUNIT: Function Attrs: nofree nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@test5_helper -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] ; TUNIT: rec: ; TUNIT-NEXT: br label [[END]] @@ -149,7 +149,7 @@ define ptr @test5_helper(i1 %c) { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@test5_helper -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1]] { ; CGSCC-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] ; CGSCC: rec: ; CGSCC-NEXT: br label [[END]] @@ -818,7 +818,7 @@ define void @parent4(ptr %a, ptr %b, ptr %c) { define void @parent5(ptr %a, i1 %a_is_notnull) { ; CHECK-LABEL: define {{[^@]+}}@parent5 -; CHECK-SAME: (ptr [[A:%.*]], i1 [[A_IS_NOTNULL:%.*]]) { +; CHECK-SAME: (ptr [[A:%.*]], i1 noundef [[A_IS_NOTNULL:%.*]]) { ; CHECK-NEXT: br i1 [[A_IS_NOTNULL]], label [[T:%.*]], label [[F:%.*]] ; CHECK: t: ; CHECK-NEXT: call void @use1nonnull(ptr nonnull [[A]]) diff --git a/llvm/test/Transforms/Attributor/norecurse.ll b/llvm/test/Transforms/Attributor/norecurse.ll index ba9cbb9..275c8793 100644 --- a/llvm/test/Transforms/Attributor/norecurse.ll +++ b/llvm/test/Transforms/Attributor/norecurse.ll @@ -272,7 +272,7 @@ define i1 @test_rec_neg(i1 %c) norecurse { ; CGSCC-NEXT: [[RC1:%.*]] = call noundef i1 @rec(i1 noundef true) ; CGSCC-NEXT: br i1 [[RC1]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: -; CGSCC-NEXT: [[RC2:%.*]] = call noundef i1 @rec(i1 [[C]]) +; CGSCC-NEXT: [[RC2:%.*]] = call noundef i1 @rec(i1 noundef [[C]]) ; CGSCC-NEXT: ret i1 [[RC2]] ; CGSCC: f: ; CGSCC-NEXT: ret i1 [[RC1]] @@ -288,7 +288,7 @@ f: define internal i1 @rec(i1 %c1) { ; CHECK-LABEL: define {{[^@]+}}@rec -; CHECK-SAME: (i1 [[C1:%.*]]) { +; CHECK-SAME: (i1 noundef [[C1:%.*]]) { ; CHECK-NEXT: br i1 [[C1]], label [[T:%.*]], label [[F:%.*]] ; CHECK: t: ; CHECK-NEXT: ret i1 true diff --git a/llvm/test/Transforms/Attributor/nounwind.ll b/llvm/test/Transforms/Attributor/nounwind.ll index b47fff2..c85ad45 100644 --- a/llvm/test/Transforms/Attributor/nounwind.ll +++ b/llvm/test/Transforms/Attributor/nounwind.ll @@ -67,7 +67,7 @@ define void @call_non_nounwind(){ define i32 @maybe_throw(i1 zeroext %0) { ; CHECK-LABEL: define {{[^@]+}}@maybe_throw -; CHECK-SAME: (i1 zeroext [[TMP0:%.*]]) { +; CHECK-SAME: (i1 noundef zeroext [[TMP0:%.*]]) { ; CHECK-NEXT: br i1 [[TMP0]], label [[TMP2:%.*]], label [[TMP3:%.*]] ; CHECK: 2: ; CHECK-NEXT: tail call void @__cxa_rethrow() diff --git a/llvm/test/Transforms/Attributor/potential.ll b/llvm/test/Transforms/Attributor/potential.ll index 977eb29..560e71d 100644 --- a/llvm/test/Transforms/Attributor/potential.ll +++ b/llvm/test/Transforms/Attributor/potential.ll @@ -407,7 +407,7 @@ end: define internal i32 @may_return_undef(i32 %c) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@may_return_undef -; CHECK-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (i32 noundef [[C:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ ; CHECK-NEXT: i32 1, label [[A:%.*]] ; CHECK-NEXT: i32 -1, label [[B:%.*]] @@ -439,8 +439,8 @@ define i1 @potential_test10(i32 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@potential_test10 -; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; CGSCC-NEXT: [[RET:%.*]] = call i32 @may_return_undef(i32 [[C]]) #[[ATTR2]] +; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[RET:%.*]] = call i32 @may_return_undef(i32 noundef [[C]]) #[[ATTR2]] ; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32 [[RET]], 0 ; CGSCC-NEXT: ret i1 [[CMP]] ; @@ -452,7 +452,7 @@ define i1 @potential_test10(i32 %c) { define i32 @optimize_undef_1(i1 %c) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@optimize_undef_1 -; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (i1 noundef [[C:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CHECK: t: ; CHECK-NEXT: ret i32 0 @@ -471,7 +471,7 @@ f: define i32 @optimize_undef_2(i1 %c) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@optimize_undef_2 -; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (i1 noundef [[C:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CHECK: t: ; CHECK-NEXT: ret i32 0 @@ -490,7 +490,7 @@ f: define i32 @optimize_undef_3(i1 %c) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@optimize_undef_3 -; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (i1 noundef [[C:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CHECK: t: ; CHECK-NEXT: ret i32 0 @@ -523,10 +523,10 @@ define i32 @potential_test11(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@potential_test11 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; CGSCC-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) #[[ATTR2]] -; CGSCC-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) #[[ATTR2]] -; CGSCC-NEXT: [[ZERO3:%.*]] = call i32 @optimize_undef_3(i1 [[C]]) #[[ATTR2]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 noundef [[C]]) #[[ATTR2]] +; CGSCC-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 noundef [[C]]) #[[ATTR2]] +; CGSCC-NEXT: [[ZERO3:%.*]] = call i32 @optimize_undef_3(i1 noundef [[C]]) #[[ATTR2]] ; CGSCC-NEXT: [[ACC1:%.*]] = add i32 [[ZERO1]], [[ZERO2]] ; CGSCC-NEXT: [[ACC2:%.*]] = add i32 [[ACC1]], [[ZERO3]] ; CGSCC-NEXT: ret i32 [[ACC2]] @@ -542,7 +542,7 @@ define i32 @potential_test11(i1 %c) { define i32 @optimize_poison_1(i1 %c) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@optimize_poison_1 -; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (i1 noundef [[C:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CHECK: t: ; CHECK-NEXT: ret i32 0 @@ -567,8 +567,8 @@ define i32 @potential_test12(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@potential_test12 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; CGSCC-NEXT: [[ZERO:%.*]] = call i32 @optimize_poison_1(i1 [[C]]) #[[ATTR2]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[ZERO:%.*]] = call i32 @optimize_poison_1(i1 noundef [[C]]) #[[ATTR2]] ; CGSCC-NEXT: ret i32 [[ZERO]] ; %zero = call i32 @optimize_poison_1(i1 %c) diff --git a/llvm/test/Transforms/Attributor/range.ll b/llvm/test/Transforms/Attributor/range.ll index 7368db4..ffd8d35 100644 --- a/llvm/test/Transforms/Attributor/range.ll +++ b/llvm/test/Transforms/Attributor/range.ll @@ -1426,7 +1426,7 @@ define i1 @check_casted_range(i1 %c) { define internal i32 @less_than_100_1(i32 %c) { ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@less_than_100_1 -; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR2]] { ; CGSCC-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ ; CGSCC-NEXT: i32 0, label [[ONZERO:%.*]] ; CGSCC-NEXT: i32 1, label [[ONONE:%.*]] @@ -1497,8 +1497,8 @@ define i1 @propagate_range1(i32 %c){ ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@propagate_range1 -; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR3]] { -; CGSCC-NEXT: [[CSRET:%.*]] = call i32 @less_than_100_1(i32 [[C]]) #[[ATTR5]] +; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR3]] { +; CGSCC-NEXT: [[CSRET:%.*]] = call i32 @less_than_100_1(i32 noundef [[C]]) #[[ATTR5]] ; CGSCC-NEXT: [[TRUE:%.*]] = call i1 @is_less_than_100_1(i32 noundef [[CSRET]]) #[[ATTR5]] ; CGSCC-NEXT: ret i1 [[TRUE]] ; @@ -1511,7 +1511,7 @@ define internal i32 @less_than_100_2(i32 %c) { ; ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@less_than_100_2 -; TUNIT-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i32 noundef [[C:%.*]]) #[[ATTR1]] { ; TUNIT-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ ; TUNIT-NEXT: i32 0, label [[ONZERO:%.*]] ; TUNIT-NEXT: i32 1, label [[ONONE:%.*]] @@ -1540,7 +1540,7 @@ define internal i32 @less_than_100_2(i32 %c) { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@less_than_100_2 -; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR2]] { ; CGSCC-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ ; CGSCC-NEXT: i32 0, label [[ONZERO:%.*]] ; CGSCC-NEXT: i32 1, label [[ONONE:%.*]] @@ -1623,10 +1623,10 @@ define i1 @propagate_range2(i32 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@propagate_range2 -; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[CSRET1:%.*]] = call i32 @less_than_100_2(i32 noundef 0) #[[ATTR5]] ; CGSCC-NEXT: [[TRUE1:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET1]]) #[[ATTR5]] -; CGSCC-NEXT: [[CSRET2:%.*]] = call i32 @less_than_100_2(i32 [[C]]) #[[ATTR5]] +; CGSCC-NEXT: [[CSRET2:%.*]] = call i32 @less_than_100_2(i32 noundef [[C]]) #[[ATTR5]] ; CGSCC-NEXT: [[TRUE2:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET2]]) #[[ATTR5]] ; CGSCC-NEXT: [[TRUE:%.*]] = and i1 [[TRUE1]], [[TRUE2]] ; CGSCC-NEXT: ret i1 [[TRUE]] diff --git a/llvm/test/Transforms/Attributor/reduced/crash_ptr2int_cgscc.ll b/llvm/test/Transforms/Attributor/reduced/crash_ptr2int_cgscc.ll index 4b25763..ce8bc1e 100644 --- a/llvm/test/Transforms/Attributor/reduced/crash_ptr2int_cgscc.ll +++ b/llvm/test/Transforms/Attributor/reduced/crash_ptr2int_cgscc.ll @@ -5,7 +5,7 @@ define void @_ZN6openmc13FilterBinIterC1ERKNS_5TallyERNS_8ParticleE(i1 %c1, i1 %c2) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind ; CHECK-LABEL: define {{[^@]+}}@_ZN6openmc13FilterBinIterC1ERKNS_5TallyERNS_8ParticleE -; CHECK-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-SAME: (i1 noundef [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[D_I_I_I_I:%.*]] = alloca [3 x double], align 8 ; CHECK-NEXT: br i1 [[C1]], label [[FOR_BODY_LR_PH_I:%.*]], label [[_ZN6OPENMC13FILTERBINITERC2ERKNS_5TALLYERNS_8PARTICLEE_INTERNALIZED_EXIT:%.*]] diff --git a/llvm/test/Transforms/Attributor/returned.ll b/llvm/test/Transforms/Attributor/returned.ll index ac6509a..8df977c 100644 --- a/llvm/test/Transforms/Attributor/returned.ll +++ b/llvm/test/Transforms/Attributor/returned.ll @@ -1282,7 +1282,7 @@ declare void @noreturn() noreturn; define i32 @deadblockphi3(i32 %A, i1 %c) #0 { ; TUNIT: Function Attrs: noinline nounwind uwtable ; TUNIT-LABEL: define {{[^@]+}}@deadblockphi3 -; TUNIT-SAME: (i32 returned [[A:%.*]], i1 [[C:%.*]]) #[[ATTR5]] { +; TUNIT-SAME: (i32 returned [[A:%.*]], i1 noundef [[C:%.*]]) #[[ATTR5]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] ; TUNIT: unreachablecall: @@ -1297,7 +1297,7 @@ define i32 @deadblockphi3(i32 %A, i1 %c) #0 { ; ; CGSCC: Function Attrs: noinline nounwind uwtable ; CGSCC-LABEL: define {{[^@]+}}@deadblockphi3 -; CGSCC-SAME: (i32 returned [[A:%.*]], i1 [[C:%.*]]) #[[ATTR4]] { +; CGSCC-SAME: (i32 returned [[A:%.*]], i1 noundef [[C:%.*]]) #[[ATTR4]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] ; CGSCC: unreachablecall: diff --git a/llvm/test/Transforms/Attributor/undefined_behavior.ll b/llvm/test/Transforms/Attributor/undefined_behavior.ll index 4d55960..c2ba9ca 100644 --- a/llvm/test/Transforms/Attributor/undefined_behavior.ll +++ b/llvm/test/Transforms/Attributor/undefined_behavior.ll @@ -35,7 +35,7 @@ define void @loads_wholly_unreachable() { define void @load_single_bb_unreachable(i1 %cond) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@load_single_bb_unreachable -; CHECK-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (i1 noundef [[COND:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] ; CHECK: t: ; CHECK-NEXT: unreachable @@ -119,7 +119,7 @@ define void @store_wholly_unreachable_volatile() { define void @store_single_bb_unreachable(i1 %cond) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@store_single_bb_unreachable -; CHECK-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (i1 noundef [[COND:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] ; CHECK: t: ; CHECK-NEXT: unreachable @@ -191,7 +191,7 @@ define void @atomicrmw_wholly_unreachable() { define void @atomicrmw_single_bb_unreachable(i1 %cond) { ; TUNIT: Function Attrs: nofree norecurse nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@atomicrmw_single_bb_unreachable -; TUNIT-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { +; TUNIT-SAME: (i1 noundef [[COND:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] ; TUNIT: t: ; TUNIT-NEXT: unreachable @@ -200,7 +200,7 @@ define void @atomicrmw_single_bb_unreachable(i1 %cond) { ; ; CGSCC: Function Attrs: nofree norecurse nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@atomicrmw_single_bb_unreachable -; CGSCC-SAME: (i1 [[COND:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] ; CGSCC: t: ; CGSCC-NEXT: unreachable @@ -273,7 +273,7 @@ define void @atomiccmpxchg_wholly_unreachable() { define void @atomiccmpxchg_single_bb_unreachable(i1 %cond) { ; TUNIT: Function Attrs: nofree norecurse nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@atomiccmpxchg_single_bb_unreachable -; TUNIT-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { +; TUNIT-SAME: (i1 noundef [[COND:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] ; TUNIT: t: ; TUNIT-NEXT: unreachable @@ -282,7 +282,7 @@ define void @atomiccmpxchg_single_bb_unreachable(i1 %cond) { ; ; CGSCC: Function Attrs: nofree norecurse nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@atomiccmpxchg_single_bb_unreachable -; CGSCC-SAME: (i1 [[COND:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] ; CGSCC: t: ; CGSCC-NEXT: unreachable @@ -371,7 +371,7 @@ e: define void @cond_br_on_undef2(i1 %cond) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@cond_br_on_undef2 -; CHECK-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (i1 noundef [[COND:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: br i1 [[COND]], label [[T1:%.*]], label [[E1:%.*]] ; CHECK: t1: ; CHECK-NEXT: unreachable @@ -758,7 +758,7 @@ define void @arg_nonnull_violation2_2(i1 %c) { define void @arg_nonnull_violation3_1(i1 %c) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@arg_nonnull_violation3_1 -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: [[PTR:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: @@ -772,7 +772,7 @@ define void @arg_nonnull_violation3_1(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@arg_nonnull_violation3_1 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR2]] { ; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: @@ -805,7 +805,7 @@ ret: define void @arg_nonnull_violation3_2(i1 %c) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@arg_nonnull_violation3_2 -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: [[PTR:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: @@ -819,7 +819,7 @@ define void @arg_nonnull_violation3_2(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@arg_nonnull_violation3_2 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR2]] { ; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: @@ -854,7 +854,7 @@ ret: define nonnull ptr @returned_nonnnull(i32 %c) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@returned_nonnnull -; CHECK-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (i32 noundef [[C:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ ; CHECK-NEXT: i32 0, label [[ONZERO:%.*]] ; CHECK-NEXT: i32 1, label [[ONONE:%.*]] @@ -881,7 +881,7 @@ ondefault: define noundef ptr @returned_noundef(i32 %c) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@returned_noundef -; CHECK-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (i32 noundef [[C:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ ; CHECK-NEXT: i32 0, label [[ONZERO:%.*]] ; CHECK-NEXT: i32 1, label [[ONONE:%.*]] @@ -908,7 +908,7 @@ ondefault: define nonnull noundef ptr @returned_nonnnull_noundef(i32 %c) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@returned_nonnnull_noundef -; CHECK-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (i32 noundef [[C:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ ; CHECK-NEXT: i32 0, label [[ONZERO:%.*]] ; CHECK-NEXT: i32 1, label [[ONONE:%.*]] @@ -1013,7 +1013,7 @@ define ptr @violate_noundef_pointer() { define internal noundef i32 @assumed_undef_is_ok(i1 %c, i32 %arg) { ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@assumed_undef_is_ok -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR2]] { ; CGSCC-NEXT: br i1 [[C]], label [[REC:%.*]], label [[RET:%.*]] ; CGSCC: rec: ; CGSCC-NEXT: br label [[RET]] @@ -1040,8 +1040,8 @@ define noundef i32 @assumed_undef_is_ok_caller(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@assumed_undef_is_ok_caller -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; CGSCC-NEXT: [[CALL:%.*]] = call i32 @assumed_undef_is_ok(i1 [[C]]) #[[ATTR10]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i32 @assumed_undef_is_ok(i1 noundef [[C]]) #[[ATTR10]] ; CGSCC-NEXT: ret i32 [[CALL]] ; %call = call i32 @assumed_undef_is_ok(i1 %c, i32 undef) diff --git a/llvm/test/Transforms/Attributor/value-simplify-assume.ll b/llvm/test/Transforms/Attributor/value-simplify-assume.ll index af5343b..6ff7fd2 100644 --- a/llvm/test/Transforms/Attributor/value-simplify-assume.ll +++ b/llvm/test/Transforms/Attributor/value-simplify-assume.ll @@ -274,7 +274,7 @@ define i1 @keep_assume_4_nr(i1 %arg) norecurse { define i1 @assume_1_nr(i1 %arg, i1 %cond) norecurse { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@assume_1_nr -; TUNIT-SAME: (i1 returned [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (i1 returned [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR6]] @@ -288,7 +288,7 @@ define i1 @assume_1_nr(i1 %arg, i1 %cond) norecurse { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@assume_1_nr -; CGSCC-SAME: (i1 returned [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 returned [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR7]] @@ -318,7 +318,7 @@ m: define void @assume_1b_nr(i1 %arg, i1 %cond) norecurse { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@assume_1b_nr -; CHECK-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3:[0-9]+]] { +; CHECK-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3:[0-9]+]] { ; CHECK-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] ; CHECK: t: ; CHECK-NEXT: br label [[M:%.*]] @@ -345,7 +345,7 @@ m: define i1 @assume_2_nr(i1 %arg, i1 %cond) norecurse { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@assume_2_nr -; TUNIT-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; TUNIT-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] @@ -362,7 +362,7 @@ define i1 @assume_2_nr(i1 %arg, i1 %cond) norecurse { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@assume_2_nr -; CGSCC-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] @@ -395,7 +395,7 @@ m: define void @assume_2b_nr(i1 %arg, i1 %cond) norecurse { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@assume_2b_nr -; CHECK-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; CHECK-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; CHECK-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] ; CHECK: t: ; CHECK-NEXT: br label [[M:%.*]] @@ -422,7 +422,7 @@ m: define i1 @assume_3_nr(i1 %arg, i1 %cond) norecurse { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@assume_3_nr -; TUNIT-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 @@ -440,7 +440,7 @@ define i1 @assume_3_nr(i1 %arg, i1 %cond) norecurse { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@assume_3_nr -; CGSCC-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 @@ -475,7 +475,7 @@ m: define i1 @assume_4_nr(i1 %arg, i1 %cond) norecurse { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@assume_4_nr -; TUNIT-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; TUNIT-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] @@ -493,7 +493,7 @@ define i1 @assume_4_nr(i1 %arg, i1 %cond) norecurse { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@assume_4_nr -; CGSCC-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] @@ -528,7 +528,7 @@ m: define i1 @assume_5_nr(i1 %arg, i1 %cond) norecurse { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@assume_5_nr -; TUNIT-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L1:%.*]] = load i1, ptr [[STACK]], align 1 @@ -552,7 +552,7 @@ define i1 @assume_5_nr(i1 %arg, i1 %cond) norecurse { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@assume_5_nr -; CGSCC-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L1:%.*]] = load i1, ptr [[STACK]], align 1 @@ -599,7 +599,7 @@ m: define i1 @assume_5c_nr(i1 %cond) norecurse { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@assume_5c_nr -; TUNIT-SAME: (i1 [[COND:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 true, ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L1:%.*]] = load i1, ptr [[STACK]], align 1 @@ -623,7 +623,7 @@ define i1 @assume_5c_nr(i1 %cond) norecurse { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@assume_5c_nr -; CGSCC-SAME: (i1 [[COND:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 true, ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L1:%.*]] = load i1, ptr [[STACK]], align 1 @@ -900,7 +900,7 @@ define i1 @keep_assume_4(i1 %arg) { define i1 @assume_1(i1 %arg, i1 %cond) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@assume_1 -; TUNIT-SAME: (i1 returned [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (i1 returned [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR6]] @@ -914,7 +914,7 @@ define i1 @assume_1(i1 %arg, i1 %cond) { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@assume_1 -; CGSCC-SAME: (i1 returned [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 returned [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR7]] @@ -944,7 +944,7 @@ m: define void @assume_1b(i1 %arg, i1 %cond) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@assume_1b -; CHECK-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; CHECK-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; CHECK-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] ; CHECK: t: ; CHECK-NEXT: br label [[M:%.*]] @@ -971,7 +971,7 @@ m: define i1 @assume_2(i1 %arg, i1 %cond) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@assume_2 -; TUNIT-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; TUNIT-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] @@ -988,7 +988,7 @@ define i1 @assume_2(i1 %arg, i1 %cond) { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@assume_2 -; CGSCC-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] @@ -1021,7 +1021,7 @@ m: define void @assume_2b(i1 %arg, i1 %cond) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@assume_2b -; CHECK-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; CHECK-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; CHECK-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] ; CHECK: t: ; CHECK-NEXT: br label [[M:%.*]] @@ -1048,7 +1048,7 @@ m: define i1 @assume_3(i1 %arg, i1 %cond) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@assume_3 -; TUNIT-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 @@ -1066,7 +1066,7 @@ define i1 @assume_3(i1 %arg, i1 %cond) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@assume_3 -; CGSCC-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR4:[0-9]+]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 @@ -1101,7 +1101,7 @@ m: define i1 @assume_4(i1 %arg, i1 %cond) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@assume_4 -; TUNIT-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; TUNIT-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] @@ -1119,7 +1119,7 @@ define i1 @assume_4(i1 %arg, i1 %cond) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@assume_4 -; CGSCC-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR4]] { +; CGSCC-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR4]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] @@ -1154,7 +1154,7 @@ m: define i1 @assume_5(i1 %arg, i1 %cond) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@assume_5 -; TUNIT-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L1:%.*]] = load i1, ptr [[STACK]], align 1 @@ -1178,7 +1178,7 @@ define i1 @assume_5(i1 %arg, i1 %cond) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@assume_5 -; CGSCC-SAME: (i1 [[ARG:%.*]], i1 [[COND:%.*]]) #[[ATTR4]] { +; CGSCC-SAME: (i1 [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR4]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L1:%.*]] = load i1, ptr [[STACK]], align 1 @@ -1225,7 +1225,7 @@ m: define i1 @assume_5c(i1 %cond) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@assume_5c -; TUNIT-SAME: (i1 [[COND:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 true, ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L1:%.*]] = load i1, ptr [[STACK]], align 1 @@ -1249,7 +1249,7 @@ define i1 @assume_5c(i1 %cond) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@assume_5c -; CGSCC-SAME: (i1 [[COND:%.*]]) #[[ATTR4]] { +; CGSCC-SAME: (i1 noundef [[COND:%.*]]) #[[ATTR4]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 true, ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L1:%.*]] = load i1, ptr [[STACK]], align 1 diff --git a/llvm/test/Transforms/Attributor/value-simplify-instances.ll b/llvm/test/Transforms/Attributor/value-simplify-instances.ll index 3cc581e..335873c 100644 --- a/llvm/test/Transforms/Attributor/value-simplify-instances.ll +++ b/llvm/test/Transforms/Attributor/value-simplify-instances.ll @@ -105,7 +105,7 @@ define i1 @recursive_inst_compare_caller(i1 %c) { define internal i1 @recursive_alloca_compare(i1 %c, ptr %p) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(none) ; TUNIT-LABEL: define {{[^@]+}}@recursive_alloca_compare -; TUNIT-SAME: (i1 [[C:%.*]], ptr noalias nofree nonnull readnone [[P:%.*]]) #[[ATTR1:[0-9]+]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr noalias nofree nonnull readnone [[P:%.*]]) #[[ATTR1:[0-9]+]] { ; TUNIT-NEXT: [[A:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: @@ -117,7 +117,7 @@ define internal i1 @recursive_alloca_compare(i1 %c, ptr %p) { ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_compare -; CGSCC-SAME: (i1 [[C:%.*]], ptr noalias nofree nonnull readnone [[P:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr noalias nofree nonnull readnone [[P:%.*]]) #[[ATTR1:[0-9]+]] { ; CGSCC-NEXT: [[A:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: @@ -147,8 +147,8 @@ define i1 @recursive_alloca_compare_caller(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 [[C]], ptr undef) #[[ATTR4:[0-9]+]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 noundef [[C]], ptr undef) #[[ATTR4:[0-9]+]] ; CGSCC-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_alloca_compare(i1 %c, ptr undef) @@ -159,7 +159,7 @@ define i1 @recursive_alloca_compare_caller(i1 %c) { define internal i8 @recursive_alloca_load_return(i1 %c, ptr %p, i8 %v) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@recursive_alloca_load_return -; TUNIT-SAME: (i1 [[C:%.*]], ptr nocapture nofree nonnull readonly [[P:%.*]], i8 noundef [[V:%.*]]) #[[ATTR3:[0-9]+]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree nonnull readonly [[P:%.*]], i8 noundef [[V:%.*]]) #[[ATTR3:[0-9]+]] { ; TUNIT-NEXT: [[A:%.*]] = alloca i8, align 1 ; TUNIT-NEXT: store i8 [[V]], ptr [[A]], align 1 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] @@ -173,7 +173,7 @@ define internal i8 @recursive_alloca_load_return(i1 %c, ptr %p, i8 %v) { ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_load_return -; CGSCC-SAME: (i1 [[C:%.*]], ptr nocapture nofree nonnull readonly [[P:%.*]], i8 noundef [[V:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree nonnull readonly [[P:%.*]], i8 noundef [[V:%.*]]) #[[ATTR2:[0-9]+]] { ; CGSCC-NEXT: [[A:%.*]] = alloca i8, align 1 ; CGSCC-NEXT: store i8 [[V]], ptr [[A]], align 1 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] @@ -206,8 +206,8 @@ define i8 @recursive_alloca_load_return_caller(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_load_return_caller -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; CGSCC-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 [[C]], ptr undef, i8 noundef 42) #[[ATTR4]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 noundef [[C]], ptr undef, i8 noundef 42) #[[ATTR4]] ; CGSCC-NEXT: ret i8 [[CALL]] ; %call = call i8 @recursive_alloca_load_return(i1 %c, ptr undef, i8 42) @@ -222,7 +222,7 @@ define i8 @recursive_alloca_load_return_caller(i1 %c) { define internal i1 @recursive_alloca_compare_global1(i1 %c) { ; TUNIT: Function Attrs: nofree nosync nounwind ; TUNIT-LABEL: define {{[^@]+}}@recursive_alloca_compare_global1 -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4]] { ; TUNIT-NEXT: [[A:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: @@ -236,7 +236,7 @@ define internal i1 @recursive_alloca_compare_global1(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind ; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_compare_global1 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[A:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: @@ -270,8 +270,8 @@ define i1 @recursive_alloca_compare_caller_global1(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind ; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global1 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 [[C]]) #[[ATTR4]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR3]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 noundef [[C]]) #[[ATTR4]] ; CGSCC-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_alloca_compare_global1(i1 %c) @@ -281,7 +281,7 @@ define i1 @recursive_alloca_compare_caller_global1(i1 %c) { define internal i1 @recursive_alloca_compare_global2(i1 %c) { ; TUNIT: Function Attrs: nofree nosync nounwind ; TUNIT-LABEL: define {{[^@]+}}@recursive_alloca_compare_global2 -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4]] { ; TUNIT-NEXT: [[A:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: [[P:%.*]] = load ptr, ptr @G2, align 8 ; TUNIT-NEXT: store ptr [[A]], ptr @G2, align 8 @@ -295,7 +295,7 @@ define internal i1 @recursive_alloca_compare_global2(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind ; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_compare_global2 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[A:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: [[P:%.*]] = load ptr, ptr @G2, align 8 ; CGSCC-NEXT: store ptr [[A]], ptr @G2, align 8 @@ -329,8 +329,8 @@ define i1 @recursive_alloca_compare_caller_global2(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind ; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global2 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 [[C]]) #[[ATTR4]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR3]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 noundef [[C]]) #[[ATTR4]] ; CGSCC-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_alloca_compare_global2(i1 %c) @@ -340,7 +340,7 @@ define internal i1 @recursive_inst_compare_global3(i1 %c) { ; ; TUNIT: Function Attrs: nofree nosync nounwind ; TUNIT-LABEL: define {{[^@]+}}@recursive_inst_compare_global3 -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4]] { ; TUNIT-NEXT: [[P:%.*]] = load i1, ptr @G3, align 1 ; TUNIT-NEXT: store i1 [[C]], ptr @G3, align 1 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] @@ -353,7 +353,7 @@ define internal i1 @recursive_inst_compare_global3(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind ; CGSCC-LABEL: define {{[^@]+}}@recursive_inst_compare_global3 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[P:%.*]] = load i1, ptr @G3, align 1 ; CGSCC-NEXT: store i1 [[C]], ptr @G3, align 1 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] @@ -385,8 +385,8 @@ define i1 @recursive_inst_compare_caller_global3(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind ; CGSCC-LABEL: define {{[^@]+}}@recursive_inst_compare_caller_global3 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 [[C]]) #[[ATTR4]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR3]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 noundef [[C]]) #[[ATTR4]] ; CGSCC-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_inst_compare_global3(i1 %c) diff --git a/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll b/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll index 6bf722e..76ebcc5 100644 --- a/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll +++ b/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll @@ -1620,7 +1620,7 @@ entry: define i8 @local_alloca_not_simplifiable_2(i64 %index1, i64 %index2, i1 %cnd) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_2 -; TUNIT-SAME: (i64 [[INDEX1:%.*]], i64 [[INDEX2:%.*]], i1 [[CND:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (i64 [[INDEX1:%.*]], i64 [[INDEX2:%.*]], i1 noundef [[CND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 ; TUNIT-NEXT: [[GEP0:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 @@ -1640,7 +1640,7 @@ define i8 @local_alloca_not_simplifiable_2(i64 %index1, i64 %index2, i1 %cnd) { ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_2 -; CGSCC-SAME: (i64 [[INDEX1:%.*]], i64 [[INDEX2:%.*]], i1 [[CND:%.*]]) #[[ATTR5]] { +; CGSCC-SAME: (i64 [[INDEX1:%.*]], i64 [[INDEX2:%.*]], i1 noundef [[CND:%.*]]) #[[ATTR5]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 ; CGSCC-NEXT: [[GEP0:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 @@ -3002,7 +3002,7 @@ for.body7: ; preds = %for.cond4 define internal i1 @alloca_non_unique(i32* %p, i32 %in, i1 %c) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@alloca_non_unique -; TUNIT-SAME: (i32* nocapture nofree nonnull readonly align 4 [[P:%.*]], i32 [[IN:%.*]], i1 [[C:%.*]]) #[[ATTR12:[0-9]+]] { +; TUNIT-SAME: (i32* nocapture nofree nonnull readonly align 4 [[P:%.*]], i32 [[IN:%.*]], i1 noundef [[C:%.*]]) #[[ATTR12:[0-9]+]] { ; TUNIT-NEXT: [[A:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: store i32 [[IN]], i32* [[A]], align 4 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] @@ -3016,7 +3016,7 @@ define internal i1 @alloca_non_unique(i32* %p, i32 %in, i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@alloca_non_unique -; CGSCC-SAME: (i32* nocapture nofree nonnull readonly align 4 [[P:%.*]], i32 [[IN:%.*]], i1 [[C:%.*]]) #[[ATTR14:[0-9]+]] { +; CGSCC-SAME: (i32* nocapture nofree nonnull readonly align 4 [[P:%.*]], i32 [[IN:%.*]], i1 noundef [[C:%.*]]) #[[ATTR14:[0-9]+]] { ; CGSCC-NEXT: [[A:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: store i32 [[IN]], i32* [[A]], align 4 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] @@ -3050,8 +3050,8 @@ define i1 @alloca_non_unique_caller(i32 %in, i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@alloca_non_unique_caller -; CGSCC-SAME: (i32 [[IN:%.*]], i1 [[C:%.*]]) #[[ATTR15:[0-9]+]] { -; CGSCC-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(i32* undef, i32 [[IN]], i1 [[C]]) #[[ATTR23]] +; CGSCC-SAME: (i32 [[IN:%.*]], i1 noundef [[C:%.*]]) #[[ATTR15:[0-9]+]] { +; CGSCC-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(i32* undef, i32 [[IN]], i1 noundef [[C]]) #[[ATTR23]] ; CGSCC-NEXT: ret i1 [[R]] ; %r = call i1 @alloca_non_unique(i32* undef, i32 %in, i1 %c) @@ -3160,7 +3160,7 @@ entry: define i32 @a(i1 %c) { ; TUNIT: Function Attrs: nofree nosync nounwind ; TUNIT-LABEL: define {{[^@]+}}@a -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR14]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR14]] { ; TUNIT-NEXT: store i32 3, i32* @G, align 4 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: @@ -3173,7 +3173,7 @@ define i32 @a(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind ; CGSCC-LABEL: define {{[^@]+}}@a -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR17]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR17]] { ; CGSCC-NEXT: store i32 3, i32* @G, align 4 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: diff --git a/llvm/test/Transforms/Attributor/value-simplify-reachability.ll b/llvm/test/Transforms/Attributor/value-simplify-reachability.ll index b505ac0..5cd3ac5 100644 --- a/llvm/test/Transforms/Attributor/value-simplify-reachability.ll +++ b/llvm/test/Transforms/Attributor/value-simplify-reachability.ll @@ -707,7 +707,7 @@ declare void @usei32(i32) nocallback nosync define internal void @exclusion_set3_helper(i1 %c, ptr %p) { ; TUNIT: Function Attrs: nosync ; TUNIT-LABEL: define {{[^@]+}}@exclusion_set3_helper -; TUNIT-SAME: (i1 [[C:%.*]], ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] { ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: ; TUNIT-NEXT: store i32 42, ptr [[P]], align 4 @@ -733,7 +733,7 @@ define internal void @exclusion_set3_helper(i1 %c, ptr %p) { ; ; CGSCC: Function Attrs: nosync ; CGSCC-LABEL: define {{[^@]+}}@exclusion_set3_helper -; CGSCC-SAME: (i1 [[C:%.*]], ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR5]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR5]] { ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: ; CGSCC-NEXT: store i32 42, ptr [[P]], align 4 @@ -793,10 +793,10 @@ define i32 @exclusion_set3(i1 %c) { ; ; CGSCC: Function Attrs: nosync ; CGSCC-LABEL: define {{[^@]+}}@exclusion_set3 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR5]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR5]] { ; CGSCC-NEXT: [[A:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: store i32 3, ptr [[A]], align 4 -; CGSCC-NEXT: call void @exclusion_set3_helper(i1 [[C]], ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A]]) +; CGSCC-NEXT: call void @exclusion_set3_helper(i1 noundef [[C]], ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A]]) ; CGSCC-NEXT: [[FINAL:%.*]] = load i32, ptr [[A]], align 4 ; CGSCC-NEXT: ret i32 [[FINAL]] ; diff --git a/llvm/test/Transforms/Attributor/value-simplify.ll b/llvm/test/Transforms/Attributor/value-simplify.ll index 718f522..8461b5c 100644 --- a/llvm/test/Transforms/Attributor/value-simplify.ll +++ b/llvm/test/Transforms/Attributor/value-simplify.ll @@ -72,7 +72,7 @@ define i32 @return1() { define i32 @test2_1(i1 %c) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@test2_1 -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1]] { ; TUNIT-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] ; TUNIT: if.true: ; TUNIT-NEXT: [[RET0:%.*]] = add i32 0, 1 @@ -85,7 +85,7 @@ define i32 @test2_1(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@test2_1 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR2:[0-9]+]] { ; CGSCC-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] ; CGSCC: if.true: ; CGSCC-NEXT: [[CALL:%.*]] = tail call i32 @return0() #[[ATTR12:[0-9]+]] @@ -123,8 +123,8 @@ define i32 @test2_2(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@test2_2 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; CGSCC-NEXT: [[RET:%.*]] = tail call noundef i32 @test2_1(i1 [[C]]) #[[ATTR12]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: [[RET:%.*]] = tail call noundef i32 @test2_1(i1 noundef [[C]]) #[[ATTR12]] ; CGSCC-NEXT: ret i32 [[RET]] ; %ret = tail call i32 @test2_1(i1 %c) @@ -134,7 +134,7 @@ define i32 @test2_2(i1 %c) { declare void @use(i32) define void @test3(i1 %c) { ; TUNIT-LABEL: define {{[^@]+}}@test3 -; TUNIT-SAME: (i1 [[C:%.*]]) { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) { ; TUNIT-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] ; TUNIT: if.true: ; TUNIT-NEXT: br label [[END:%.*]] @@ -146,7 +146,7 @@ define void @test3(i1 %c) { ; TUNIT-NEXT: ret void ; ; CGSCC-LABEL: define {{[^@]+}}@test3 -; CGSCC-SAME: (i1 [[C:%.*]]) { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) { ; CGSCC-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] ; CGSCC: if.true: ; CGSCC-NEXT: br label [[END:%.*]] @@ -352,7 +352,7 @@ define i32 @ipccp3() { define internal i32 @ipccp4ia(i1 %c) { ; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@ipccp4ia -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1]] { ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: ; CGSCC-NEXT: ret i32 0 @@ -388,7 +388,7 @@ f: define i32 @ipccp4(i1 %c) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@ipccp4 -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1]] { ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: ; TUNIT-NEXT: br label [[F]] @@ -397,7 +397,7 @@ define i32 @ipccp4(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@ipccp4 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR2]] { ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: ; CGSCC-NEXT: br label [[F]] @@ -586,15 +586,10 @@ define internal ptr @test_byval2(ptr byval(%struct.X) %a) { } define ptr @complicated_args_byval2() { ; -; TUNIT-LABEL: define {{[^@]+}}@complicated_args_byval2() { -; TUNIT-NEXT: [[TMP1:%.*]] = load ptr, ptr @S, align 8 -; TUNIT-NEXT: [[C:%.*]] = call ptr @test_byval2(ptr [[TMP1]]) -; TUNIT-NEXT: ret ptr [[C]] -; -; CGSCC-LABEL: define {{[^@]+}}@complicated_args_byval2() { -; CGSCC-NEXT: [[TMP1:%.*]] = load ptr, ptr @S, align 8 -; CGSCC-NEXT: [[C:%.*]] = call ptr @test_byval2(ptr [[TMP1]]) -; CGSCC-NEXT: ret ptr [[C]] +; CHECK-LABEL: define {{[^@]+}}@complicated_args_byval2() { +; CHECK-NEXT: [[TMP1:%.*]] = load ptr, ptr @S, align 8 +; CHECK-NEXT: [[C:%.*]] = call ptr @test_byval2(ptr [[TMP1]]) +; CHECK-NEXT: ret ptr [[C]] ; %c = call ptr @test_byval2(ptr byval(%struct.X) @S) ret ptr %c @@ -1061,12 +1056,19 @@ define internal i1 @cmp_null_after_cast(i32 %a, i8 %b) { declare ptr @m() define i32 @test(i1 %c) { -; CHECK-LABEL: define {{[^@]+}}@test -; CHECK-SAME: (i1 [[C:%.*]]) { -; CHECK-NEXT: [[R1:%.*]] = call i32 @ctx_test1(i1 [[C]]) -; CHECK-NEXT: [[R2:%.*]] = call i32 @ctx_test2(i1 [[C]]) -; CHECK-NEXT: [[ADD:%.*]] = add i32 [[R1]], [[R2]] -; CHECK-NEXT: ret i32 [[ADD]] +; TUNIT-LABEL: define {{[^@]+}}@test +; TUNIT-SAME: (i1 [[C:%.*]]) { +; TUNIT-NEXT: [[R1:%.*]] = call i32 @ctx_test1(i1 [[C]]) +; TUNIT-NEXT: [[R2:%.*]] = call i32 @ctx_test2(i1 [[C]]) +; TUNIT-NEXT: [[ADD:%.*]] = add i32 [[R1]], [[R2]] +; TUNIT-NEXT: ret i32 [[ADD]] +; +; CGSCC-LABEL: define {{[^@]+}}@test +; CGSCC-SAME: (i1 noundef [[C:%.*]]) { +; CGSCC-NEXT: [[R1:%.*]] = call i32 @ctx_test1(i1 noundef [[C]]) +; CGSCC-NEXT: [[R2:%.*]] = call i32 @ctx_test2(i1 noundef [[C]]) +; CGSCC-NEXT: [[ADD:%.*]] = add i32 [[R1]], [[R2]] +; CGSCC-NEXT: ret i32 [[ADD]] ; %r1 = call i32 @ctx_test1(i1 %c) %r2 = call i32 @ctx_test2(i1 %c) @@ -1076,7 +1078,7 @@ define i32 @test(i1 %c) { define internal i32 @ctx_test1(i1 %c) { ; CHECK-LABEL: define {{[^@]+}}@ctx_test1 -; CHECK-SAME: (i1 [[C:%.*]]) { +; CHECK-SAME: (i1 noundef [[C:%.*]]) { ; CHECK-NEXT: entry: ; CHECK-NEXT: br i1 [[C]], label [[THEN:%.*]], label [[JOIN:%.*]] ; CHECK: then: @@ -1104,7 +1106,7 @@ join: define internal i32 @ctx_test2(i1 %c) { ; CHECK-LABEL: define {{[^@]+}}@ctx_test2 -; CHECK-SAME: (i1 [[C:%.*]]) { +; CHECK-SAME: (i1 noundef [[C:%.*]]) { ; CHECK-NEXT: entry: ; CHECK-NEXT: br i1 [[C]], label [[THEN:%.*]], label [[JOIN:%.*]] ; CHECK: then: @@ -1135,7 +1137,7 @@ join: define i1 @test_liveness(i1 %c) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@test_liveness -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: @@ -1147,7 +1149,7 @@ define i1 @test_liveness(i1 %c) { ; ; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@test_liveness -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR2]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: diff --git a/llvm/test/Transforms/Attributor/willreturn.ll b/llvm/test/Transforms/Attributor/willreturn.ll index 76675f9..229cc8f 100644 --- a/llvm/test/Transforms/Attributor/willreturn.ll +++ b/llvm/test/Transforms/Attributor/willreturn.ll @@ -178,7 +178,7 @@ declare void @sink() nounwind willreturn nosync nofree define void @mutual_recursion1(i1 %c) #0 { ; TUNIT: Function Attrs: nofree noinline nosync nounwind uwtable ; TUNIT-LABEL: define {{[^@]+}}@mutual_recursion1 -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR4:[0-9]+]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4:[0-9]+]] { ; TUNIT-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] ; TUNIT: rec: ; TUNIT-NEXT: call void @sink() #[[ATTR12:[0-9]+]] @@ -189,7 +189,7 @@ define void @mutual_recursion1(i1 %c) #0 { ; ; CGSCC: Function Attrs: nofree noinline nosync nounwind uwtable ; CGSCC-LABEL: define {{[^@]+}}@mutual_recursion1 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4:[0-9]+]] { ; CGSCC-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] ; CGSCC: rec: ; CGSCC-NEXT: call void @sink() #[[ATTR12:[0-9]+]] diff --git a/llvm/test/Transforms/InstCombine/dont-distribute-phi.ll b/llvm/test/Transforms/InstCombine/dont-distribute-phi.ll index 3cd6193..45e47d8 100644 --- a/llvm/test/Transforms/InstCombine/dont-distribute-phi.ll +++ b/llvm/test/Transforms/InstCombine/dont-distribute-phi.ll @@ -43,8 +43,8 @@ bb_exit: define zeroext i1 @foo_logical(i32 %arg) { ; CHECK-LABEL: @foo_logical( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[CMP1_NOT:%.*]] = icmp eq i32 [[ARG:%.*]], 37 -; CHECK-NEXT: br i1 [[CMP1_NOT]], label [[BB_THEN:%.*]], label [[BB_ELSE:%.*]] +; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i32 [[ARG:%.*]], 37 +; CHECK-NEXT: br i1 [[CMP1]], label [[BB_ELSE:%.*]], label [[BB_THEN:%.*]] ; CHECK: bb_then: ; CHECK-NEXT: call void @bar() ; CHECK-NEXT: br label [[BB_EXIT:%.*]] @@ -52,8 +52,9 @@ define zeroext i1 @foo_logical(i32 %arg) { ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 [[ARG]], 17 ; CHECK-NEXT: br label [[BB_EXIT]] ; CHECK: bb_exit: -; CHECK-NEXT: [[PHI1:%.*]] = phi i1 [ [[CMP2]], [[BB_ELSE]] ], [ false, [[BB_THEN]] ] -; CHECK-NEXT: ret i1 [[PHI1]] +; CHECK-NEXT: [[PHI1:%.*]] = phi i1 [ [[CMP2]], [[BB_ELSE]] ], [ undef, [[BB_THEN]] ] +; CHECK-NEXT: [[AND1:%.*]] = and i1 [[PHI1]], [[CMP1]] +; CHECK-NEXT: ret i1 [[AND1]] ; entry: -- 2.7.4