diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp --- a/llvm/lib/Transforms/IPO/Attributor.cpp +++ b/llvm/lib/Transforms/IPO/Attributor.cpp @@ -802,19 +802,6 @@ if (V.use_empty()) return true; - // If the value is replaced by another one, for now a constant, we do not have - // uses. Note that this requires users of `checkForAllUses` to not recurse but - // instead use the `follow` callback argument to look at transitive users, - // however, that should be clear from the presence of the argument. - bool UsedAssumedInformation = false; - Optional C = - getAssumedConstant(V, QueryingAA, UsedAssumedInformation); - if (C.hasValue() && C.getValue()) { - LLVM_DEBUG(dbgs() << "[Attributor] Value is simplified, uses skipped: " << V - << " -> " << *C.getValue() << "\n"); - return true; - } - const IRPosition &IRP = QueryingAA.getIRPosition(); SmallVector Worklist; SmallPtrSet Visited; diff --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp --- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp +++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp @@ -2800,6 +2800,15 @@ /// Check if all uses are assumed dead. bool areAllUsesAssumedDead(Attributor &A, Value &V) { + // If we replace a value with a constant there are no uses left afterwards. + if (!isa(V)) { + bool UsedAssumedInformation = false; + Optional C = + A.getAssumedConstant(V, *this, UsedAssumedInformation); + if (!C.hasValue() || *C) + return true; + } + auto UsePred = [&](const Use &U, bool &Follow) { return false; }; // Explicitly set the dependence class to required because we want a long // chain of N dependent instructions to be considered live as soon as one is @@ -2857,7 +2866,6 @@ Instruction *I = dyn_cast(&getAssociatedValue()); if (!isAssumedSideEffectFree(A, I)) return indicatePessimisticFixpoint(); - if (!areAllUsesAssumedDead(A, getAssociatedValue())) return indicatePessimisticFixpoint(); return ChangeStatus::UNCHANGED; @@ -2995,7 +3003,6 @@ IsAssumedSideEffectFree = false; Changed = ChangeStatus::CHANGED; } - if (!areAllUsesAssumedDead(A, getAssociatedValue())) return indicatePessimisticFixpoint(); return Changed; diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM +; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=13 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM +; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=13 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll @@ -11,7 +11,7 @@ ; ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@f -; IS__TUNIT_OPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull byval([[STRUCT_SS:%.*]]) align 8 dereferenceable(12) [[B:%.*]], i32* noalias nocapture nofree noundef nonnull byval(i32) align 4 dereferenceable(4) [[X:%.*]], i32 noundef [[I:%.*]]) #[[ATTR0:[0-9]+]] { +; IS__TUNIT_OPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull byval([[STRUCT_SS:%.*]]) align 8 dereferenceable(12) [[B:%.*]], i32* noalias nocapture nofree noundef nonnull byval(i32) align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B]], i32 0, i32 0 ; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 @@ -24,7 +24,7 @@ ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]], i32 noundef [[I:%.*]]) #[[ATTR0:[0-9]+]] { +; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 ; IS__TUNIT_NPM-NEXT: store i32 [[TMP2]], i32* [[X_PRIV]], align 4 @@ -100,7 +100,7 @@ ; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[TMP1]], align 8 ; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 ; IS__TUNIT_OPM-NEXT: store i64 2, i64* [[TMP4]], align 4 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_SS]]) align 8 dereferenceable(12) [[S]], i32* nocapture nofree readonly byval(i32) align 4 [[X]], i32 noundef zeroext 0) #[[ATTR0]] +; IS__TUNIT_OPM-NEXT: [[C:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_SS]]) align 8 dereferenceable(12) [[S]], i32* nocapture nofree readonly byval(i32) align 4 [[X]]) #[[ATTR0]] ; IS__TUNIT_OPM-NEXT: ret i32 [[C]] ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn @@ -117,7 +117,7 @@ ; IS__TUNIT_NPM-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 ; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_1]], align 8 ; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[X]], align 4 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]], i32 [[TMP2]], i32 noundef zeroext 0) #[[ATTR0]] +; IS__TUNIT_NPM-NEXT: [[C:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]], i32 [[TMP2]]) #[[ATTR0]] ; IS__TUNIT_NPM-NEXT: ret i32 [[C]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow2.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow2.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow2.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow2.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM +; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=10 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM +; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=10 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM @@ -9,7 +9,7 @@ define internal i32 @callee(i1 %C, i32* %P) { ; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callee -; IS__TUNIT_OPM-SAME: (i1 noundef [[C:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; IS__TUNIT_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: br label [[F:%.*]] ; IS__TUNIT_OPM: T: ; IS__TUNIT_OPM-NEXT: unreachable @@ -19,7 +19,7 @@ ; ; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee -; IS__TUNIT_NPM-SAME: (i1 noundef [[C:%.*]], i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: [[P_PRIV:%.*]] = alloca i32, align 4 ; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[P_PRIV]], align 4 ; IS__TUNIT_NPM-NEXT: br label [[F:%.*]] @@ -67,7 +67,7 @@ ; IS__TUNIT_OPM-SAME: () #[[ATTR1:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: [[A:%.*]] = alloca i32, align 4 ; IS__TUNIT_OPM-NEXT: store i32 17, i32* [[A]], align 4 -; IS__TUNIT_OPM-NEXT: [[X:%.*]] = call i32 @callee(i1 noundef false, i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]]) #[[ATTR2:[0-9]+]] +; IS__TUNIT_OPM-NEXT: [[X:%.*]] = call i32 @callee(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]]) #[[ATTR2:[0-9]+]] ; IS__TUNIT_OPM-NEXT: ret i32 [[X]] ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn @@ -76,7 +76,7 @@ ; IS__TUNIT_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 ; IS__TUNIT_NPM-NEXT: store i32 17, i32* [[A]], align 4 ; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[A]], align 4 -; IS__TUNIT_NPM-NEXT: [[X:%.*]] = call i32 @callee(i1 noundef false, i32 [[TMP1]]) #[[ATTR2:[0-9]+]] +; IS__TUNIT_NPM-NEXT: [[X:%.*]] = call i32 @callee(i32 [[TMP1]]) #[[ATTR2:[0-9]+]] ; IS__TUNIT_NPM-NEXT: ret i32 [[X]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll @@ -21,31 +21,18 @@ ; CHECK: @[[A:[a-zA-Z0-9_$"\\.-]+]] = internal global [[STRUCT_FOO:%.*]] { i32 1, i64 2 }, align 8 ;. define void @run() { -; IS________OPM: Function Attrs: nofree noreturn nosync nounwind readnone -; IS________OPM-LABEL: define {{[^@]+}}@run -; IS________OPM-SAME: () #[[ATTR0:[0-9]+]] { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[TMP0:%.*]] = call i64 @CaptureAStruct(%struct.Foo* nocapture nofree noundef nonnull readonly byval([[STRUCT_FOO:%.*]]) align 8 dereferenceable(16) @a) #[[ATTR0]] -; IS________OPM-NEXT: unreachable ; -; IS__TUNIT_NPM: Function Attrs: nofree noreturn nosync nounwind readnone -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@run -; IS__TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[A_CAST:%.*]] = bitcast %struct.Foo* @a to i32* -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_CAST]], align 8 -; IS__TUNIT_NPM-NEXT: [[A_0_1:%.*]] = getelementptr [[STRUCT_FOO:%.*]], %struct.Foo* @a, i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_0_1]], align 8 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = call i64 @CaptureAStruct(i32 [[TMP0]], i64 [[TMP1]]) #[[ATTR0]] -; IS__TUNIT_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@run +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = call i64 @CaptureAStruct() #[[ATTR0]] +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readonly willreturn +; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@run ; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* getelementptr inbounds ([[STRUCT_FOO:%.*]], %struct.Foo* @a, i32 0, i32 0), align 8 -; IS__CGSCC____-NEXT: [[A_0_1:%.*]] = getelementptr [[STRUCT_FOO]], %struct.Foo* @a, i32 0, i32 1 -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_0_1]], align 8 ; IS__CGSCC____-NEXT: unreachable ; entry: @@ -105,53 +92,28 @@ ; IS__CGSCC_OPM-NEXT: [[GEP]] = getelementptr [[STRUCT_FOO:%.*]], %struct.Foo* [[A]], i64 0 ; IS__CGSCC_OPM-NEXT: br label [[LOOP]] ; -; IS________OPM: Function Attrs: nofree noreturn nosync nounwind readnone -; IS________OPM-LABEL: define {{[^@]+}}@CaptureAStruct -; IS________OPM-SAME: (%struct.Foo* noalias nofree noundef nonnull byval([[STRUCT_FOO:%.*]]) align 8 dereferenceable(16) [[A:%.*]]) #[[ATTR0]] { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[A_PTR:%.*]] = alloca %struct.Foo*, align 8 -; IS________OPM-NEXT: br label [[LOOP:%.*]] -; IS________OPM: loop: -; IS________OPM-NEXT: [[PHI:%.*]] = phi %struct.Foo* [ null, [[ENTRY:%.*]] ], [ [[GEP:%.*]], [[LOOP]] ] -; IS________OPM-NEXT: [[TMP0:%.*]] = phi %struct.Foo* [ [[A]], [[ENTRY]] ], [ [[TMP0]], [[LOOP]] ] -; IS________OPM-NEXT: store %struct.Foo* [[PHI]], %struct.Foo** [[A_PTR]], align 8 -; IS________OPM-NEXT: [[GEP]] = getelementptr [[STRUCT_FOO]], %struct.Foo* [[A]], i64 0 -; IS________OPM-NEXT: br label [[LOOP]] -; -; IS__TUNIT_NPM: Function Attrs: nofree noreturn nosync nounwind readnone -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@CaptureAStruct -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_FOO:%.*]], align 8 -; IS__TUNIT_NPM-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.Foo* [[A_PRIV]] to i32* -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[A_PRIV_CAST]], align 4 -; IS__TUNIT_NPM-NEXT: [[A_PRIV_0_1:%.*]] = getelementptr [[STRUCT_FOO]], %struct.Foo* [[A_PRIV]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: store i64 [[TMP1]], i64* [[A_PRIV_0_1]], align 8 -; IS__TUNIT_NPM-NEXT: [[A_PTR:%.*]] = alloca %struct.Foo*, align 8 -; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_NPM: loop: -; IS__TUNIT_NPM-NEXT: [[PHI:%.*]] = phi %struct.Foo* [ null, [[ENTRY:%.*]] ], [ [[GEP:%.*]], [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = phi %struct.Foo* [ [[A_PRIV]], [[ENTRY]] ], [ [[TMP2]], [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: store %struct.Foo* [[PHI]], %struct.Foo** [[A_PTR]], align 8 -; IS__TUNIT_NPM-NEXT: [[GEP]] = getelementptr [[STRUCT_FOO]], %struct.Foo* [[A_PRIV]], i64 0 -; IS__TUNIT_NPM-NEXT: br label [[LOOP]] +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@CaptureAStruct +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[A_PTR:%.*]] = alloca %struct.Foo*, align 8 +; NOT_CGSCC_NPM-NEXT: br label [[LOOP:%.*]] +; NOT_CGSCC_NPM: loop: +; NOT_CGSCC_NPM-NEXT: [[PHI:%.*]] = phi %struct.Foo* [ null, [[ENTRY:%.*]] ], [ @a, [[LOOP]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = phi %struct.Foo* [ @a, [[ENTRY]] ], [ [[TMP0]], [[LOOP]] ] +; NOT_CGSCC_NPM-NEXT: store %struct.Foo* [[PHI]], %struct.Foo** [[A_PTR]], align 8 +; NOT_CGSCC_NPM-NEXT: br label [[LOOP]] ; ; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone ; IS__CGSCC____-LABEL: define {{[^@]+}}@CaptureAStruct -; IS__CGSCC____-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR2:[0-9]+]] { +; IS__CGSCC____-SAME: () #[[ATTR2:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_FOO:%.*]], align 8 -; IS__CGSCC____-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.Foo* [[A_PRIV]] to i32* -; IS__CGSCC____-NEXT: store i32 [[TMP0]], i32* [[A_PRIV_CAST]], align 8 -; IS__CGSCC____-NEXT: [[A_PRIV_0_1:%.*]] = getelementptr [[STRUCT_FOO]], %struct.Foo* [[A_PRIV]], i32 0, i32 1 -; IS__CGSCC____-NEXT: store i64 [[TMP1]], i64* [[A_PRIV_0_1]], align 8 ; IS__CGSCC____-NEXT: [[A_PTR:%.*]] = alloca %struct.Foo*, align 8 ; IS__CGSCC____-NEXT: br label [[LOOP:%.*]] ; IS__CGSCC____: loop: -; IS__CGSCC____-NEXT: [[PHI:%.*]] = phi %struct.Foo* [ null, [[ENTRY:%.*]] ], [ [[GEP:%.*]], [[LOOP]] ] -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = phi %struct.Foo* [ [[A_PRIV]], [[ENTRY]] ], [ [[TMP2]], [[LOOP]] ] +; IS__CGSCC____-NEXT: [[PHI:%.*]] = phi %struct.Foo* [ null, [[ENTRY:%.*]] ], [ @a, [[LOOP]] ] +; IS__CGSCC____-NEXT: [[TMP0:%.*]] = phi %struct.Foo* [ @a, [[ENTRY]] ], [ [[TMP0]], [[LOOP]] ] ; IS__CGSCC____-NEXT: store %struct.Foo* [[PHI]], %struct.Foo** [[A_PTR]], align 8 -; IS__CGSCC____-NEXT: [[GEP]] = getelementptr [[STRUCT_FOO]], %struct.Foo* [[A_PRIV]], i64 0 ; IS__CGSCC____-NEXT: br label [[LOOP]] ; entry: @@ -166,9 +128,9 @@ br label %loop } ;. -; NOT_CGSCC_NPM: attributes #[[ATTR0:[0-9]+]] = { nofree noreturn nosync nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } ; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC____: attributes #[[ATTR2]] = { nofree norecurse noreturn nosync nounwind readnone } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/reserve-tbaa.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/reserve-tbaa.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/reserve-tbaa.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/reserve-tbaa.ll @@ -26,7 +26,7 @@ define internal fastcc void @fn(i32* nocapture readonly %p1, i64* nocapture readonly %p2) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@fn -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P1:%.*]]) #[[ATTR0:[0-9]+]] { +; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* @g, align 4, !tbaa [[TBAA0:![0-9]+]] ; IS__TUNIT____-NEXT: [[CONV1:%.*]] = trunc i32 [[TMP0]] to i8 @@ -60,7 +60,7 @@ ; IS__TUNIT____-NEXT: store i32* @g, i32** [[TMP0]], align 8, !tbaa [[TBAA5]] ; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32*, i32** @a, align 8, !tbaa [[TBAA5]] ; IS__TUNIT____-NEXT: store i32 1, i32* [[TMP1]], align 4, !tbaa [[TBAA0]] -; IS__TUNIT____-NEXT: call fastcc void @fn(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) @g) #[[ATTR0]] +; IS__TUNIT____-NEXT: call fastcc void @fn() #[[ATTR0]] ; IS__TUNIT____-NEXT: ret i32 0 ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll b/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll @@ -53,32 +53,16 @@ } define internal i32 @vfu2(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind readonly { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@vfu2 -; IS__TUNIT_OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) [[U:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 1 -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = load i8, i8* getelementptr inbounds ([[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 0), align 8 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = zext i8 [[TMP2]] to i32 -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = add i32 [[TMP3]], [[TMP1]] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP4]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@vfu2 -; IS__TUNIT_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 -; IS__TUNIT_NPM-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* -; IS__TUNIT_NPM-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 1 -; IS__TUNIT_NPM-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load i8, i8* getelementptr inbounds ([[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 0), align 8 -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = zext i8 [[TMP4]] to i32 -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = add i32 [[TMP5]], [[TMP3]] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP6]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@vfu2 +; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 1 +; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 +; IS__TUNIT____-NEXT: [[TMP2:%.*]] = load i8, i8* getelementptr inbounds ([[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 0), align 8 +; IS__TUNIT____-NEXT: [[TMP3:%.*]] = zext i8 [[TMP2]] to i32 +; IS__TUNIT____-NEXT: [[TMP4:%.*]] = add i32 [[TMP3]], [[TMP1]] +; IS__TUNIT____-NEXT: ret i32 [[TMP4]] ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@vfu2 @@ -102,23 +86,12 @@ } define i32 @unions() nounwind { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@unions -; IS__TUNIT_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(%struct.MYstr* nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) @mystr) #[[ATTR0]] -; IS__TUNIT_OPM-NEXT: ret i32 [[RESULT]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unions -; IS__TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[MYSTR_CAST:%.*]] = bitcast %struct.MYstr* @mystr to i8* -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i8, i8* [[MYSTR_CAST]], align 8 -; IS__TUNIT_NPM-NEXT: [[MYSTR_0_1:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[MYSTR_0_1]], align 8 -; IS__TUNIT_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP0]], i32 [[TMP1]]) #[[ATTR0]] -; IS__TUNIT_NPM-NEXT: ret i32 [[RESULT]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@unions +; IS__TUNIT____-SAME: () #[[ATTR1:[0-9]+]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[RESULT:%.*]] = call i32 @vfu2() #[[ATTR0]] +; IS__TUNIT____-NEXT: ret i32 [[RESULT]] ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@unions @@ -254,8 +227,8 @@ ret i32 %result } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn } ; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind readnone willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/dangling-block-address.ll b/llvm/test/Transforms/Attributor/IPConstantProp/dangling-block-address.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/dangling-block-address.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/dangling-block-address.ll @@ -54,7 +54,7 @@ ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bar -; IS__CGSCC_NPM-SAME: (i32* noalias nocapture nofree nonnull readonly align 536870912 dereferenceable(4294967295) [[PC:%.*]]) #[[ATTR1:[0-9]+]] { +; IS__CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: br label [[INDIRECTGOTO:%.*]] ; IS__CGSCC_NPM: lab0: diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll b/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll @@ -8,7 +8,6 @@ declare i32 @external() -; FIXME: We should not return undef here. define i8* @start(i8 %v) { ; ; IS__TUNIT____-LABEL: define {{[^@]+}}@start diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll b/llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM +; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM +; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ; diff --git a/llvm/test/Transforms/Attributor/align.ll b/llvm/test/Transforms/Attributor/align.ll --- a/llvm/test/Transforms/Attributor/align.ll +++ b/llvm/test/Transforms/Attributor/align.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM +; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=8 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM +; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=8 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM @@ -108,22 +108,14 @@ ; TEST 6 ; SCC define i32* @test6_1() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@test6_1 -; IS__TUNIT____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = tail call i32* @test6_2() #[[ATTR11:[0-9]+]] -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test6_1 -; IS__CGSCC_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = tail call i32* @test6_2() #[[ATTR13:[0-9]+]] -; IS__CGSCC_OPM-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test6_1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test6_1 ; IS__CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = tail call i32* @test6_2() #[[ATTR12:[0-9]+]] ; IS__CGSCC_NPM-NEXT: unreachable ; %ret = tail call i32* @test6_2() @@ -131,22 +123,14 @@ } define i32* @test6_2() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@test6_2 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = tail call i32* @test6_1() #[[ATTR11]] -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test6_2 -; IS__CGSCC_OPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = tail call i32* @test6_1() #[[ATTR13]] -; IS__CGSCC_OPM-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test6_2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test6_2 ; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = tail call i32* @test6_1() #[[ATTR12]] ; IS__CGSCC_NPM-NEXT: unreachable ; %ret = tail call i32* @test6_1() @@ -1269,7 +1253,7 @@ ; IS__CGSCC_OPM-NEXT: [[C:%.*]] = load i1, i1* @cnd, align 1 ; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]] ; IS__CGSCC_OPM: mt: -; IS__CGSCC_OPM-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR14:[0-9]+]] +; IS__CGSCC_OPM-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR13:[0-9]+]] ; IS__CGSCC_OPM-NEXT: ret i32 [[V]] ; IS__CGSCC_OPM: exit: ; IS__CGSCC_OPM-NEXT: ret i32 0 @@ -1280,7 +1264,7 @@ ; IS__CGSCC_NPM-NEXT: [[C:%.*]] = load i1, i1* @cnd, align 1 ; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]] ; IS__CGSCC_NPM: mt: -; IS__CGSCC_NPM-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR13:[0-9]+]] +; IS__CGSCC_NPM-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR12:[0-9]+]] ; IS__CGSCC_NPM-NEXT: ret i32 [[V]] ; IS__CGSCC_NPM: exit: ; IS__CGSCC_NPM-NEXT: ret i32 0 @@ -1378,7 +1362,7 @@ attributes #2 = { null_pointer_is_valid } ;. ; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } ; IS__TUNIT____: attributes #[[ATTR2]] = { nounwind } ; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nosync nounwind } ; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind readonly willreturn } @@ -1388,10 +1372,9 @@ ; IS__TUNIT____: attributes #[[ATTR8]] = { nofree nosync nounwind willreturn writeonly } ; IS__TUNIT____: attributes #[[ATTR9]] = { nofree nosync nounwind readnone willreturn } ; IS__TUNIT____: attributes #[[ATTR10]] = { nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR11]] = { nofree noreturn nosync nounwind readnone } ;. ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable } +; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree noinline nosync nounwind readnone uwtable willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR3]] = { noinline nounwind uwtable } ; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nounwind } @@ -1403,11 +1386,10 @@ ; IS__CGSCC_OPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind willreturn writeonly } ; IS__CGSCC_OPM: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR12]] = { nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR13]] = { nofree noreturn nosync nounwind readnone } -; IS__CGSCC_OPM: attributes #[[ATTR14]] = { readonly willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR13]] = { readonly willreturn } ;. ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable } +; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } ; IS__CGSCC_NPM: attributes #[[ATTR2]] = { noinline nounwind uwtable } ; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nounwind } ; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind } @@ -1418,6 +1400,5 @@ ; IS__CGSCC_NPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind willreturn writeonly } ; IS__CGSCC_NPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC_NPM: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR12]] = { nofree noreturn nosync nounwind readnone } -; IS__CGSCC_NPM: attributes #[[ATTR13]] = { readonly willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR12]] = { readonly willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/depgraph.ll b/llvm/test/Transforms/Attributor/depgraph.ll --- a/llvm/test/Transforms/Attributor/depgraph.ll +++ b/llvm/test/Transforms/Attributor/depgraph.ll @@ -70,6 +70,7 @@ ; GRAPH-NEXT: [AANoUnwind] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state nounwind ; GRAPH-NEXT: updates [AANoCapture] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state assumed not-captured-maybe-returned ; GRAPH-NEXT: updates [AANoCapture] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state assumed not-captured-maybe-returned +; GRAPH-NEXT: updates [AANoCapture] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state assumed not-captured-maybe-returned ; GRAPH-NEXT: updates [AANoUnwind] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state nounwind ; GRAPH-NEXT: updates [AANoUnwind] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state nounwind ; GRAPH-NEXT: updates [AANoUnwind] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state nounwind @@ -92,8 +93,6 @@ ; GRAPH-EMPTY: ; GRAPH-NEXT: [AAIsDead] for CtxI ' %3 = icmp eq i32 %2, 0' at position {flt: [@-1]} with state assumed-live ; GRAPH-EMPTY: -; GRAPH-NEXT: [AAIsDead] for CtxI ' br i1 %3, label %4, label %7' at position {flt: [@-1]} with state assumed-live -; GRAPH-EMPTY: ; GRAPH-NEXT: [AANoFree] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state nofree ; GRAPH-NEXT: updates [AANoFree] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state nofree ; GRAPH-NEXT: updates [AANoFree] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state nofree @@ -105,10 +104,8 @@ ; GRAPH-NEXT: [AANoRecurse] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state may-recurse ; GRAPH-EMPTY: ; GRAPH-NEXT: [AAMemoryBehavior] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state readonly -; GRAPH-NEXT: updates [AANoCapture] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state assumed not-captured-maybe-returned ; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state readonly ; GRAPH-NEXT: updates [AANoCapture] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state assumed not-captured-maybe-returned -; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state readonly ; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state readonly ; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state readonly ; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state readonly @@ -164,7 +161,6 @@ ; GRAPH-EMPTY: ; GRAPH-NEXT: [AAMemoryBehavior] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state readonly ; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs_arg: [@0]} with state readonly -; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs_arg: [@0]} with state readonly ; GRAPH-EMPTY: ; GRAPH-NEXT: [AANoFree] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state nofree ; GRAPH-NEXT: updates [AANoFree] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs_arg: [@0]} with state nofree @@ -207,6 +203,8 @@ ; GRAPH-EMPTY: ; GRAPH-NEXT: [AAPotentialValues] for CtxI ' %3 = icmp eq i32 %2, 0' at position {flt: [@-1]} with state set-state(< {full-set} >) ; GRAPH-EMPTY: +; GRAPH-NEXT: [AAIsDead] for CtxI ' br i1 %3, label %4, label %7' at position {flt: [@-1]} with state assumed-live +; GRAPH-EMPTY: ; GRAPH-NEXT: [AANoReturn] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state may-return ; GRAPH-EMPTY: ; GRAPH-NEXT: [AANoAlias] for CtxI ' %5 = getelementptr inbounds i32, i32* %0, i64 4' at position {flt: [@-1]} with state may-alias @@ -233,18 +231,18 @@ ; GRAPH-EMPTY: ; GRAPH-NEXT: [AAIsDead] for CtxI ' %5 = getelementptr inbounds i32, i32* %0, i64 4' at position {flt: [@-1]} with state assumed-live ; GRAPH-EMPTY: +; GRAPH-NEXT: [AAMemoryLocation] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state memory:argument +; GRAPH-NEXT: updates [AAMemoryLocation] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state memory:argument +; GRAPH-EMPTY: ; GRAPH-NEXT: [AAWillReturn] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state may-noreturn ; GRAPH-EMPTY: ; GRAPH-NEXT: [AANoRecurse] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state may-recurse ; GRAPH-EMPTY: -; GRAPH-NEXT: [AANoSync] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state nosync -; GRAPH-NEXT: updates [AANoSync] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state nosync -; GRAPH-EMPTY: ; GRAPH-NEXT: [AANoFree] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state nofree ; GRAPH-NEXT: updates [AANoFree] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state nofree ; GRAPH-EMPTY: -; GRAPH-NEXT: [AAMemoryLocation] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state memory:argument -; GRAPH-NEXT: updates [AAMemoryLocation] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state memory:argument +; GRAPH-NEXT: [AANoSync] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state nosync +; GRAPH-NEXT: updates [AANoSync] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state nosync ; GRAPH-EMPTY: ; GRAPH-NEXT: [AAAlign] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs_ret: [@-1]} with state align<1-16> ; GRAPH-NEXT: updates [AAAlign] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn_ret:checkAndAdvance [checkAndAdvance@-1]} with state align<1-16> diff --git a/llvm/test/Transforms/Attributor/internal-noalias.ll b/llvm/test/Transforms/Attributor/internal-noalias.ll --- a/llvm/test/Transforms/Attributor/internal-noalias.ll +++ b/llvm/test/Transforms/Attributor/internal-noalias.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM +; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM +; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM diff --git a/llvm/test/Transforms/Attributor/internalize.ll b/llvm/test/Transforms/Attributor/internalize.ll --- a/llvm/test/Transforms/Attributor/internalize.ll +++ b/llvm/test/Transforms/Attributor/internalize.ll @@ -8,8 +8,8 @@ ; Deep Wrapper enabled -; RUN: opt -attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=11 -attributor-allow-deep-wrappers -disable-inlining -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM,CHECK_ENABLED,NOT_CGSCC_NPM_ENABLED,NOT_CGSCC_OPM_ENABLED,NOT_TUNIT_NPM_ENABLED,IS__TUNIT_____ENABLED,IS________OPM_ENABLED,IS__TUNIT_OPM_ENABLED -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=11 -attributor-allow-deep-wrappers -disable-inlining -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM,CHECK_ENABLED,NOT_CGSCC_OPM_ENABLED,NOT_CGSCC_NPM_ENABLED,NOT_TUNIT_OPM_ENABLED,IS__TUNIT_____ENABLED,IS________NPM_ENABLED,IS__TUNIT_NPM_ENABLED +; RUN: opt -attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=12 -attributor-allow-deep-wrappers -disable-inlining -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM,CHECK_ENABLED,NOT_CGSCC_NPM_ENABLED,NOT_CGSCC_OPM_ENABLED,NOT_TUNIT_NPM_ENABLED,IS__TUNIT_____ENABLED,IS________OPM_ENABLED,IS__TUNIT_OPM_ENABLED +; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=12 -attributor-allow-deep-wrappers -disable-inlining -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM,CHECK_ENABLED,NOT_CGSCC_OPM_ENABLED,NOT_CGSCC_NPM_ENABLED,NOT_TUNIT_OPM_ENABLED,IS__TUNIT_____ENABLED,IS________NPM_ENABLED,IS__TUNIT_NPM_ENABLED ; RUN: opt -attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -attributor-allow-deep-wrappers -disable-inlining -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM,CHECK_ENABLED,NOT_TUNIT_NPM_ENABLED,NOT_TUNIT_OPM_ENABLED,NOT_CGSCC_NPM_ENABLED,IS__CGSCC_____ENABLED,IS________OPM_ENABLED,IS__CGSCC_OPM_ENABLED ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -attributor-allow-deep-wrappers -disable-inlining -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM,CHECK_ENABLED,NOT_TUNIT_NPM_ENABLED,NOT_TUNIT_OPM_ENABLED,NOT_CGSCC_OPM_ENABLED,IS__CGSCC_____ENABLED,IS________NPM_ENABLED,IS__CGSCC_NPM_ENABLED diff --git a/llvm/test/Transforms/Attributor/liveness.ll b/llvm/test/Transforms/Attributor/liveness.ll --- a/llvm/test/Transforms/Attributor/liveness.ll +++ b/llvm/test/Transforms/Attributor/liveness.ll @@ -2310,7 +2310,7 @@ ; FIXME: We have to prevent the propagation of %fp in the new pm CGSCC pass until the CallGraphUpdater can handle the new call edge. define internal void @call_via_pointer_with_dead_args_internal_a(i32* %a, i32* %b, void (i32*, i32*, i32*, i64, i32**)* %fp) { ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_internal_a -; NOT_CGSCC_NPM-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull [[FP:%.*]]) { +; NOT_CGSCC_NPM-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]]) { ; NOT_CGSCC_NPM-NEXT: call void @called_via_pointer(i32* [[A]], i32* nonnull align 128 dereferenceable(4) [[B]], i32* [[A]], i64 -1, i32** null) ; NOT_CGSCC_NPM-NEXT: ret void ; @@ -2324,7 +2324,7 @@ } define internal void @call_via_pointer_with_dead_args_internal_b(i32* %a, i32* %b, void (i32*, i32*, i32*, i64, i32**)* %fp) { ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_internal_b -; NOT_CGSCC_NPM-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull [[FP:%.*]]) { +; NOT_CGSCC_NPM-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]]) { ; NOT_CGSCC_NPM-NEXT: call void @called_via_pointer_internal_2(i32* [[A]], i32* nonnull align 128 dereferenceable(4) [[B]], i32* [[A]], i64 -1, i32** null) ; NOT_CGSCC_NPM-NEXT: ret void ; @@ -2345,8 +2345,8 @@ ; NOT_CGSCC_NPM-NEXT: [[PTR4:%.*]] = alloca i32, align 128 ; NOT_CGSCC_NPM-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR1]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef @called_via_pointer) ; NOT_CGSCC_NPM-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR2]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef @called_via_pointer_internal_1) -; NOT_CGSCC_NPM-NEXT: call void @call_via_pointer_with_dead_args_internal_a(i32* [[B]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR3]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef @called_via_pointer) -; NOT_CGSCC_NPM-NEXT: call void @call_via_pointer_with_dead_args_internal_b(i32* [[B]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR4]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef @called_via_pointer_internal_2) +; NOT_CGSCC_NPM-NEXT: call void @call_via_pointer_with_dead_args_internal_a(i32* [[B]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR3]]) +; NOT_CGSCC_NPM-NEXT: call void @call_via_pointer_with_dead_args_internal_b(i32* [[B]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR4]]) ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_caller @@ -2434,7 +2434,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__CGSCC____-LABEL: define {{[^@]+}}@dead_with_blockaddress_users -; IS__CGSCC____-SAME: (i32* noalias nocapture nofree nonnull readonly align 536870912 dereferenceable(4294967295) [[PC:%.*]]) #[[ATTR14:[0-9]+]] { +; IS__CGSCC____-SAME: () #[[ATTR14:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: br label [[INDIRECTGOTO:%.*]] ; IS__CGSCC____: lab0: diff --git a/llvm/test/Transforms/Attributor/memory_locations.ll b/llvm/test/Transforms/Attributor/memory_locations.ll --- a/llvm/test/Transforms/Attributor/memory_locations.ll +++ b/llvm/test/Transforms/Attributor/memory_locations.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM +; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=10 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM +; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=10 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" @@ -631,7 +631,7 @@ define internal i8 @recursive_not_readnone_internal2(i8* %ptr, i1 %c) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind ; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_not_readnone_internal2 -; IS__TUNIT____-SAME: (i8* noalias nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; IS__TUNIT____-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { ; IS__TUNIT____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT____: t: @@ -644,7 +644,7 @@ ; ; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind ; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_not_readnone_internal2 -; IS__CGSCC____-SAME: (i8* noalias nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; IS__CGSCC____-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { ; IS__CGSCC____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__CGSCC____: t: diff --git a/llvm/test/Transforms/Attributor/nodelete.ll b/llvm/test/Transforms/Attributor/nodelete.ll --- a/llvm/test/Transforms/Attributor/nodelete.ll +++ b/llvm/test/Transforms/Attributor/nodelete.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM +; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=4 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM +; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=4 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM diff --git a/llvm/test/Transforms/Attributor/nonnull.ll b/llvm/test/Transforms/Attributor/nonnull.ll --- a/llvm/test/Transforms/Attributor/nonnull.ll +++ b/llvm/test/Transforms/Attributor/nonnull.ll @@ -36,7 +36,6 @@ } define i8* @test2A(i1 %c, i8* %ret) { -; ATTRIBUTOR: define nonnull i8* @test2A(i1 %c, i8* nofree nonnull readnone returned %ret) ; NOT_CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test2A ; NOT_CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0:[0-9]+]] { @@ -69,7 +68,6 @@ } define i8* @test2B(i1 %c, i8* %ret) { -; ATTRIBUTOR: define nonnull dereferenceable(4) i8* @test2B(i1 %c, i8* nofree nonnull readnone returned dereferenceable(4) %ret) ; NOT_CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test2B ; NOT_CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0]] { @@ -146,22 +144,30 @@ ; nonnull if neither can ever return null. (In this case, they ; just never return period.) define i8* @test4_helper() { -; CHECK: Function Attrs: nofree noreturn nosync nounwind readnone -; CHECK-LABEL: define {{[^@]+}}@test4_helper -; CHECK-SAME: () #[[ATTR2:[0-9]+]] { -; CHECK-NEXT: [[RET:%.*]] = call i8* @test4() #[[ATTR2]] -; CHECK-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test4_helper +; NOT_CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: unreachable +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test4_helper +; IS__CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: unreachable ; %ret = call i8* @test4() ret i8* %ret } define i8* @test4() { -; CHECK: Function Attrs: nofree noreturn nosync nounwind readnone -; CHECK-LABEL: define {{[^@]+}}@test4 -; CHECK-SAME: () #[[ATTR2]] { -; CHECK-NEXT: [[RET:%.*]] = call i8* @test4_helper() #[[ATTR2]] -; CHECK-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test4 +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: unreachable +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test4 +; IS__CGSCC_NPM-SAME: () #[[ATTR2]] { +; IS__CGSCC_NPM-NEXT: unreachable ; %ret = call i8* @test4_helper() ret i8* %ret @@ -227,6 +233,7 @@ ; Local analysis, but going through a self recursive phi define i8* @test6a() { +; ; NOT_CGSCC_OPM: Function Attrs: noreturn ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test6a ; NOT_CGSCC_OPM-SAME: () #[[ATTR3:[0-9]+]] { @@ -422,6 +429,7 @@ ret void } define internal void @test13(i8* %a, i8* %b, i8* %c) { +; ; NOT_CGSCC_OPM: Function Attrs: nounwind ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test13 ; NOT_CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone [[A:%.*]], i8* noalias nocapture nofree readnone [[B:%.*]], i8* noalias nocapture nofree readnone [[C:%.*]]) #[[ATTR4]] { @@ -635,6 +643,7 @@ ; fun1(nonnull %a) ; We can say that %a is nonnull define void @f17(i8* %a, i8 %c) { +; ; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f17 ; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR6]] { @@ -1106,6 +1115,7 @@ ; Check we do not annotate the function interface of this weak function. define weak_odr void @weak_caller(i32* nonnull %a) { +; ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@weak_caller ; NOT_CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]]) { ; NOT_CGSCC_OPM-NEXT: call void @called_by_weak(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR4]] @@ -1156,6 +1166,7 @@ } ; Avoid nonnull as we do not touch optnone define internal void @optnone(i32* dereferenceable(4) %a) optnone noinline { +; ; NOT_CGSCC_OPM: Function Attrs: noinline optnone ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@optnone ; NOT_CGSCC_OPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR10:[0-9]+]] { @@ -1630,6 +1641,7 @@ ; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) ; ATTRIBUTOR-NEXT: ret void ; +; ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_neg ; NOT_CGSCC_OPM-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) { ; NOT_CGSCC_OPM-NEXT: [[TMP1:%.*]] = call i8* @unknown() @@ -1716,7 +1728,7 @@ ;. ; IS__TUNIT____: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn } ; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone } +; IS__TUNIT____: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone willreturn } ; IS__TUNIT____: attributes #[[ATTR3]] = { noreturn } ; IS__TUNIT____: attributes #[[ATTR4]] = { nounwind } ; IS__TUNIT____: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind readonly } @@ -1732,7 +1744,7 @@ ;. ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone } +; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind readnone willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR4]] = { noreturn } ; IS__CGSCC_OPM: attributes #[[ATTR5]] = { nounwind } @@ -1749,7 +1761,7 @@ ;. ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn } ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone } +; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } ; IS__CGSCC_NPM: attributes #[[ATTR3]] = { noreturn } ; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nounwind } ; IS__CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind readonly } diff --git a/llvm/test/Transforms/Attributor/norecurse.ll b/llvm/test/Transforms/Attributor/norecurse.ll --- a/llvm/test/Transforms/Attributor/norecurse.ll +++ b/llvm/test/Transforms/Attributor/norecurse.ll @@ -34,32 +34,56 @@ } define i32 @indirect_rec() { -; CHECK: Function Attrs: nofree noreturn nosync nounwind readnone -; CHECK-LABEL: define {{[^@]+}}@indirect_rec -; CHECK-SAME: () #[[ATTR2:[0-9]+]] { -; CHECK-NEXT: [[A:%.*]] = call i32 @indirect_rec2() #[[ATTR2]] -; CHECK-NEXT: unreachable +; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@indirect_rec +; IS__TUNIT____-SAME: () #[[ATTR1]] { +; IS__TUNIT____-NEXT: unreachable +; +; IS__CGSCC_OPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@indirect_rec +; IS__CGSCC_OPM-SAME: () #[[ATTR2:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: unreachable +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@indirect_rec +; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { +; IS__CGSCC_NPM-NEXT: unreachable ; %a = call i32 @indirect_rec2() ret i32 %a } define i32 @indirect_rec2() { -; CHECK: Function Attrs: nofree noreturn nosync nounwind readnone -; CHECK-LABEL: define {{[^@]+}}@indirect_rec2 -; CHECK-SAME: () #[[ATTR2]] { -; CHECK-NEXT: [[A:%.*]] = call i32 @indirect_rec() #[[ATTR2]] -; CHECK-NEXT: unreachable +; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@indirect_rec2 +; IS__TUNIT____-SAME: () #[[ATTR1]] { +; IS__TUNIT____-NEXT: unreachable +; +; IS__CGSCC_OPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@indirect_rec2 +; IS__CGSCC_OPM-SAME: () #[[ATTR2]] { +; IS__CGSCC_OPM-NEXT: unreachable +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@indirect_rec2 +; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { +; IS__CGSCC_NPM-NEXT: unreachable ; %a = call i32 @indirect_rec() ret i32 %a } define i32 @extern() { -; CHECK: Function Attrs: nosync readnone -; CHECK-LABEL: define {{[^@]+}}@extern -; CHECK-SAME: () #[[ATTR3:[0-9]+]] { -; CHECK-NEXT: [[A:%.*]] = call i32 @k() -; CHECK-NEXT: ret i32 [[A]] +; NOT_CGSCC_OPM: Function Attrs: nosync readnone +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@extern +; NOT_CGSCC_OPM-SAME: () #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @k() +; NOT_CGSCC_OPM-NEXT: ret i32 [[A]] +; +; IS__CGSCC_OPM: Function Attrs: nosync readnone +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@extern +; IS__CGSCC_OPM-SAME: () #[[ATTR3:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @k() +; IS__CGSCC_OPM-NEXT: ret i32 [[A]] ; %a = call i32 @k() ret i32 %a @@ -70,11 +94,17 @@ declare i32 @k() readnone define void @intrinsic(i8* %dest, i8* %src, i32 %len) { -; CHECK: Function Attrs: argmemonly nofree nosync nounwind willreturn -; CHECK-LABEL: define {{[^@]+}}@intrinsic -; CHECK-SAME: (i8* nocapture nofree writeonly [[DEST:%.*]], i8* nocapture nofree readonly [[SRC:%.*]], i32 [[LEN:%.*]]) #[[ATTR5:[0-9]+]] { -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[DEST]], i8* noalias nocapture nofree readonly [[SRC]], i32 [[LEN]], i1 noundef false) #[[ATTR11:[0-9]+]] -; CHECK-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@intrinsic +; NOT_CGSCC_OPM-SAME: (i8* nocapture nofree writeonly [[DEST:%.*]], i8* nocapture nofree readonly [[SRC:%.*]], i32 [[LEN:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[DEST]], i8* noalias nocapture nofree readonly [[SRC]], i32 [[LEN]], i1 noundef false) #[[ATTR10:[0-9]+]] +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@intrinsic +; IS__CGSCC_OPM-SAME: (i8* nocapture nofree writeonly [[DEST:%.*]], i8* nocapture nofree readonly [[SRC:%.*]], i32 [[LEN:%.*]]) #[[ATTR5:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[DEST]], i8* noalias nocapture nofree readonly [[SRC]], i32 [[LEN]], i1 noundef false) #[[ATTR11:[0-9]+]] +; IS__CGSCC_OPM-NEXT: ret void ; call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i1 false) ret void @@ -87,15 +117,21 @@ define internal i32 @called_by_norecurse() { ; IS__TUNIT____: Function Attrs: nosync readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@called_by_norecurse -; IS__TUNIT____-SAME: () #[[ATTR3]] { +; IS__TUNIT____-SAME: () #[[ATTR2]] { ; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @k() ; IS__TUNIT____-NEXT: ret i32 undef ; -; IS__CGSCC____: Function Attrs: norecurse nosync readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@called_by_norecurse -; IS__CGSCC____-SAME: () #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = call i32 @k() -; IS__CGSCC____-NEXT: ret i32 undef +; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@called_by_norecurse +; IS__CGSCC_OPM-SAME: () #[[ATTR7:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @k() +; IS__CGSCC_OPM-NEXT: ret i32 undef +; +; IS__CGSCC_NPM: Function Attrs: norecurse nosync readnone +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@called_by_norecurse +; IS__CGSCC_NPM-SAME: () #[[ATTR6:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @k() +; IS__CGSCC_NPM-NEXT: ret i32 undef ; %a = call i32 @k() ret i32 %a @@ -103,26 +139,38 @@ define void @m() norecurse { ; IS__TUNIT____: Function Attrs: norecurse nosync readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@m -; IS__TUNIT____-SAME: () #[[ATTR7:[0-9]+]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() #[[ATTR3]] +; IS__TUNIT____-SAME: () #[[ATTR6:[0-9]+]] { +; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() #[[ATTR2]] ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: norecurse nosync readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@m -; IS__CGSCC____-SAME: () #[[ATTR7]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() -; IS__CGSCC____-NEXT: ret void +; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@m +; IS__CGSCC_OPM-SAME: () #[[ATTR7]] { +; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: norecurse nosync readnone +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@m +; IS__CGSCC_NPM-SAME: () #[[ATTR6]] { +; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() +; IS__CGSCC_NPM-NEXT: ret void ; %a = call i32 @called_by_norecurse() ret void } define internal i32 @called_by_norecurse_indirectly() { -; CHECK: Function Attrs: nosync readnone -; CHECK-LABEL: define {{[^@]+}}@called_by_norecurse_indirectly -; CHECK-SAME: () #[[ATTR3]] { -; CHECK-NEXT: [[A:%.*]] = call i32 @k() -; CHECK-NEXT: ret i32 [[A]] +; NOT_CGSCC_OPM: Function Attrs: nosync readnone +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@called_by_norecurse_indirectly +; NOT_CGSCC_OPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @k() +; NOT_CGSCC_OPM-NEXT: ret i32 [[A]] +; +; IS__CGSCC_OPM: Function Attrs: nosync readnone +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@called_by_norecurse_indirectly +; IS__CGSCC_OPM-SAME: () #[[ATTR3]] { +; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @k() +; IS__CGSCC_OPM-NEXT: ret i32 [[A]] ; %a = call i32 @k() ret i32 %a @@ -130,15 +178,21 @@ define internal i32 @o() { ; IS__TUNIT____: Function Attrs: nosync readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@o -; IS__TUNIT____-SAME: () #[[ATTR3]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() #[[ATTR3]] +; IS__TUNIT____-SAME: () #[[ATTR2]] { +; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() #[[ATTR2]] ; IS__TUNIT____-NEXT: ret i32 [[A]] ; -; IS__CGSCC____: Function Attrs: norecurse nosync readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@o -; IS__CGSCC____-SAME: () #[[ATTR7]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() -; IS__CGSCC____-NEXT: ret i32 [[A]] +; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@o +; IS__CGSCC_OPM-SAME: () #[[ATTR7]] { +; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() +; IS__CGSCC_OPM-NEXT: ret i32 [[A]] +; +; IS__CGSCC_NPM: Function Attrs: norecurse nosync readnone +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@o +; IS__CGSCC_NPM-SAME: () #[[ATTR6]] { +; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() +; IS__CGSCC_NPM-NEXT: ret i32 [[A]] ; %a = call i32 @called_by_norecurse_indirectly() ret i32 %a @@ -146,35 +200,56 @@ define i32 @p() norecurse { ; IS__TUNIT____: Function Attrs: norecurse nosync readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@p -; IS__TUNIT____-SAME: () #[[ATTR7]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @o() #[[ATTR3]] +; IS__TUNIT____-SAME: () #[[ATTR6]] { +; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @o() #[[ATTR2]] ; IS__TUNIT____-NEXT: ret i32 [[A]] ; -; IS__CGSCC____: Function Attrs: norecurse nosync readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@p -; IS__CGSCC____-SAME: () #[[ATTR7]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = call i32 @o() -; IS__CGSCC____-NEXT: ret i32 [[A]] +; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@p +; IS__CGSCC_OPM-SAME: () #[[ATTR7]] { +; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @o() +; IS__CGSCC_OPM-NEXT: ret i32 [[A]] +; +; IS__CGSCC_NPM: Function Attrs: norecurse nosync readnone +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@p +; IS__CGSCC_NPM-SAME: () #[[ATTR6]] { +; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @o() +; IS__CGSCC_NPM-NEXT: ret i32 [[A]] ; %a = call i32 @o() ret i32 %a } define void @f(i32 %x) { -; CHECK: Function Attrs: nofree nosync nounwind readnone -; CHECK-LABEL: define {{[^@]+}}@f -; CHECK-SAME: (i32 [[X:%.*]]) #[[ATTR8:[0-9]+]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 -; CHECK-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 -; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[X_ADDR]], align 4 -; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 -; CHECK-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; CHECK: if.then: -; CHECK-NEXT: call void @g() #[[ATTR9:[0-9]+]] -; CHECK-NEXT: br label [[IF_END]] -; CHECK: if.end: -; CHECK-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f +; NOT_CGSCC_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: entry: +; NOT_CGSCC_OPM-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 +; NOT_CGSCC_OPM-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 +; NOT_CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[X_ADDR]], align 4 +; NOT_CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 +; NOT_CGSCC_OPM-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_CGSCC_OPM: if.then: +; NOT_CGSCC_OPM-NEXT: call void @g() #[[ATTR8:[0-9]+]] +; NOT_CGSCC_OPM-NEXT: br label [[IF_END]] +; NOT_CGSCC_OPM: if.end: +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f +; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR8:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 +; IS__CGSCC_OPM-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 +; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[X_ADDR]], align 4 +; IS__CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 +; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; IS__CGSCC_OPM: if.then: +; IS__CGSCC_OPM-NEXT: call void @g() #[[ATTR9:[0-9]+]] +; IS__CGSCC_OPM-NEXT: br label [[IF_END]] +; IS__CGSCC_OPM: if.end: +; IS__CGSCC_OPM-NEXT: ret void ; entry: %x.addr = alloca i32, align 4 @@ -192,12 +267,19 @@ } define void @g() norecurse { -; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone -; CHECK-LABEL: define {{[^@]+}}@g -; CHECK-SAME: () #[[ATTR9]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: call void @f(i32 noundef 0) #[[ATTR8]] -; CHECK-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@g +; NOT_CGSCC_OPM-SAME: () #[[ATTR8]] { +; NOT_CGSCC_OPM-NEXT: entry: +; NOT_CGSCC_OPM-NEXT: call void @f(i32 noundef 0) #[[ATTR7]] +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@g +; IS__CGSCC_OPM-SAME: () #[[ATTR9]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: call void @f(i32 noundef 0) #[[ATTR8]] +; IS__CGSCC_OPM-NEXT: ret void ; entry: call void @f(i32 0) @@ -223,11 +305,17 @@ } define i32 @eval_func2(i32 (i32)* , i32) local_unnamed_addr null_pointer_is_valid{ -; CHECK: Function Attrs: null_pointer_is_valid -; CHECK-LABEL: define {{[^@]+}}@eval_func2 -; CHECK-SAME: (i32 (i32)* nocapture nofree noundef [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR10:[0-9]+]] { -; CHECK-NEXT: [[TMP3:%.*]] = tail call i32 [[TMP0]](i32 [[TMP1]]) -; CHECK-NEXT: ret i32 [[TMP3]] +; NOT_CGSCC_OPM: Function Attrs: null_pointer_is_valid +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@eval_func2 +; NOT_CGSCC_OPM-SAME: (i32 (i32)* nocapture nofree noundef [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR9:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: [[TMP3:%.*]] = tail call i32 [[TMP0]](i32 [[TMP1]]) +; NOT_CGSCC_OPM-NEXT: ret i32 [[TMP3]] +; +; IS__CGSCC_OPM: Function Attrs: null_pointer_is_valid +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@eval_func2 +; IS__CGSCC_OPM-SAME: (i32 (i32)* nocapture nofree noundef [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR10:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = tail call i32 [[TMP0]](i32 [[TMP1]]) +; IS__CGSCC_OPM-NEXT: ret i32 [[TMP3]] ; %3 = tail call i32 %0(i32 %1) #2 ret i32 %3 @@ -259,27 +347,38 @@ ;. ; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ; IS__TUNIT____: attributes #[[ATTR1]] = { nofree noreturn nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR3]] = { nosync readnone } -; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { readnone } -; IS__TUNIT____: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR6:[0-9]+]] = { argmemonly nofree nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR7]] = { norecurse nosync readnone } -; IS__TUNIT____: attributes #[[ATTR8]] = { nofree nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR10]] = { null_pointer_is_valid } -; IS__TUNIT____: attributes #[[ATTR11]] = { willreturn } +; IS__TUNIT____: attributes #[[ATTR2]] = { nosync readnone } +; IS__TUNIT____: attributes #[[ATTR3:[0-9]+]] = { readnone } +; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR6]] = { norecurse nosync readnone } +; IS__TUNIT____: attributes #[[ATTR7]] = { nofree nosync nounwind readnone } +; IS__TUNIT____: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone } +; IS__TUNIT____: attributes #[[ATTR9]] = { null_pointer_is_valid } +; IS__TUNIT____: attributes #[[ATTR10]] = { willreturn } +;. +; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nosync readnone } +; IS__CGSCC_OPM: attributes #[[ATTR4:[0-9]+]] = { readnone } +; IS__CGSCC_OPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR6:[0-9]+]] = { argmemonly nofree nounwind willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR7]] = { norecurse nosync readnone } +; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree nosync nounwind readnone } +; IS__CGSCC_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind readnone } +; IS__CGSCC_OPM: attributes #[[ATTR10]] = { null_pointer_is_valid } +; IS__CGSCC_OPM: attributes #[[ATTR11]] = { willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR3]] = { nosync readnone } -; IS__CGSCC____: attributes #[[ATTR4:[0-9]+]] = { readnone } -; IS__CGSCC____: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR6:[0-9]+]] = { argmemonly nofree nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR7]] = { norecurse nosync readnone } -; IS__CGSCC____: attributes #[[ATTR8]] = { nofree nosync nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR10]] = { null_pointer_is_valid } -; IS__CGSCC____: attributes #[[ATTR11]] = { willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nosync readnone } +; IS__CGSCC_NPM: attributes #[[ATTR3:[0-9]+]] = { readnone } +; IS__CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR6]] = { norecurse nosync readnone } +; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind readnone } +; IS__CGSCC_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone } +; IS__CGSCC_NPM: attributes #[[ATTR9]] = { null_pointer_is_valid } +; IS__CGSCC_NPM: attributes #[[ATTR10]] = { willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/noundef.ll b/llvm/test/Transforms/Attributor/noundef.ll --- a/llvm/test/Transforms/Attributor/noundef.ll +++ b/llvm/test/Transforms/Attributor/noundef.ll @@ -87,6 +87,7 @@ } define internal void @callee_with_dead_arg(i1 %create, ...) { +; ; CHECK-LABEL: define {{[^@]+}}@callee_with_dead_arg ; CHECK-SAME: (i1 [[CREATE:%.*]], ...) { ; CHECK-NEXT: entry: @@ -113,6 +114,7 @@ ; try to come up with a different scheme to verify the `noundef` is dropped if ; signature rewriting is not happening. define void @caller_with_noundef_arg() { +; ; CHECK-LABEL: define {{[^@]+}}@caller_with_noundef_arg() { ; CHECK-NEXT: call void (i1, ...) @callee_with_dead_arg(i1 undef) ; CHECK-NEXT: ret void diff --git a/llvm/test/Transforms/Attributor/potential.ll b/llvm/test/Transforms/Attributor/potential.ll --- a/llvm/test/Transforms/Attributor/potential.ll +++ b/llvm/test/Transforms/Attributor/potential.ll @@ -100,10 +100,10 @@ define internal i32 @iszero3(i32 %c) { ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@iszero3 -; IS__CGSCC____-SAME: (i32 noundef [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 -; IS__CGSCC____-NEXT: [[RET:%.*]] = zext i1 [[CMP]] to i32 -; IS__CGSCC____-NEXT: ret i32 [[RET]] +; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 undef, 0 +; IS__CGSCC____-NEXT: [[RET:%.*]] = zext i1 undef to i32 +; IS__CGSCC____-NEXT: ret i32 undef ; %cmp = icmp eq i32 %c, 0 %ret = zext i1 %cmp to i32 @@ -113,10 +113,10 @@ define internal i32 @less_than_two(i32 %c) { ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@less_than_two -; IS__CGSCC____-SAME: (i32 noundef [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp slt i32 [[C]], 2 +; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp slt i32 undef, 2 ; IS__CGSCC____-NEXT: [[RET:%.*]] = zext i1 true to i32 -; IS__CGSCC____-NEXT: ret i32 1 +; IS__CGSCC____-NEXT: ret i32 undef ; %cmp = icmp slt i32 %c, 2 %ret = zext i1 %cmp to i32 diff --git a/llvm/test/Transforms/Attributor/range.ll b/llvm/test/Transforms/Attributor/range.ll --- a/llvm/test/Transforms/Attributor/range.ll +++ b/llvm/test/Transforms/Attributor/range.ll @@ -435,9 +435,9 @@ } define i32 @test2_check(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test2_check -; IS__TUNIT____-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree readnone align 4 [[P:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: br label [[IF_THEN:%.*]] ; IS__TUNIT____: if.then: @@ -447,9 +447,9 @@ ; IS__TUNIT____: return: ; IS__TUNIT____-NEXT: ret i32 2 ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@test2_check -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readnone align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: br label [[IF_THEN:%.*]] ; IS__CGSCC____: if.then: @@ -505,7 +505,7 @@ define internal i32 @r1(i32) local_unnamed_addr { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@r1 -; IS__TUNIT_OPM-SAME: () local_unnamed_addr #[[ATTR1:[0-9]+]] { +; IS__TUNIT_OPM-SAME: () local_unnamed_addr #[[ATTR2:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: br label [[TMP4:%.*]] ; IS__TUNIT_OPM: 1: ; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[TMP7:%.*]], 10000 @@ -524,7 +524,7 @@ ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@r1 -; IS__CGSCC_OPM-SAME: () local_unnamed_addr #[[ATTR1:[0-9]+]] { +; IS__CGSCC_OPM-SAME: () local_unnamed_addr #[[ATTR2:[0-9]+]] { ; IS__CGSCC_OPM-NEXT: br label [[TMP4:%.*]] ; IS__CGSCC_OPM: 1: ; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[TMP7:%.*]], 10000 @@ -543,7 +543,7 @@ ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@r1 -; IS__CGSCC_NPM-SAME: () local_unnamed_addr #[[ATTR1:[0-9]+]] { +; IS__CGSCC_NPM-SAME: () local_unnamed_addr #[[ATTR1]] { ; IS__CGSCC_NPM-NEXT: br label [[TMP3:%.*]] ; IS__CGSCC_NPM: 1: ; IS__CGSCC_NPM-NEXT: br label [[F:%.*]] @@ -580,7 +580,7 @@ define void @f1(i32){ ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@f1 ; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]]) { -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = tail call i32 @r1() #[[ATTR1]] +; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = tail call i32 @r1() #[[ATTR2]] ; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP2]], 15 ; IS__TUNIT_OPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP5:%.*]] ; IS__TUNIT_OPM: 4: @@ -591,7 +591,7 @@ ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f1 -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { +; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1]] { ; IS__TUNIT_NPM-NEXT: br label [[TMP3:%.*]] ; IS__TUNIT_NPM: 2: ; IS__TUNIT_NPM-NEXT: unreachable @@ -612,11 +612,10 @@ ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f1 ; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp sgt i32 10, 15 -; IS__CGSCC_NPM-NEXT: br i1 false, label [[TMP3:%.*]], label [[TMP4:%.*]] -; IS__CGSCC_NPM: 3: +; IS__CGSCC_NPM-NEXT: br label [[TMP3:%.*]] +; IS__CGSCC_NPM: 2: ; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: 4: +; IS__CGSCC_NPM: 3: ; IS__CGSCC_NPM-NEXT: ret void ; %2 = tail call i32 @r1(i32 %0) @@ -642,53 +641,29 @@ ; } ; } define dso_local i32 @test4-f1(i32 %u) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test4-f1 -; IS__TUNIT_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] -; IS__TUNIT_OPM: if.then: -; IS__TUNIT_OPM-NEXT: br label [[RETURN]] -; IS__TUNIT_OPM: return: -; IS__TUNIT_OPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[U]], [[IF_THEN]] ], [ 0, [[ENTRY:%.*]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[RETVAL_0]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test4-f1 -; IS__TUNIT_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] -; IS__TUNIT_NPM: if.then: -; IS__TUNIT_NPM-NEXT: br label [[RETURN]] -; IS__TUNIT_NPM: return: -; IS__TUNIT_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[U]], [[IF_THEN]] ], [ 0, [[ENTRY:%.*]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[RETVAL_0]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test4-f1 -; IS__CGSCC_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] -; IS__CGSCC_OPM: if.then: -; IS__CGSCC_OPM-NEXT: br label [[RETURN]] -; IS__CGSCC_OPM: return: -; IS__CGSCC_OPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[U]], [[IF_THEN]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[RETVAL_0]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@test4-f1 +; IS__TUNIT____-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 +; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] +; IS__TUNIT____: if.then: +; IS__TUNIT____-NEXT: br label [[RETURN]] +; IS__TUNIT____: return: +; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[U]], [[IF_THEN]] ], [ 0, [[ENTRY:%.*]] ] +; IS__TUNIT____-NEXT: ret i32 [[RETVAL_0]] ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test4-f1 -; IS__CGSCC_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] -; IS__CGSCC_NPM: if.then: -; IS__CGSCC_NPM-NEXT: br label [[RETURN]] -; IS__CGSCC_NPM: return: -; IS__CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[U]], [[IF_THEN]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[RETVAL_0]] +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@test4-f1 +; IS__CGSCC____-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 +; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] +; IS__CGSCC____: if.then: +; IS__CGSCC____-NEXT: br label [[RETURN]] +; IS__CGSCC____: return: +; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[U]], [[IF_THEN]] ], [ 0, [[ENTRY:%.*]] ] +; IS__CGSCC____-NEXT: ret i32 [[RETVAL_0]] ; ; FIXME: RETVAL_0 >= 0 entry: @@ -705,23 +680,16 @@ define dso_local i32 @test4-g1(i32 %u) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test4-g1 -; IS__TUNIT_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR2]] -; IS__TUNIT_OPM-NEXT: ret i32 [[CALL]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test4-g1 -; IS__TUNIT_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR1]] -; IS__TUNIT_NPM-NEXT: ret i32 [[CALL]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@test4-g1 +; IS__TUNIT____-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR1]] +; IS__TUNIT____-NEXT: ret i32 [[CALL]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test4-g1 -; IS__CGSCC_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { +; IS__CGSCC_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR5:[0-9]+]] ; IS__CGSCC_OPM-NEXT: ret i32 [[CALL]] @@ -749,65 +717,35 @@ ; } ; } define dso_local i32 @test4-f2(i32 %u) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test4-f2 -; IS__TUNIT_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__TUNIT_OPM: if.then: -; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = add nuw nsw i32 [[U]], 1 -; IS__TUNIT_OPM-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT_OPM: if.else: -; IS__TUNIT_OPM-NEXT: br label [[RETURN]] -; IS__TUNIT_OPM: return: -; IS__TUNIT_OPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[ADD]], [[IF_THEN]] ], [ 1, [[IF_ELSE]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[RETVAL_0]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test4-f2 -; IS__TUNIT_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__TUNIT_NPM: if.then: -; IS__TUNIT_NPM-NEXT: [[ADD:%.*]] = add nuw nsw i32 [[U]], 1 -; IS__TUNIT_NPM-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT_NPM: if.else: -; IS__TUNIT_NPM-NEXT: br label [[RETURN]] -; IS__TUNIT_NPM: return: -; IS__TUNIT_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[ADD]], [[IF_THEN]] ], [ 1, [[IF_ELSE]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[RETVAL_0]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test4-f2 -; IS__CGSCC_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__CGSCC_OPM: if.then: -; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = add nuw nsw i32 [[U]], 1 -; IS__CGSCC_OPM-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC_OPM: if.else: -; IS__CGSCC_OPM-NEXT: br label [[RETURN]] -; IS__CGSCC_OPM: return: -; IS__CGSCC_OPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[ADD]], [[IF_THEN]] ], [ 1, [[IF_ELSE]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[RETVAL_0]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@test4-f2 +; IS__TUNIT____-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 +; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; IS__TUNIT____: if.then: +; IS__TUNIT____-NEXT: [[ADD:%.*]] = add nuw nsw i32 [[U]], 1 +; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] +; IS__TUNIT____: if.else: +; IS__TUNIT____-NEXT: br label [[RETURN]] +; IS__TUNIT____: return: +; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[ADD]], [[IF_THEN]] ], [ 1, [[IF_ELSE]] ] +; IS__TUNIT____-NEXT: ret i32 [[RETVAL_0]] ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test4-f2 -; IS__CGSCC_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__CGSCC_NPM: if.then: -; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = add nuw nsw i32 [[U]], 1 -; IS__CGSCC_NPM-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC_NPM: if.else: -; IS__CGSCC_NPM-NEXT: br label [[RETURN]] -; IS__CGSCC_NPM: return: -; IS__CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[ADD]], [[IF_THEN]] ], [ 1, [[IF_ELSE]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[RETVAL_0]] +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@test4-f2 +; IS__CGSCC____-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 +; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; IS__CGSCC____: if.then: +; IS__CGSCC____-NEXT: [[ADD:%.*]] = add nuw nsw i32 [[U]], 1 +; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] +; IS__CGSCC____: if.else: +; IS__CGSCC____-NEXT: br label [[RETURN]] +; IS__CGSCC____: return: +; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[ADD]], [[IF_THEN]] ], [ 1, [[IF_ELSE]] ] +; IS__CGSCC____-NEXT: ret i32 [[RETVAL_0]] ; entry: %cmp = icmp sgt i32 %u, -1 @@ -829,9 +767,9 @@ define dso_local i32 @test4-g2(i32 %u) { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test4-g2 -; IS__TUNIT_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { +; IS__TUNIT_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR2]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR1]] ; IS__TUNIT_OPM-NEXT: ret i32 [[CALL]] ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn @@ -843,7 +781,7 @@ ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test4-g2 -; IS__CGSCC_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { +; IS__CGSCC_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR5]] ; IS__CGSCC_OPM-NEXT: ret i32 [[CALL]] @@ -876,26 +814,47 @@ ret i32 %call } define internal i32 @rec(i32 %depth) { -; CHECK-LABEL: define {{[^@]+}}@rec -; CHECK-SAME: (i32 [[DEPTH:%.*]]) { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32 @foo(i32 [[DEPTH]]) -; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[CALL]], 0 -; CHECK-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; CHECK: if.then: -; CHECK-NEXT: br label [[RETURN:%.*]] -; CHECK: if.end: -; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[DEPTH]], 10 -; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN1:%.*]], label [[IF_END3:%.*]] -; CHECK: if.then1: -; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[DEPTH]], 1 -; CHECK-NEXT: [[CALL2:%.*]] = call i32 @rec(i32 [[ADD]]) -; CHECK-NEXT: br label [[IF_END3]] -; CHECK: if.end3: -; CHECK-NEXT: br label [[RETURN]] -; CHECK: return: -; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i32 [ 0, [[IF_THEN]] ], [ 1, [[IF_END3]] ] -; CHECK-NEXT: ret i32 [[RETVAL_0]] +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@rec +; IS__TUNIT_OPM-SAME: (i32 [[DEPTH:%.*]]) { +; IS__TUNIT_OPM-NEXT: entry: +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32 @foo(i32 [[DEPTH]]) +; IS__TUNIT_OPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[CALL]], 0 +; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; IS__TUNIT_OPM: if.then: +; IS__TUNIT_OPM-NEXT: br label [[RETURN:%.*]] +; IS__TUNIT_OPM: if.end: +; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[DEPTH]], 10 +; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN1:%.*]], label [[IF_END3:%.*]] +; IS__TUNIT_OPM: if.then1: +; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[DEPTH]], 1 +; IS__TUNIT_OPM-NEXT: [[CALL2:%.*]] = call i32 @rec(i32 [[ADD]]), !range [[RNG3]] +; IS__TUNIT_OPM-NEXT: br label [[IF_END3]] +; IS__TUNIT_OPM: if.end3: +; IS__TUNIT_OPM-NEXT: br label [[RETURN]] +; IS__TUNIT_OPM: return: +; IS__TUNIT_OPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ 0, [[IF_THEN]] ], [ 1, [[IF_END3]] ] +; IS__TUNIT_OPM-NEXT: ret i32 [[RETVAL_0]] +; +; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@rec +; NOT_TUNIT_OPM-SAME: (i32 [[DEPTH:%.*]]) { +; NOT_TUNIT_OPM-NEXT: entry: +; NOT_TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32 @foo(i32 [[DEPTH]]) +; NOT_TUNIT_OPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[CALL]], 0 +; NOT_TUNIT_OPM-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_TUNIT_OPM: if.then: +; NOT_TUNIT_OPM-NEXT: br label [[RETURN:%.*]] +; NOT_TUNIT_OPM: if.end: +; NOT_TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[DEPTH]], 10 +; NOT_TUNIT_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN1:%.*]], label [[IF_END3:%.*]] +; NOT_TUNIT_OPM: if.then1: +; NOT_TUNIT_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[DEPTH]], 1 +; NOT_TUNIT_OPM-NEXT: [[CALL2:%.*]] = call i32 @rec(i32 [[ADD]]), !range [[RNG4]] +; NOT_TUNIT_OPM-NEXT: br label [[IF_END3]] +; NOT_TUNIT_OPM: if.end3: +; NOT_TUNIT_OPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_OPM: return: +; NOT_TUNIT_OPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ 0, [[IF_THEN]] ], [ 1, [[IF_END3]] ] +; NOT_TUNIT_OPM-NEXT: ret i32 [[RETVAL_0]] ; entry: %call = call i32 @foo(i32 %depth) @@ -932,109 +891,57 @@ ; FIXME: All but the return is not needed anymore define dso_local zeroext i1 @phi(i32 %arg) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@phi -; IS__TUNIT_OPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: bb: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[ARG]], 5 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP]], label [[BB1:%.*]], label [[BB2:%.*]] -; IS__TUNIT_OPM: bb1: -; IS__TUNIT_OPM-NEXT: br label [[BB3:%.*]] -; IS__TUNIT_OPM: bb2: -; IS__TUNIT_OPM-NEXT: br label [[BB3]] -; IS__TUNIT_OPM: bb3: -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = icmp sgt i32 [[ARG]], 10 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP4]], label [[BB5:%.*]], label [[BB7:%.*]] -; IS__TUNIT_OPM: bb5: -; IS__TUNIT_OPM-NEXT: br label [[BB9:%.*]] -; IS__TUNIT_OPM: bb7: -; IS__TUNIT_OPM-NEXT: br label [[BB9]] -; IS__TUNIT_OPM: bb9: -; IS__TUNIT_OPM-NEXT: br label [[BB12:%.*]] -; IS__TUNIT_OPM: bb11: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: bb12: -; IS__TUNIT_OPM-NEXT: br label [[BB13:%.*]] -; IS__TUNIT_OPM: bb13: -; IS__TUNIT_OPM-NEXT: ret i1 false -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@phi -; IS__TUNIT_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[ARG]], 5 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP]], label [[BB1:%.*]], label [[BB2:%.*]] -; IS__TUNIT_NPM: bb1: -; IS__TUNIT_NPM-NEXT: br label [[BB3:%.*]] -; IS__TUNIT_NPM: bb2: -; IS__TUNIT_NPM-NEXT: br label [[BB3]] -; IS__TUNIT_NPM: bb3: -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = icmp sgt i32 [[ARG]], 10 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP4]], label [[BB5:%.*]], label [[BB7:%.*]] -; IS__TUNIT_NPM: bb5: -; IS__TUNIT_NPM-NEXT: br label [[BB9:%.*]] -; IS__TUNIT_NPM: bb7: -; IS__TUNIT_NPM-NEXT: br label [[BB9]] -; IS__TUNIT_NPM: bb9: -; IS__TUNIT_NPM-NEXT: br label [[BB12:%.*]] -; IS__TUNIT_NPM: bb11: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: bb12: -; IS__TUNIT_NPM-NEXT: br label [[BB13:%.*]] -; IS__TUNIT_NPM: bb13: -; IS__TUNIT_NPM-NEXT: ret i1 false -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@phi -; IS__CGSCC_OPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[ARG]], 5 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP]], label [[BB1:%.*]], label [[BB2:%.*]] -; IS__CGSCC_OPM: bb1: -; IS__CGSCC_OPM-NEXT: br label [[BB3:%.*]] -; IS__CGSCC_OPM: bb2: -; IS__CGSCC_OPM-NEXT: br label [[BB3]] -; IS__CGSCC_OPM: bb3: -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = icmp sgt i32 [[ARG]], 10 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP4]], label [[BB5:%.*]], label [[BB7:%.*]] -; IS__CGSCC_OPM: bb5: -; IS__CGSCC_OPM-NEXT: br label [[BB9:%.*]] -; IS__CGSCC_OPM: bb7: -; IS__CGSCC_OPM-NEXT: br label [[BB9]] -; IS__CGSCC_OPM: bb9: -; IS__CGSCC_OPM-NEXT: br label [[BB12:%.*]] -; IS__CGSCC_OPM: bb11: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: bb12: -; IS__CGSCC_OPM-NEXT: br label [[BB13:%.*]] -; IS__CGSCC_OPM: bb13: -; IS__CGSCC_OPM-NEXT: ret i1 false -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@phi -; IS__CGSCC_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[ARG]], 5 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP]], label [[BB1:%.*]], label [[BB2:%.*]] -; IS__CGSCC_NPM: bb1: -; IS__CGSCC_NPM-NEXT: br label [[BB3:%.*]] -; IS__CGSCC_NPM: bb2: -; IS__CGSCC_NPM-NEXT: br label [[BB3]] -; IS__CGSCC_NPM: bb3: -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = icmp sgt i32 [[ARG]], 10 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP4]], label [[BB5:%.*]], label [[BB7:%.*]] -; IS__CGSCC_NPM: bb5: -; IS__CGSCC_NPM-NEXT: br label [[BB9:%.*]] -; IS__CGSCC_NPM: bb7: -; IS__CGSCC_NPM-NEXT: br label [[BB9]] -; IS__CGSCC_NPM: bb9: -; IS__CGSCC_NPM-NEXT: br label [[BB12:%.*]] -; IS__CGSCC_NPM: bb11: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: bb12: -; IS__CGSCC_NPM-NEXT: br label [[BB13:%.*]] -; IS__CGSCC_NPM: bb13: -; IS__CGSCC_NPM-NEXT: ret i1 false +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@phi +; IS__TUNIT____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; IS__TUNIT____-NEXT: bb: +; IS__TUNIT____-NEXT: [[TMP:%.*]] = icmp sgt i32 [[ARG]], 5 +; IS__TUNIT____-NEXT: br i1 [[TMP]], label [[BB1:%.*]], label [[BB2:%.*]] +; IS__TUNIT____: bb1: +; IS__TUNIT____-NEXT: br label [[BB3:%.*]] +; IS__TUNIT____: bb2: +; IS__TUNIT____-NEXT: br label [[BB3]] +; IS__TUNIT____: bb3: +; IS__TUNIT____-NEXT: [[TMP4:%.*]] = icmp sgt i32 [[ARG]], 10 +; IS__TUNIT____-NEXT: br i1 [[TMP4]], label [[BB5:%.*]], label [[BB7:%.*]] +; IS__TUNIT____: bb5: +; IS__TUNIT____-NEXT: br label [[BB9:%.*]] +; IS__TUNIT____: bb7: +; IS__TUNIT____-NEXT: br label [[BB9]] +; IS__TUNIT____: bb9: +; IS__TUNIT____-NEXT: br label [[BB12:%.*]] +; IS__TUNIT____: bb11: +; IS__TUNIT____-NEXT: unreachable +; IS__TUNIT____: bb12: +; IS__TUNIT____-NEXT: br label [[BB13:%.*]] +; IS__TUNIT____: bb13: +; IS__TUNIT____-NEXT: ret i1 false +; +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@phi +; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: bb: +; IS__CGSCC____-NEXT: [[TMP:%.*]] = icmp sgt i32 [[ARG]], 5 +; IS__CGSCC____-NEXT: br i1 [[TMP]], label [[BB1:%.*]], label [[BB2:%.*]] +; IS__CGSCC____: bb1: +; IS__CGSCC____-NEXT: br label [[BB3:%.*]] +; IS__CGSCC____: bb2: +; IS__CGSCC____-NEXT: br label [[BB3]] +; IS__CGSCC____: bb3: +; IS__CGSCC____-NEXT: [[TMP4:%.*]] = icmp sgt i32 [[ARG]], 10 +; IS__CGSCC____-NEXT: br i1 [[TMP4]], label [[BB5:%.*]], label [[BB7:%.*]] +; IS__CGSCC____: bb5: +; IS__CGSCC____-NEXT: br label [[BB9:%.*]] +; IS__CGSCC____: bb7: +; IS__CGSCC____-NEXT: br label [[BB9]] +; IS__CGSCC____: bb9: +; IS__CGSCC____-NEXT: br label [[BB12:%.*]] +; IS__CGSCC____: bb11: +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: bb12: +; IS__CGSCC____-NEXT: br label [[BB13:%.*]] +; IS__CGSCC____: bb13: +; IS__CGSCC____-NEXT: ret i1 false ; bb: %tmp = icmp sgt i32 %arg, 5 @@ -1076,29 +983,17 @@ } define dso_local i1 @select(i32 %a) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@select -; IS__TUNIT_OPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: ret i1 false -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@select -; IS__TUNIT_NPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: ret i1 false -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@select -; IS__CGSCC_OPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: ret i1 false +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@select +; IS__TUNIT____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: ret i1 false ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@select -; IS__CGSCC_NPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: ret i1 false +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@select +; IS__CGSCC____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: ret i1 false ; entry: %cmp = icmp sgt i32 %a, 5 @@ -1111,29 +1006,17 @@ } define dso_local i32 @select_zext(i32 %a) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@select_zext -; IS__TUNIT_OPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: ret i32 0 -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@select_zext -; IS__TUNIT_NPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: ret i32 0 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@select_zext -; IS__CGSCC_OPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: ret i32 0 +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@select_zext +; IS__TUNIT____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: ret i32 0 ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@select_zext -; IS__CGSCC_NPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: ret i32 0 +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@select_zext +; IS__CGSCC____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: ret i32 0 ; entry: %cmp = icmp sgt i32 %a, 5 @@ -1148,41 +1031,23 @@ ; FIXME: We do not look through the ptr casts here. define dso_local i64 @select_int2ptr_bitcast_ptr2int(i32 %a) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@select_int2ptr_bitcast_ptr2int -; IS__TUNIT_OPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[I2P:%.*]] = inttoptr i1 false to i1* -; IS__TUNIT_OPM-NEXT: [[BC:%.*]] = bitcast i1* [[I2P]] to i32* -; IS__TUNIT_OPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[BC]] to i64 -; IS__TUNIT_OPM-NEXT: ret i64 [[P2I]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@select_int2ptr_bitcast_ptr2int -; IS__TUNIT_NPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[I2P:%.*]] = inttoptr i1 false to i1* -; IS__TUNIT_NPM-NEXT: [[BC:%.*]] = bitcast i1* [[I2P]] to i32* -; IS__TUNIT_NPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[BC]] to i64 -; IS__TUNIT_NPM-NEXT: ret i64 [[P2I]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@select_int2ptr_bitcast_ptr2int -; IS__CGSCC_OPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[I2P:%.*]] = inttoptr i1 false to i1* -; IS__CGSCC_OPM-NEXT: [[BC:%.*]] = bitcast i1* [[I2P]] to i32* -; IS__CGSCC_OPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[BC]] to i64 -; IS__CGSCC_OPM-NEXT: ret i64 [[P2I]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@select_int2ptr_bitcast_ptr2int -; IS__CGSCC_NPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[I2P:%.*]] = inttoptr i1 false to i1* -; IS__CGSCC_NPM-NEXT: [[BC:%.*]] = bitcast i1* [[I2P]] to i32* -; IS__CGSCC_NPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[BC]] to i64 -; IS__CGSCC_NPM-NEXT: ret i64 [[P2I]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@select_int2ptr_bitcast_ptr2int +; IS__TUNIT____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[I2P:%.*]] = inttoptr i1 false to i1* +; IS__TUNIT____-NEXT: [[BC:%.*]] = bitcast i1* [[I2P]] to i32* +; IS__TUNIT____-NEXT: [[P2I:%.*]] = ptrtoint i32* [[BC]] to i64 +; IS__TUNIT____-NEXT: ret i64 [[P2I]] +; +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@select_int2ptr_bitcast_ptr2int +; IS__CGSCC____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[I2P:%.*]] = inttoptr i1 false to i1* +; IS__CGSCC____-NEXT: [[BC:%.*]] = bitcast i1* [[I2P]] to i32* +; IS__CGSCC____-NEXT: [[P2I:%.*]] = ptrtoint i32* [[BC]] to i64 +; IS__CGSCC____-NEXT: ret i64 [[P2I]] ; entry: %cmp = icmp sgt i32 %a, 5 @@ -1200,165 +1065,97 @@ ; } define i1 @f_fcmp(float %a, float %b) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@f_fcmp -; IS__TUNIT_OPM-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: [[R:%.*]] = fcmp uge float [[A]], [[B]] -; IS__TUNIT_OPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__TUNIT_OPM-NEXT: ret i1 [[S]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f_fcmp -; IS__TUNIT_NPM-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: [[R:%.*]] = fcmp uge float [[A]], [[B]] -; IS__TUNIT_NPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__TUNIT_NPM-NEXT: ret i1 [[S]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f_fcmp -; IS__CGSCC_OPM-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[R:%.*]] = fcmp uge float [[A]], [[B]] -; IS__CGSCC_OPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__CGSCC_OPM-NEXT: ret i1 [[S]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f_fcmp -; IS__CGSCC_NPM-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[R:%.*]] = fcmp uge float [[A]], [[B]] -; IS__CGSCC_NPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__CGSCC_NPM-NEXT: ret i1 [[S]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@f_fcmp +; IS__TUNIT____-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR1]] { +; IS__TUNIT____-NEXT: [[R:%.*]] = fcmp uge float [[A]], [[B]] +; IS__TUNIT____-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; IS__TUNIT____-NEXT: ret i1 [[S]] +; +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@f_fcmp +; IS__CGSCC____-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: [[R:%.*]] = fcmp uge float [[A]], [[B]] +; IS__CGSCC____-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; IS__CGSCC____-NEXT: ret i1 [[S]] ; %r = fcmp uge float %a, %b %s = select i1 %r, i1 %r, i1 0 ret i1 %s } define i1 @d_fcmp(double %a, double %b) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@d_fcmp -; IS__TUNIT_OPM-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: [[R:%.*]] = fcmp oeq double [[A]], [[B]] -; IS__TUNIT_OPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__TUNIT_OPM-NEXT: ret i1 [[S]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@d_fcmp -; IS__TUNIT_NPM-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: [[R:%.*]] = fcmp oeq double [[A]], [[B]] -; IS__TUNIT_NPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__TUNIT_NPM-NEXT: ret i1 [[S]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@d_fcmp -; IS__CGSCC_OPM-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[R:%.*]] = fcmp oeq double [[A]], [[B]] -; IS__CGSCC_OPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__CGSCC_OPM-NEXT: ret i1 [[S]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@d_fcmp -; IS__CGSCC_NPM-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[R:%.*]] = fcmp oeq double [[A]], [[B]] -; IS__CGSCC_NPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__CGSCC_NPM-NEXT: ret i1 [[S]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@d_fcmp +; IS__TUNIT____-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR1]] { +; IS__TUNIT____-NEXT: [[R:%.*]] = fcmp oeq double [[A]], [[B]] +; IS__TUNIT____-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; IS__TUNIT____-NEXT: ret i1 [[S]] +; +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@d_fcmp +; IS__CGSCC____-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: [[R:%.*]] = fcmp oeq double [[A]], [[B]] +; IS__CGSCC____-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; IS__CGSCC____-NEXT: ret i1 [[S]] ; %r = fcmp oeq double %a, %b %s = select i1 %r, i1 %r, i1 0 ret i1 %s } define i1 @dp_icmp(double* %a, double* %b) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@dp_icmp -; IS__TUNIT_OPM-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone [[B:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: [[R:%.*]] = icmp sge double* [[A]], [[B]] -; IS__TUNIT_OPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__TUNIT_OPM-NEXT: ret i1 [[S]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@dp_icmp -; IS__TUNIT_NPM-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone [[B:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: [[R:%.*]] = icmp sge double* [[A]], [[B]] -; IS__TUNIT_NPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__TUNIT_NPM-NEXT: ret i1 [[S]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@dp_icmp -; IS__CGSCC_OPM-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone [[B:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[R:%.*]] = icmp sge double* [[A]], [[B]] -; IS__CGSCC_OPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__CGSCC_OPM-NEXT: ret i1 [[S]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@dp_icmp -; IS__CGSCC_NPM-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone [[B:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[R:%.*]] = icmp sge double* [[A]], [[B]] -; IS__CGSCC_NPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__CGSCC_NPM-NEXT: ret i1 [[S]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@dp_icmp +; IS__TUNIT____-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone [[B:%.*]]) #[[ATTR1]] { +; IS__TUNIT____-NEXT: [[R:%.*]] = icmp sge double* [[A]], [[B]] +; IS__TUNIT____-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; IS__TUNIT____-NEXT: ret i1 [[S]] +; +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@dp_icmp +; IS__CGSCC____-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone [[B:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: [[R:%.*]] = icmp sge double* [[A]], [[B]] +; IS__CGSCC____-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; IS__CGSCC____-NEXT: ret i1 [[S]] ; %r = icmp sge double* %a, %b %s = select i1 %r, i1 %r, i1 0 ret i1 %s } define i1 @ip_icmp(i8* %a, i8* %b) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@ip_icmp -; IS__TUNIT_OPM-SAME: (i8* nofree readnone [[A:%.*]], i8* nofree readnone [[B:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: [[R:%.*]] = icmp ult i8* [[A]], [[B]] -; IS__TUNIT_OPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__TUNIT_OPM-NEXT: ret i1 [[S]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@ip_icmp -; IS__TUNIT_NPM-SAME: (i8* nofree readnone [[A:%.*]], i8* nofree readnone [[B:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: [[R:%.*]] = icmp ult i8* [[A]], [[B]] -; IS__TUNIT_NPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__TUNIT_NPM-NEXT: ret i1 [[S]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ip_icmp -; IS__CGSCC_OPM-SAME: (i8* nofree readnone [[A:%.*]], i8* nofree readnone [[B:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[R:%.*]] = icmp ult i8* [[A]], [[B]] -; IS__CGSCC_OPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__CGSCC_OPM-NEXT: ret i1 [[S]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ip_icmp -; IS__CGSCC_NPM-SAME: (i8* nofree readnone [[A:%.*]], i8* nofree readnone [[B:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[R:%.*]] = icmp ult i8* [[A]], [[B]] -; IS__CGSCC_NPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__CGSCC_NPM-NEXT: ret i1 [[S]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@ip_icmp +; IS__TUNIT____-SAME: (i8* nofree readnone [[A:%.*]], i8* nofree readnone [[B:%.*]]) #[[ATTR1]] { +; IS__TUNIT____-NEXT: [[R:%.*]] = icmp ult i8* [[A]], [[B]] +; IS__TUNIT____-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; IS__TUNIT____-NEXT: ret i1 [[S]] +; +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@ip_icmp +; IS__CGSCC____-SAME: (i8* nofree readnone [[A:%.*]], i8* nofree readnone [[B:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: [[R:%.*]] = icmp ult i8* [[A]], [[B]] +; IS__CGSCC____-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; IS__CGSCC____-NEXT: ret i1 [[S]] ; %r = icmp ult i8* %a, %b %s = select i1 %r, i1 %r, i1 0 ret i1 %s } define i1 @fcmp_caller(float %fa, float %fb, double %da, double %db, double* %dpa, double* %dpb, i8* %ipa, i8* %ipb) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fcmp_caller -; IS__TUNIT_OPM-SAME: (float [[FA:%.*]], float [[FB:%.*]], double [[DA:%.*]], double [[DB:%.*]], double* nofree readnone [[DPA:%.*]], double* nofree readnone [[DPB:%.*]], i8* nofree readnone [[IPA:%.*]], i8* nofree readnone [[IPB:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR2]] -; IS__TUNIT_OPM-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR2]] -; IS__TUNIT_OPM-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR2]] -; IS__TUNIT_OPM-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR2]] -; IS__TUNIT_OPM-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] -; IS__TUNIT_OPM-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] -; IS__TUNIT_OPM-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] -; IS__TUNIT_OPM-NEXT: ret i1 [[O3]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fcmp_caller -; IS__TUNIT_NPM-SAME: (float [[FA:%.*]], float [[FB:%.*]], double [[DA:%.*]], double [[DB:%.*]], double* nofree readnone [[DPA:%.*]], double* nofree readnone [[DPB:%.*]], i8* nofree readnone [[IPA:%.*]], i8* nofree readnone [[IPB:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR1]] -; IS__TUNIT_NPM-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR1]] -; IS__TUNIT_NPM-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR1]] -; IS__TUNIT_NPM-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR1]] -; IS__TUNIT_NPM-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] -; IS__TUNIT_NPM-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] -; IS__TUNIT_NPM-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] -; IS__TUNIT_NPM-NEXT: ret i1 [[O3]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@fcmp_caller +; IS__TUNIT____-SAME: (float [[FA:%.*]], float [[FB:%.*]], double [[DA:%.*]], double [[DB:%.*]], double* nofree readnone [[DPA:%.*]], double* nofree readnone [[DPB:%.*]], i8* nofree readnone [[IPA:%.*]], i8* nofree readnone [[IPB:%.*]]) #[[ATTR1]] { +; IS__TUNIT____-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR1]] +; IS__TUNIT____-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR1]] +; IS__TUNIT____-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR1]] +; IS__TUNIT____-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR1]] +; IS__TUNIT____-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] +; IS__TUNIT____-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] +; IS__TUNIT____-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] +; IS__TUNIT____-NEXT: ret i1 [[O3]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fcmp_caller -; IS__CGSCC_OPM-SAME: (float [[FA:%.*]], float [[FB:%.*]], double [[DA:%.*]], double [[DB:%.*]], double* nofree readnone [[DPA:%.*]], double* nofree readnone [[DPB:%.*]], i8* nofree readnone [[IPA:%.*]], i8* nofree readnone [[IPB:%.*]]) #[[ATTR2]] { +; IS__CGSCC_OPM-SAME: (float [[FA:%.*]], float [[FB:%.*]], double [[DA:%.*]], double [[DB:%.*]], double* nofree readnone [[DPA:%.*]], double* nofree readnone [[DPB:%.*]], i8* nofree readnone [[IPA:%.*]], i8* nofree readnone [[IPB:%.*]]) #[[ATTR1]] { ; IS__CGSCC_OPM-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR5]] ; IS__CGSCC_OPM-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR5]] ; IS__CGSCC_OPM-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR5]] @@ -1391,73 +1188,43 @@ } define i8 @ret_two() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@ret_two -; IS__TUNIT_OPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: ret i8 2 +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_two +; IS__TUNIT____-SAME: () #[[ATTR1]] { +; IS__TUNIT____-NEXT: ret i8 2 ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@ret_two -; IS__TUNIT_NPM-SAME: () #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: ret i8 2 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ret_two -; IS__CGSCC_OPM-SAME: () #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: ret i8 2 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ret_two -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i8 2 +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_two +; IS__CGSCC____-SAME: () #[[ATTR1]] { +; IS__CGSCC____-NEXT: ret i8 2 ; ret i8 2 } define i8 @ret_undef() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@ret_undef -; IS__TUNIT_OPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: ret i8 undef -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@ret_undef -; IS__TUNIT_NPM-SAME: () #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: ret i8 undef -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ret_undef -; IS__CGSCC_OPM-SAME: () #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: ret i8 undef +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_undef +; IS__TUNIT____-SAME: () #[[ATTR1]] { +; IS__TUNIT____-NEXT: ret i8 undef ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ret_undef -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i8 undef +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_undef +; IS__CGSCC____-SAME: () #[[ATTR1]] { +; IS__CGSCC____-NEXT: ret i8 undef ; ret i8 undef } ; Verify we collapse undef to a value and return something non-undef here. define i8 @undef_collapse_1() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@undef_collapse_1 -; IS__TUNIT_OPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: ret i8 0 +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@undef_collapse_1 +; IS__TUNIT____-SAME: () #[[ATTR1]] { +; IS__TUNIT____-NEXT: ret i8 0 ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@undef_collapse_1 -; IS__TUNIT_NPM-SAME: () #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: ret i8 0 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@undef_collapse_1 -; IS__CGSCC_OPM-SAME: () #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: ret i8 0 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@undef_collapse_1 -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i8 0 +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@undef_collapse_1 +; IS__CGSCC____-SAME: () #[[ATTR1]] { +; IS__CGSCC____-NEXT: ret i8 0 ; %c = call i8 @ret_undef() %s = shl i8 %c, 2 @@ -1466,25 +1233,15 @@ ; Verify we collapse undef to a value and return something non-undef here. define i8 @undef_collapse_2() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@undef_collapse_2 -; IS__TUNIT_OPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: ret i8 0 +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@undef_collapse_2 +; IS__TUNIT____-SAME: () #[[ATTR1]] { +; IS__TUNIT____-NEXT: ret i8 0 ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@undef_collapse_2 -; IS__TUNIT_NPM-SAME: () #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: ret i8 0 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@undef_collapse_2 -; IS__CGSCC_OPM-SAME: () #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: ret i8 0 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@undef_collapse_2 -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i8 0 +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@undef_collapse_2 +; IS__CGSCC____-SAME: () #[[ATTR1]] { +; IS__CGSCC____-NEXT: ret i8 0 ; %c = call i8 @ret_two() %s = shl i8 undef, %c @@ -1493,25 +1250,15 @@ define i8 @undef_collapse_caller() { ; -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@undef_collapse_caller -; IS__TUNIT_OPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: ret i8 0 -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@undef_collapse_caller -; IS__TUNIT_NPM-SAME: () #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: ret i8 0 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@undef_collapse_caller -; IS__CGSCC_OPM-SAME: () #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: ret i8 0 +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@undef_collapse_caller +; IS__TUNIT____-SAME: () #[[ATTR1]] { +; IS__TUNIT____-NEXT: ret i8 0 ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@undef_collapse_caller -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i8 0 +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@undef_collapse_caller +; IS__CGSCC____-SAME: () #[[ATTR1]] { +; IS__CGSCC____-NEXT: ret i8 0 ; %c1 = call i8 @undef_collapse_1() %c2 = call i8 @undef_collapse_2() @@ -1520,54 +1267,32 @@ } define i32 @ret1or2(i1 %c) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@ret1or2 -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: [[S:%.*]] = select i1 [[C]], i32 1, i32 2 -; IS__TUNIT_OPM-NEXT: ret i32 [[S]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@ret1or2 -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: [[S:%.*]] = select i1 [[C]], i32 1, i32 2 -; IS__TUNIT_NPM-NEXT: ret i32 [[S]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ret1or2 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[S:%.*]] = select i1 [[C]], i32 1, i32 2 -; IS__CGSCC_OPM-NEXT: ret i32 [[S]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ret1or2 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[S:%.*]] = select i1 [[C]], i32 1, i32 2 -; IS__CGSCC_NPM-NEXT: ret i32 [[S]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@ret1or2 +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; IS__TUNIT____-NEXT: [[S:%.*]] = select i1 [[C]], i32 1, i32 2 +; IS__TUNIT____-NEXT: ret i32 [[S]] +; +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@ret1or2 +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: [[S:%.*]] = select i1 [[C]], i32 1, i32 2 +; IS__CGSCC____-NEXT: ret i32 [[S]] ; %s = select i1 %c, i32 1, i32 2 ret i32 %s } define i1 @callee_range_1(i1 %c1, i1 %c2, i1 %c3) { ; -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callee_range_1 -; IS__TUNIT_OPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: ret i1 true -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee_range_1 -; IS__TUNIT_NPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: ret i1 true +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@callee_range_1 +; IS__TUNIT____-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR1]] { +; IS__TUNIT____-NEXT: ret i1 true ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callee_range_1 -; IS__CGSCC_OPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: ret i1 true -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee_range_1 -; IS__CGSCC_NPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i1 true +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@callee_range_1 +; IS__CGSCC____-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: ret i1 true ; %r1 = call i32 @ret1or2(i1 %c1) %r2 = call i32 @ret1or2(i1 %c2) @@ -1583,9 +1308,9 @@ ; ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callee_range_2 -; IS__TUNIT_OPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR2]], !range [[RNG4:![0-9]+]] -; IS__TUNIT_OPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR2]], !range [[RNG4]] +; IS__TUNIT_OPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR1]] { +; IS__TUNIT_OPM-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR1]], !range [[RNG4:![0-9]+]] +; IS__TUNIT_OPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR1]], !range [[RNG4]] ; IS__TUNIT_OPM-NEXT: [[A:%.*]] = add i32 [[R1]], [[R2]] ; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 3 ; IS__TUNIT_OPM-NEXT: [[F:%.*]] = and i1 [[I1]], true @@ -1603,7 +1328,7 @@ ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callee_range_2 -; IS__CGSCC_OPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR2]] { +; IS__CGSCC_OPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR1]] { ; IS__CGSCC_OPM-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR5]], !range [[RNG5:![0-9]+]] ; IS__CGSCC_OPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR5]], !range [[RNG5]] ; IS__CGSCC_OPM-NEXT: [[A:%.*]] = add i32 [[R1]], [[R2]] @@ -1632,25 +1357,15 @@ define i32 @ret100() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@ret100 -; IS__TUNIT_OPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: ret i32 100 -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@ret100 -; IS__TUNIT_NPM-SAME: () #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: ret i32 100 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ret100 -; IS__CGSCC_OPM-SAME: () #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: ret i32 100 +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@ret100 +; IS__TUNIT____-SAME: () #[[ATTR1]] { +; IS__TUNIT____-NEXT: ret i32 100 ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ret100 -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i32 100 +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@ret100 +; IS__CGSCC____-SAME: () #[[ATTR1]] { +; IS__CGSCC____-NEXT: ret i32 100 ; ret i32 100 } @@ -1659,7 +1374,7 @@ ; ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@ctx_adjustment -; IS__TUNIT_OPM-SAME: (i32 [[V:%.*]]) #[[ATTR2]] { +; IS__TUNIT_OPM-SAME: (i32 [[V:%.*]]) #[[ATTR1]] { ; IS__TUNIT_OPM-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 ; IS__TUNIT_OPM-NEXT: br i1 [[C1]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] ; IS__TUNIT_OPM: if.true: @@ -1685,7 +1400,7 @@ ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ctx_adjustment -; IS__CGSCC_OPM-SAME: (i32 [[V:%.*]]) #[[ATTR2]] { +; IS__CGSCC_OPM-SAME: (i32 [[V:%.*]]) #[[ATTR1]] { ; IS__CGSCC_OPM-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 ; IS__CGSCC_OPM-NEXT: br i1 [[C1]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] ; IS__CGSCC_OPM: if.true: @@ -1724,29 +1439,17 @@ define i32 @func(i1 %c) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@func -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = select i1 [[C]], i32 0, i32 1 -; IS__TUNIT_OPM-NEXT: ret i32 [[RET]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@func -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: [[RET:%.*]] = select i1 [[C]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: ret i32 [[RET]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@func -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = select i1 [[C]], i32 0, i32 1 -; IS__CGSCC_OPM-NEXT: ret i32 [[RET]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@func -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = select i1 [[C]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: ret i32 [[RET]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@func +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; IS__TUNIT____-NEXT: [[RET:%.*]] = select i1 [[C]], i32 0, i32 1 +; IS__TUNIT____-NEXT: ret i32 [[RET]] +; +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@func +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: [[RET:%.*]] = select i1 [[C]], i32 0, i32 1 +; IS__CGSCC____-NEXT: ret i32 [[RET]] ; %ret = select i1 %c, i32 0, i32 1 ret i32 %ret @@ -1755,14 +1458,14 @@ define i32 @simplify_callsite_argument(i1 %d) { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@simplify_callsite_argument -; IS__TUNIT_OPM-SAME: (i1 [[D:%.*]]) #[[ATTR2]] { +; IS__TUNIT_OPM-SAME: (i1 [[D:%.*]]) #[[ATTR1]] { ; IS__TUNIT_OPM-NEXT: [[C:%.*]] = select i1 [[D]], i1 true, i1 false ; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT_OPM: t: -; IS__TUNIT_OPM-NEXT: [[RET1:%.*]] = call i32 @func(i1 noundef [[C]]) #[[ATTR2]], !range [[RNG3]] +; IS__TUNIT_OPM-NEXT: [[RET1:%.*]] = call i32 @func(i1 noundef [[C]]) #[[ATTR1]], !range [[RNG3]] ; IS__TUNIT_OPM-NEXT: ret i32 [[RET1]] ; IS__TUNIT_OPM: f: -; IS__TUNIT_OPM-NEXT: [[RET2:%.*]] = call i32 @func(i1 noundef false) #[[ATTR2]], !range [[RNG3]] +; IS__TUNIT_OPM-NEXT: [[RET2:%.*]] = call i32 @func(i1 noundef false) #[[ATTR1]], !range [[RNG3]] ; IS__TUNIT_OPM-NEXT: ret i32 [[RET2]] ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn @@ -1779,7 +1482,7 @@ ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@simplify_callsite_argument -; IS__CGSCC_OPM-SAME: (i1 [[D:%.*]]) #[[ATTR2]] { +; IS__CGSCC_OPM-SAME: (i1 [[D:%.*]]) #[[ATTR1]] { ; IS__CGSCC_OPM-NEXT: [[C:%.*]] = select i1 [[D]], i1 true, i1 false ; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__CGSCC_OPM: t: @@ -1812,35 +1515,12 @@ } define internal i32 @less_than_65536(i32 %arg) { -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@less_than_65536 -; IS__CGSCC_OPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[SHRINKED:%.*]] = udiv i32 [[ARG]], 65536 -; IS__CGSCC_OPM-NEXT: ret i32 [[SHRINKED]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@less_than_65536 -; IS__CGSCC_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[SHRINKED:%.*]] = udiv i32 [[ARG]], 65536 -; IS__CGSCC_NPM-NEXT: ret i32 [[SHRINKED]] ; %shrinked = udiv i32 %arg, 65536 ret i32 %shrinked } define internal i1 @is_less_than_65536(i32 %arg) { -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@is_less_than_65536 -; IS__CGSCC_OPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp ult i32 [[ARG]], 65536 -; IS__CGSCC_OPM-NEXT: ret i1 true -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@is_less_than_65536 -; IS__CGSCC_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp ult i32 [[ARG]], 65536 -; IS__CGSCC_NPM-NEXT: ret i1 true -; %cmp = icmp ult i32 %arg, 65536 ret i1 %cmp } @@ -1848,19 +1528,6 @@ define i1 @check_divided_range(i32 %arg) { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@check_divided_range -; IS__TUNIT_OPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: ret i1 true -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@check_divided_range -; IS__TUNIT_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: ret i1 true -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@check_divided_range -; IS__CGSCC_OPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: ret i1 true -; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@check_divided_range ; IS__CGSCC_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { @@ -1875,35 +1542,12 @@ } define internal i32 @cast_and_return(i1 %c) { -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@cast_and_return -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = zext i1 [[C]] to i32 -; IS__CGSCC_OPM-NEXT: ret i32 [[RET]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@cast_and_return -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = zext i1 [[C]] to i32 -; IS__CGSCC_NPM-NEXT: ret i32 [[RET]] ; %ret = zext i1 %c to i32 ret i32 %ret } define internal i1 @is_less_than_3(i32 %c) { -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@is_less_than_3 -; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[C]], 3 -; IS__CGSCC_OPM-NEXT: ret i1 true -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@is_less_than_3 -; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[C]], 3 -; IS__CGSCC_NPM-NEXT: ret i1 true -; %cmp = icmp slt i32 %c, 3 ret i1 %cmp } @@ -1911,23 +1555,15 @@ define i1 @check_casted_range(i1 %c) { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@check_casted_range -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: ret i1 true -; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@check_casted_range ; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { ; IS__TUNIT_NPM-NEXT: ret i1 true ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@check_casted_range -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: ret i1 true -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@check_casted_range -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i1 true +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@check_casted_range +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: ret i1 true ; %csret1 = call i32 @cast_and_return(i1 true) %csret2 = call i32 @cast_and_return(i1 %c) @@ -1937,63 +1573,34 @@ } define internal i32 @less_than_100_1(i32 %c) { -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@less_than_100_1 -; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ -; IS__CGSCC_OPM-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__CGSCC_OPM-NEXT: i32 1, label [[ONONE:%.*]] -; IS__CGSCC_OPM-NEXT: i32 2, label [[ONTWO:%.*]] -; IS__CGSCC_OPM-NEXT: i32 3, label [[ONTHREE:%.*]] -; IS__CGSCC_OPM-NEXT: i32 4, label [[ONFOUR:%.*]] -; IS__CGSCC_OPM-NEXT: i32 5, label [[ONFIVE:%.*]] -; IS__CGSCC_OPM-NEXT: i32 6, label [[ONSIX:%.*]] -; IS__CGSCC_OPM-NEXT: ] -; IS__CGSCC_OPM: onzero: -; IS__CGSCC_OPM-NEXT: ret i32 undef -; IS__CGSCC_OPM: onone: -; IS__CGSCC_OPM-NEXT: ret i32 undef -; IS__CGSCC_OPM: ontwo: -; IS__CGSCC_OPM-NEXT: ret i32 undef -; IS__CGSCC_OPM: onthree: -; IS__CGSCC_OPM-NEXT: ret i32 undef -; IS__CGSCC_OPM: onfour: -; IS__CGSCC_OPM-NEXT: ret i32 undef -; IS__CGSCC_OPM: onfive: -; IS__CGSCC_OPM-NEXT: ret i32 undef -; IS__CGSCC_OPM: onsix: -; IS__CGSCC_OPM-NEXT: ret i32 undef -; IS__CGSCC_OPM: otherwise: -; IS__CGSCC_OPM-NEXT: ret i32 undef -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@less_than_100_1 -; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ -; IS__CGSCC_NPM-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__CGSCC_NPM-NEXT: i32 1, label [[ONONE:%.*]] -; IS__CGSCC_NPM-NEXT: i32 2, label [[ONTWO:%.*]] -; IS__CGSCC_NPM-NEXT: i32 3, label [[ONTHREE:%.*]] -; IS__CGSCC_NPM-NEXT: i32 4, label [[ONFOUR:%.*]] -; IS__CGSCC_NPM-NEXT: i32 5, label [[ONFIVE:%.*]] -; IS__CGSCC_NPM-NEXT: i32 6, label [[ONSIX:%.*]] -; IS__CGSCC_NPM-NEXT: ] -; IS__CGSCC_NPM: onzero: -; IS__CGSCC_NPM-NEXT: ret i32 undef -; IS__CGSCC_NPM: onone: -; IS__CGSCC_NPM-NEXT: ret i32 undef -; IS__CGSCC_NPM: ontwo: -; IS__CGSCC_NPM-NEXT: ret i32 undef -; IS__CGSCC_NPM: onthree: -; IS__CGSCC_NPM-NEXT: ret i32 undef -; IS__CGSCC_NPM: onfour: -; IS__CGSCC_NPM-NEXT: ret i32 undef -; IS__CGSCC_NPM: onfive: -; IS__CGSCC_NPM-NEXT: ret i32 undef -; IS__CGSCC_NPM: onsix: -; IS__CGSCC_NPM-NEXT: ret i32 undef -; IS__CGSCC_NPM: otherwise: -; IS__CGSCC_NPM-NEXT: ret i32 undef +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@less_than_100_1 +; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ +; IS__CGSCC____-NEXT: i32 0, label [[ONZERO:%.*]] +; IS__CGSCC____-NEXT: i32 1, label [[ONONE:%.*]] +; IS__CGSCC____-NEXT: i32 2, label [[ONTWO:%.*]] +; IS__CGSCC____-NEXT: i32 3, label [[ONTHREE:%.*]] +; IS__CGSCC____-NEXT: i32 4, label [[ONFOUR:%.*]] +; IS__CGSCC____-NEXT: i32 5, label [[ONFIVE:%.*]] +; IS__CGSCC____-NEXT: i32 6, label [[ONSIX:%.*]] +; IS__CGSCC____-NEXT: ] +; IS__CGSCC____: onzero: +; IS__CGSCC____-NEXT: ret i32 undef +; IS__CGSCC____: onone: +; IS__CGSCC____-NEXT: ret i32 undef +; IS__CGSCC____: ontwo: +; IS__CGSCC____-NEXT: ret i32 undef +; IS__CGSCC____: onthree: +; IS__CGSCC____-NEXT: ret i32 undef +; IS__CGSCC____: onfour: +; IS__CGSCC____-NEXT: ret i32 undef +; IS__CGSCC____: onfive: +; IS__CGSCC____-NEXT: ret i32 undef +; IS__CGSCC____: onsix: +; IS__CGSCC____-NEXT: ret i32 undef +; IS__CGSCC____: otherwise: +; IS__CGSCC____-NEXT: ret i32 undef ; switch i32 %c, label %otherwise [ i32 0, label %onzero i32 1, label %onone @@ -2021,40 +1628,25 @@ } define internal i1 @is_less_than_100_1(i32 %c) { -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@is_less_than_100_1 -; IS__CGSCC_OPM-SAME: () #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: ret i1 undef -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@is_less_than_100_1 -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i1 undef +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@is_less_than_100_1 +; IS__CGSCC____-SAME: () #[[ATTR1]] { +; IS__CGSCC____-NEXT: ret i1 undef ; %cmp = icmp slt i32 %c, 100 ret i1 %cmp } define i1 @propagate_range1(i32 %c){ -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@propagate_range1 -; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: ret i1 true +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@propagate_range1 +; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; IS__TUNIT____-NEXT: ret i1 true ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@propagate_range1 -; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: ret i1 true -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@propagate_range1 -; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: ret i1 true -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@propagate_range1 -; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i1 true +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@propagate_range1 +; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: ret i1 true ; %csret = call i32 @less_than_100_1(i32 %c) %true = call i1 @is_less_than_100_1(i32 %csret) @@ -2062,63 +1654,6 @@ } define internal i32 @less_than_100_2(i32 %c) { -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@less_than_100_2 -; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ -; IS__CGSCC_OPM-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__CGSCC_OPM-NEXT: i32 1, label [[ONONE:%.*]] -; IS__CGSCC_OPM-NEXT: i32 2, label [[ONTWO:%.*]] -; IS__CGSCC_OPM-NEXT: i32 3, label [[ONTHREE:%.*]] -; IS__CGSCC_OPM-NEXT: i32 4, label [[ONFOUR:%.*]] -; IS__CGSCC_OPM-NEXT: i32 5, label [[ONFIVE:%.*]] -; IS__CGSCC_OPM-NEXT: i32 6, label [[ONSIX:%.*]] -; IS__CGSCC_OPM-NEXT: ] -; IS__CGSCC_OPM: onzero: -; IS__CGSCC_OPM-NEXT: ret i32 0 -; IS__CGSCC_OPM: onone: -; IS__CGSCC_OPM-NEXT: ret i32 1 -; IS__CGSCC_OPM: ontwo: -; IS__CGSCC_OPM-NEXT: ret i32 2 -; IS__CGSCC_OPM: onthree: -; IS__CGSCC_OPM-NEXT: ret i32 3 -; IS__CGSCC_OPM: onfour: -; IS__CGSCC_OPM-NEXT: ret i32 4 -; IS__CGSCC_OPM: onfive: -; IS__CGSCC_OPM-NEXT: ret i32 5 -; IS__CGSCC_OPM: onsix: -; IS__CGSCC_OPM-NEXT: ret i32 6 -; IS__CGSCC_OPM: otherwise: -; IS__CGSCC_OPM-NEXT: ret i32 99 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@less_than_100_2 -; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ -; IS__CGSCC_NPM-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__CGSCC_NPM-NEXT: i32 1, label [[ONONE:%.*]] -; IS__CGSCC_NPM-NEXT: i32 2, label [[ONTWO:%.*]] -; IS__CGSCC_NPM-NEXT: i32 3, label [[ONTHREE:%.*]] -; IS__CGSCC_NPM-NEXT: i32 4, label [[ONFOUR:%.*]] -; IS__CGSCC_NPM-NEXT: i32 5, label [[ONFIVE:%.*]] -; IS__CGSCC_NPM-NEXT: i32 6, label [[ONSIX:%.*]] -; IS__CGSCC_NPM-NEXT: ] -; IS__CGSCC_NPM: onzero: -; IS__CGSCC_NPM-NEXT: ret i32 0 -; IS__CGSCC_NPM: onone: -; IS__CGSCC_NPM-NEXT: ret i32 1 -; IS__CGSCC_NPM: ontwo: -; IS__CGSCC_NPM-NEXT: ret i32 2 -; IS__CGSCC_NPM: onthree: -; IS__CGSCC_NPM-NEXT: ret i32 3 -; IS__CGSCC_NPM: onfour: -; IS__CGSCC_NPM-NEXT: ret i32 4 -; IS__CGSCC_NPM: onfive: -; IS__CGSCC_NPM-NEXT: ret i32 5 -; IS__CGSCC_NPM: onsix: -; IS__CGSCC_NPM-NEXT: ret i32 6 -; IS__CGSCC_NPM: otherwise: -; IS__CGSCC_NPM-NEXT: ret i32 99 ; switch i32 %c, label %otherwise [ i32 0, label %onzero i32 1, label %onone @@ -2146,17 +1681,6 @@ } define internal i1 @is_less_than_100_2(i32 %c) { -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@is_less_than_100_2 -; IS__CGSCC_OPM-SAME: (i32 noundef [[C:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[C]], 100 -; IS__CGSCC_OPM-NEXT: ret i1 true -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@is_less_than_100_2 -; IS__CGSCC_NPM-SAME: (i32 noundef [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[C]], 100 -; IS__CGSCC_NPM-NEXT: ret i1 true ; %cmp = icmp slt i32 %c, 100 ret i1 %cmp @@ -2165,23 +1689,15 @@ define i1 @propagate_range2(i32 %c) { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@propagate_range2 -; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: ret i1 true -; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@propagate_range2 ; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { ; IS__TUNIT_NPM-NEXT: ret i1 true ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@propagate_range2 -; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: ret i1 true -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@propagate_range2 -; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i1 true +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@propagate_range2 +; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: ret i1 true ; %csret1 = call i32 @less_than_100_2(i32 0) %true1 = call i1 @is_less_than_100_2(i32 %csret1) @@ -2194,7 +1710,7 @@ define internal i1 @non_zero(i8 %v) { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@non_zero -; IS__TUNIT_OPM-SAME: (i8 [[V:%.*]]) #[[ATTR2]] { +; IS__TUNIT_OPM-SAME: (i8 [[V:%.*]]) #[[ATTR1]] { ; IS__TUNIT_OPM-NEXT: [[R:%.*]] = icmp ne i8 [[V]], 0 ; IS__TUNIT_OPM-NEXT: ret i1 [[R]] ; @@ -2206,7 +1722,7 @@ ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@non_zero -; IS__CGSCC_OPM-SAME: (i8 [[V:%.*]]) #[[ATTR2]] { +; IS__CGSCC_OPM-SAME: (i8 [[V:%.*]]) #[[ATTR1]] { ; IS__CGSCC_OPM-NEXT: [[R:%.*]] = icmp ne i8 [[V]], 0 ; IS__CGSCC_OPM-NEXT: ret i1 [[R]] ; @@ -2229,7 +1745,7 @@ ; IS__TUNIT_OPM-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] ; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT_OPM: t: -; IS__TUNIT_OPM-NEXT: [[R:%.*]] = call i1 @non_zero(i8 [[L]]) #[[ATTR2]] +; IS__TUNIT_OPM-NEXT: [[R:%.*]] = call i1 @non_zero(i8 [[L]]) #[[ATTR1]] ; IS__TUNIT_OPM-NEXT: ret i1 [[R]] ; IS__TUNIT_OPM: f: ; IS__TUNIT_OPM-NEXT: ret i1 false @@ -2352,8 +1868,8 @@ !1 = !{i32 10, i32 100} ;. ; IS__TUNIT_OPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone } -; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } ; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind readonly willreturn } ;. ; IS__TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } @@ -2361,8 +1877,8 @@ ; IS__TUNIT_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readonly willreturn } ;. ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone } ; IS__CGSCC_OPM: attributes #[[ATTR3]] = { readonly willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nounwind readnone } ; IS__CGSCC_OPM: attributes #[[ATTR5]] = { readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/value-simplify.ll b/llvm/test/Transforms/Attributor/value-simplify.ll --- a/llvm/test/Transforms/Attributor/value-simplify.ll +++ b/llvm/test/Transforms/Attributor/value-simplify.ll @@ -388,9 +388,9 @@ } define i32 @ipccp4(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp4 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] { +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { ; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT____: t: ; IS__TUNIT____-NEXT: br label [[F]] @@ -504,7 +504,7 @@ ; ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_sret -; IS__TUNIT____-SAME: (%struct.X* noalias nofree noundef nonnull writeonly sret([[STRUCT_X:%.*]]) align 536870912 dereferenceable(8) [[A:%.*]], %struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR3:[0-9]+]] { +; IS__TUNIT____-SAME: (%struct.X* noalias nofree noundef nonnull writeonly sret([[STRUCT_X:%.*]]) align 536870912 dereferenceable(8) [[A:%.*]], %struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR2:[0-9]+]] { ; IS__TUNIT____-NEXT: store %struct.X* [[A]], %struct.X** [[B]], align 8 ; IS__TUNIT____-NEXT: ret void ; @@ -522,14 +522,14 @@ ; ; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_sret -; IS__TUNIT_OPM-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly sret([[STRUCT_X:%.*]]) align 536870912 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) #[[ATTR6:[0-9]+]] +; IS__TUNIT_OPM-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) #[[ATTR2]] { +; IS__TUNIT_OPM-NEXT: call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly sret([[STRUCT_X:%.*]]) align 536870912 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) #[[ATTR5:[0-9]+]] ; IS__TUNIT_OPM-NEXT: ret void ; ; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_sret -; IS__TUNIT_NPM-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) #[[ATTR3]] { -; IS__TUNIT_NPM-NEXT: call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly sret([[STRUCT_X:%.*]]) align 536870912 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) #[[ATTR5:[0-9]+]] +; IS__TUNIT_NPM-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) #[[ATTR2]] { +; IS__TUNIT_NPM-NEXT: call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly sret([[STRUCT_X:%.*]]) align 536870912 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) #[[ATTR4:[0-9]+]] ; IS__TUNIT_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly @@ -623,7 +623,7 @@ define internal i8*@test_byval2(%struct.X* byval(%struct.X) %a) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_byval2 -; IS__TUNIT____-SAME: () #[[ATTR4:[0-9]+]] { +; IS__TUNIT____-SAME: () #[[ATTR3:[0-9]+]] { ; IS__TUNIT____-NEXT: [[L:%.*]] = load i8*, i8** getelementptr inbounds ([[STRUCT_X:%.*]], %struct.X* @S, i32 0, i32 0), align 8 ; IS__TUNIT____-NEXT: ret i8* [[L]] ; @@ -638,10 +638,11 @@ ret i8* %l } define i8* @complicated_args_byval2() { +; ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@complicated_args_byval2 -; IS__TUNIT____-SAME: () #[[ATTR4]] { -; IS__TUNIT____-NEXT: [[C:%.*]] = call i8* @test_byval2() #[[ATTR4]] +; IS__TUNIT____-SAME: () #[[ATTR3]] { +; IS__TUNIT____-NEXT: [[C:%.*]] = call i8* @test_byval2() #[[ATTR3]] ; IS__TUNIT____-NEXT: ret i8* [[C]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn @@ -663,7 +664,7 @@ define void @fixpoint_changed(i32* %p) { ; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind writeonly ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fixpoint_changed -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR5:[0-9]+]] { +; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR4:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] ; IS__TUNIT_OPM: for.cond: @@ -686,7 +687,7 @@ ; ; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fixpoint_changed -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR3]] { +; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR2]] { ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] ; IS__TUNIT_NPM: for.cond: @@ -877,13 +878,13 @@ define void @user_as3() { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@user_as3 -; IS__TUNIT_OPM-SAME: () #[[ATTR6]] { +; IS__TUNIT_OPM-SAME: () #[[ATTR5]] { ; IS__TUNIT_OPM-NEXT: store i32 0, i32 addrspace(3)* @ConstAS3Ptr, align 4 ; IS__TUNIT_OPM-NEXT: ret void ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@user_as3 -; IS__TUNIT_NPM-SAME: () #[[ATTR5]] { +; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { ; IS__TUNIT_NPM-NEXT: store i32 0, i32 addrspace(3)* @ConstAS3Ptr, align 4 ; IS__TUNIT_NPM-NEXT: ret void ; @@ -906,13 +907,13 @@ define void @user() { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@user -; IS__TUNIT_OPM-SAME: () #[[ATTR6]] { +; IS__TUNIT_OPM-SAME: () #[[ATTR5]] { ; IS__TUNIT_OPM-NEXT: store i32 0, i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*), align 4 ; IS__TUNIT_OPM-NEXT: ret void ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@user -; IS__TUNIT_NPM-SAME: () #[[ATTR5]] { +; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { ; IS__TUNIT_NPM-NEXT: store i32 0, i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*), align 4 ; IS__TUNIT_NPM-NEXT: ret void ; @@ -935,11 +936,17 @@ define i1 @test_merge_with_undef_values_ptr(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: [[R1:%.*]] = call i1 @undef_then_null(i1 [[C]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: ret i1 [[R1]] +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr +; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR6:[0-9]+]] { +; IS__TUNIT_OPM-NEXT: [[R1:%.*]] = call i1 @undef_then_null(i1 [[C]]) #[[ATTR6]] +; IS__TUNIT_OPM-NEXT: ret i1 [[R1]] +; +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr +; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR5:[0-9]+]] { +; IS__TUNIT_NPM-NEXT: [[R1:%.*]] = call i1 @undef_then_null(i1 [[C]]) #[[ATTR5]] +; IS__TUNIT_NPM-NEXT: ret i1 [[R1]] ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr @@ -950,18 +957,31 @@ ret i1 %r1 } define internal i1 @undef_then_null(i1 %c, i32* %i32Aptr, i32* %i32Bptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@undef_then_null -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: [[CMP1:%.*]] = icmp eq i32* null, null -; IS__TUNIT____-NEXT: [[CMP2:%.*]] = icmp eq i1 [[CMP1]], false -; IS__TUNIT____-NEXT: [[OR:%.*]] = or i1 [[CMP2]], [[C]] -; IS__TUNIT____-NEXT: br i1 [[OR]], label [[A:%.*]], label [[B:%.*]] -; IS__TUNIT____: a: -; IS__TUNIT____-NEXT: [[R2:%.*]] = call i1 @undef_then_null(i1 noundef false) #[[ATTR2]] -; IS__TUNIT____-NEXT: ret i1 [[R2]] -; IS__TUNIT____: b: -; IS__TUNIT____-NEXT: ret i1 [[CMP2]] +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@undef_then_null +; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR6]] { +; IS__TUNIT_OPM-NEXT: [[CMP1:%.*]] = icmp eq i32* null, null +; IS__TUNIT_OPM-NEXT: [[CMP2:%.*]] = icmp eq i1 [[CMP1]], false +; IS__TUNIT_OPM-NEXT: [[OR:%.*]] = or i1 [[CMP2]], [[C]] +; IS__TUNIT_OPM-NEXT: br i1 [[OR]], label [[A:%.*]], label [[B:%.*]] +; IS__TUNIT_OPM: a: +; IS__TUNIT_OPM-NEXT: [[R2:%.*]] = call i1 @undef_then_null(i1 noundef false) #[[ATTR6]] +; IS__TUNIT_OPM-NEXT: ret i1 [[R2]] +; IS__TUNIT_OPM: b: +; IS__TUNIT_OPM-NEXT: ret i1 [[CMP2]] +; +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@undef_then_null +; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR5]] { +; IS__TUNIT_NPM-NEXT: [[CMP1:%.*]] = icmp eq i32* null, null +; IS__TUNIT_NPM-NEXT: [[CMP2:%.*]] = icmp eq i1 [[CMP1]], false +; IS__TUNIT_NPM-NEXT: [[OR:%.*]] = or i1 [[CMP2]], [[C]] +; IS__TUNIT_NPM-NEXT: br i1 [[OR]], label [[A:%.*]], label [[B:%.*]] +; IS__TUNIT_NPM: a: +; IS__TUNIT_NPM-NEXT: [[R2:%.*]] = call i1 @undef_then_null(i1 noundef false) #[[ATTR5]] +; IS__TUNIT_NPM-NEXT: ret i1 [[R2]] +; IS__TUNIT_NPM: b: +; IS__TUNIT_NPM-NEXT: ret i1 [[CMP2]] ; ; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@undef_then_null @@ -1001,10 +1021,9 @@ } define i1 @test_merge_with_undef_values(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_merge_with_undef_values -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: [[R1:%.*]] = call noundef i1 @undef_then_1(i1 [[C]]) #[[ATTR2]] +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { ; IS__TUNIT____-NEXT: ret i1 false ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn @@ -1016,38 +1035,15 @@ ret i1 %r1 } define internal i1 @undef_then_1(i1 %c, i32 %i32A, i32 %i32B) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@undef_then_1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: [[OR:%.*]] = or i1 false, [[C]] -; IS__TUNIT____-NEXT: br i1 [[OR]], label [[A:%.*]], label [[B:%.*]] -; IS__TUNIT____: a: -; IS__TUNIT____-NEXT: [[R2:%.*]] = call noundef i1 @undef_then_1(i1 noundef false) #[[ATTR2]] -; IS__TUNIT____-NEXT: ret i1 false -; IS__TUNIT____: b: -; IS__TUNIT____-NEXT: ret i1 false -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@undef_then_1 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR6]] { -; IS__CGSCC_OPM-NEXT: [[OR:%.*]] = or i1 false, [[C]] -; IS__CGSCC_OPM-NEXT: br i1 [[OR]], label [[A:%.*]], label [[B:%.*]] -; IS__CGSCC_OPM: a: -; IS__CGSCC_OPM-NEXT: [[R2:%.*]] = call noundef i1 @undef_then_1(i1 noundef false) #[[ATTR11]] -; IS__CGSCC_OPM-NEXT: ret i1 undef -; IS__CGSCC_OPM: b: -; IS__CGSCC_OPM-NEXT: ret i1 undef -; -; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@undef_then_1 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR5]] { -; IS__CGSCC_NPM-NEXT: [[OR:%.*]] = or i1 false, [[C]] -; IS__CGSCC_NPM-NEXT: br i1 [[OR]], label [[A:%.*]], label [[B:%.*]] -; IS__CGSCC_NPM: a: -; IS__CGSCC_NPM-NEXT: [[R2:%.*]] = call noundef i1 @undef_then_1(i1 noundef false) #[[ATTR10]] -; IS__CGSCC_NPM-NEXT: ret i1 undef -; IS__CGSCC_NPM: b: -; IS__CGSCC_NPM-NEXT: ret i1 undef +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@undef_then_1 +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: [[OR:%.*]] = or i1 false, [[C]] +; IS__CGSCC____-NEXT: br i1 [[OR]], label [[A:%.*]], label [[B:%.*]] +; IS__CGSCC____: a: +; IS__CGSCC____-NEXT: ret i1 undef +; IS__CGSCC____: b: +; IS__CGSCC____-NEXT: ret i1 undef ; %cmp1 = icmp eq i32 %i32A, %i32B %cmp2 = icmp eq i1 %cmp1, false @@ -1110,7 +1106,7 @@ ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_callee_is_undef ; IS__TUNIT____-SAME: (void (i32)* nocapture nofree [[FN:%.*]]) { ; IS__TUNIT____-NEXT: call void @callee_is_undef() -; IS__TUNIT____-NEXT: call void @unknown_calle_arg_is_undef(void (i32)* nocapture nofree [[FN]], i32 undef) +; IS__TUNIT____-NEXT: call void @unknown_calle_arg_is_undef(void (i32)* nocapture nofree [[FN]]) ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____-LABEL: define {{[^@]+}}@test_callee_is_undef @@ -1128,7 +1124,7 @@ ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____-LABEL: define {{[^@]+}}@callee_is_undef -; IS__CGSCC____-SAME: (void ()* noalias nocapture nofree noundef nonnull [[FN:%.*]]) { +; IS__CGSCC____-SAME: (void ()* nocapture nofree noundef nonnull [[FN:%.*]]) { ; IS__CGSCC____-NEXT: call void [[FN]]() ; IS__CGSCC____-NEXT: ret void ; @@ -1137,15 +1133,10 @@ } define internal void @unknown_calle_arg_is_undef(void (i32)* %fn, i32 %arg) { ; -; IS__TUNIT____-LABEL: define {{[^@]+}}@unknown_calle_arg_is_undef -; IS__TUNIT____-SAME: (void (i32)* nocapture nofree noundef nonnull [[FN:%.*]], i32 [[ARG:%.*]]) { -; IS__TUNIT____-NEXT: call void [[FN]](i32 undef) -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____-LABEL: define {{[^@]+}}@unknown_calle_arg_is_undef -; IS__CGSCC____-SAME: (void (i32)* nocapture nofree noundef nonnull [[FN:%.*]]) { -; IS__CGSCC____-NEXT: call void [[FN]](i32 undef) -; IS__CGSCC____-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@unknown_calle_arg_is_undef +; CHECK-SAME: (void (i32)* nocapture nofree noundef nonnull [[FN:%.*]]) { +; CHECK-NEXT: call void [[FN]](i32 undef) +; CHECK-NEXT: ret void ; call void %fn(i32 %arg) ret void @@ -1159,7 +1150,7 @@ define internal void @f1(i8*** %a) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@f1 -; IS__TUNIT____-SAME: (i8*** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR3]] { +; IS__TUNIT____-SAME: (i8*** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR2]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[X:%.*]] = getelementptr { [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0 ; IS__TUNIT____-NEXT: store i8** [[X]], i8*** [[A]], align 8 @@ -1257,19 +1248,19 @@ ;. ; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } ; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } -; IS__TUNIT_OPM: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind writeonly } +; IS__TUNIT_OPM: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes #[[ATTR6]] = { nofree nosync nounwind readnone } ; IS__TUNIT_OPM: attributes #[[ATTR7]] = { willreturn } ;. ; IS__TUNIT_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } ; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } -; IS__TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_NPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_NPM: attributes #[[ATTR5]] = { nofree nosync nounwind readnone } ; IS__TUNIT_NPM: attributes #[[ATTR6]] = { willreturn } ;. ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn }