diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h --- a/llvm/include/llvm/Transforms/IPO/Attributor.h +++ b/llvm/include/llvm/Transforms/IPO/Attributor.h @@ -904,7 +904,7 @@ [&](const Function &F) { return AG.getAnalysis(F); }), - AG(AG), CGSCC(CGSCC), TargetTriple(M.getTargetTriple()) { + AG(AG), TargetTriple(M.getTargetTriple()) { if (CGSCC) initializeModuleSlice(*CGSCC); } @@ -1021,13 +1021,6 @@ return AG.getAnalysis(F); } - /// Return SCC size on call graph for function \p F or 0 if unknown. - unsigned getSccSize(const Function &F) { - if (CGSCC && CGSCC->count(const_cast(&F))) - return CGSCC->size(); - return 0; - } - /// Return datalayout used in the module. const DataLayout &getDL() { return DL; } @@ -1117,9 +1110,6 @@ /// Getters for analysis. AnalysisGetter &AG; - /// The underlying CGSCC, or null if not available. - SetVector *CGSCC; - /// Set of inlineable functions SmallPtrSet InlineableFunctions; @@ -4636,7 +4626,7 @@ Attributor &A); /// See AbstractAttribute::getName() - const std::string getName() const override { return "AAFuncitonReacability"; } + const std::string getName() const override { return "AAFunctionReachability"; } /// See AbstractAttribute::getIdAddr() const char *getIdAddr() const override { return &ID; } 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 @@ -2443,16 +2443,6 @@ AANoRecurseFunction(const IRPosition &IRP, Attributor &A) : AANoRecurseImpl(IRP, A) {} - /// See AbstractAttribute::initialize(...). - void initialize(Attributor &A) override { - AANoRecurseImpl::initialize(A); - // TODO: We should build a call graph ourselves to enable this in the module - // pass as well. - if (const Function *F = getAnchorScope()) - if (A.getInfoCache().getSccSize(*F) != 1) - indicatePessimisticFixpoint(); - } - /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { @@ -2475,27 +2465,10 @@ return ChangeStatus::UNCHANGED; } - // If the above check does not hold anymore we look at the calls. - auto CheckForNoRecurse = [&](Instruction &I) { - const auto &CB = cast(I); - if (CB.hasFnAttr(Attribute::NoRecurse)) - return true; - - const auto &NoRecurseAA = A.getAAFor( - *this, IRPosition::callsite_function(CB), DepClassTy::REQUIRED); - if (!NoRecurseAA.isAssumedNoRecurse()) - return false; - - // Recursion to the same function - if (CB.getCalledFunction() == getAnchorScope()) - return false; - - return true; - }; - - bool UsedAssumedInformation = false; - if (!A.checkForAllCallLikeInstructions(CheckForNoRecurse, *this, - UsedAssumedInformation)) + const AAFunctionReachability &EdgeReachability = + A.getAAFor(*this, getIRPosition(), + DepClassTy::REQUIRED); + if (EdgeReachability.canReach(A, getAnchorScope())) return indicatePessimisticFixpoint(); return ChangeStatus::UNCHANGED; } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll @@ -1,18 +1,18 @@ ; 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=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 -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=5 -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=5 -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 define internal i32 @deref(i32* %x) nounwind { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@deref -; IS__TUNIT_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[X]], align 4 -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP2]] +; IS________OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS________OPM-LABEL: define {{[^@]+}}@deref +; IS________OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0:[0-9]+]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[X]], align 4 +; IS________OPM-NEXT: ret i32 [[TMP2]] ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@deref ; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -21,13 +21,6 @@ ; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[X_PRIV]], align 4 ; IS__TUNIT_NPM-NEXT: ret i32 [[TMP2]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@deref -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[X]], align 4 -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP2]] -; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@deref ; IS__CGSCC_NPM-SAME: (i32 returned [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { @@ -43,16 +36,16 @@ } define i32 @f(i32 %x) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@f -; IS__TUNIT_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 -; IS__TUNIT_OPM-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = call i32 @deref(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X_ADDR]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP1]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________OPM-LABEL: define {{[^@]+}}@f +; IS________OPM-SAME: (i32 [[X:%.*]]) #[[ATTR1:[0-9]+]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 +; IS________OPM-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 +; IS________OPM-NEXT: [[TMP1:%.*]] = call i32 @deref(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X_ADDR]]) #[[ATTR2:[0-9]+]] +; IS________OPM-NEXT: ret i32 [[TMP1]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f ; IS__TUNIT_NPM-SAME: (i32 [[X:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -62,15 +55,6 @@ ; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i32 @deref(i32 [[TMP0]]) #[[ATTR2:[0-9]+]] ; IS__TUNIT_NPM-NEXT: ret i32 [[TMP1]] ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR1:[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: [[TMP1:%.*]] = call i32 @deref(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X_ADDR]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP1]] -; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f ; IS__CGSCC_NPM-SAME: (i32 returned [[X:%.*]]) #[[ATTR0]] { @@ -86,8 +70,8 @@ ret i32 %tmp1 } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind readonly willreturn } ;. ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-07-02-array-indexing.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-07-02-array-indexing.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-07-02-array-indexing.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-07-02-array-indexing.ll @@ -9,31 +9,18 @@ ; because there is a load of %A in the entry block define internal i32 @callee(i1 %C, i32* %A) { ; -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@callee -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[A_0:%.*]] = load i32, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: br label [[F:%.*]] -; IS__TUNIT____: T: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: F: -; IS__TUNIT____-NEXT: [[A_2:%.*]] = getelementptr i32, i32* [[A]], i32 2 -; IS__TUNIT____-NEXT: [[R:%.*]] = load i32, i32* [[A_2]], align 4 -; IS__TUNIT____-NEXT: ret i32 [[R]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@callee -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[A_0:%.*]] = load i32, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: br label [[F:%.*]] -; IS__CGSCC____: T: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: F: -; IS__CGSCC____-NEXT: [[A_2:%.*]] = getelementptr i32, i32* [[A]], i32 2 -; IS__CGSCC____-NEXT: [[R:%.*]] = load i32, i32* [[A_2]], align 4 -; IS__CGSCC____-NEXT: ret i32 [[R]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@callee +; CHECK-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[A_0:%.*]] = load i32, i32* [[A]], align 4 +; CHECK-NEXT: br label [[F:%.*]] +; CHECK: T: +; CHECK-NEXT: unreachable +; CHECK: F: +; CHECK-NEXT: [[A_2:%.*]] = getelementptr i32, i32* [[A]], i32 2 +; CHECK-NEXT: [[R:%.*]] = load i32, i32* [[A_2]], align 4 +; CHECK-NEXT: ret i32 [[R]] ; entry: ; Unconditonally load the element at %A @@ -51,7 +38,7 @@ } define i32 @foo(i32* %A) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@foo ; IS__TUNIT____-SAME: (i32* nocapture nofree readonly [[A:%.*]]) #[[ATTR0]] { ; IS__TUNIT____-NEXT: [[X:%.*]] = call i32 @callee(i32* nocapture nofree readonly align 4 [[A]]) #[[ATTR1:[0-9]+]] @@ -68,7 +55,7 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } ; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readonly willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-07-CGUpdate.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-07-CGUpdate.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-07-CGUpdate.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-07-CGUpdate.ll @@ -16,24 +16,16 @@ } define void @encode(i32* %m, i32* %ts, i32* %new) nounwind { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@encode -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[M:%.*]], i32* nocapture nofree readnone [[TS:%.*]], i32* nocapture nofree readnone [[NEW:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@encode -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[M:%.*]], i32* nocapture nofree readnone [[TS:%.*]], i32* nocapture nofree readnone [[NEW:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@encode +; CHECK-SAME: (i32* nocapture nofree readnone [[M:%.*]], i32* nocapture nofree readnone [[TS:%.*]], i32* nocapture nofree readnone [[NEW:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: unreachable ; entry: %0 = call fastcc i32 @hash( i32* %ts, i32 0 ) nounwind ; [#uses=0] unreachable } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll @@ -27,25 +27,15 @@ } define i32 @term_Sharing(i32* %Term) nounwind { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@term_Sharing -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[TERM:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br i1 false, label [[BB_I:%.*]], label [[BB14:%.*]] -; IS__TUNIT____: bb.i: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: bb14: -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@term_Sharing -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[TERM:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br i1 false, label [[BB_I:%.*]], label [[BB14:%.*]] -; IS__CGSCC____: bb.i: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: bb14: -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@term_Sharing +; CHECK-SAME: (i32* nocapture nofree readnone [[TERM:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: br i1 false, label [[BB_I:%.*]], label [[BB14:%.*]] +; CHECK: bb.i: +; CHECK-NEXT: unreachable +; CHECK: bb14: +; CHECK-NEXT: ret i32 0 ; entry: br i1 false, label %bb.i, label %bb14 @@ -58,7 +48,5 @@ ret i32 0 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.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=3 -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=3 -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 ; Test that we only promote arguments when the caller/callee have compatible @@ -58,7 +58,7 @@ ; IS__TUNIT_NPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind uwtable willreturn +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind uwtable willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@no_promote ; IS__CGSCC_OPM-SAME: (<4 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__CGSCC_OPM-NEXT: bb: @@ -71,7 +71,7 @@ ; IS__CGSCC_OPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 ; IS__CGSCC_OPM-NEXT: ret void ; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind uwtable willreturn +; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind uwtable willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@no_promote ; IS__CGSCC_NPM-SAME: (<4 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__CGSCC_NPM-NEXT: bb: @@ -210,7 +210,7 @@ ; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { nofree nosync nounwind willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "target-features"="+avx2" } -; IS__CGSCC____: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree nosync nounwind uwtable willreturn } +; IS__CGSCC____: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree norecurse nosync nounwind uwtable willreturn } ; IS__CGSCC____: attributes #[[ATTR2:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } ; IS__CGSCC____: attributes #[[ATTR3:[0-9]+]] = { willreturn writeonly } ; IS__CGSCC____: attributes #[[ATTR4:[0-9]+]] = { nosync nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/aggregate-promote.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/aggregate-promote.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/aggregate-promote.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/aggregate-promote.ll @@ -27,24 +27,16 @@ } define i32 @caller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 42 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 42 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@caller +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 42 ; entry: %v = call i32 @test(%T* @G) ret i32 %v } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. 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=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=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 @@ -72,17 +72,11 @@ } define i32 @callercaller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@callercaller -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: ret i32 3 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@callercaller -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: ret i32 3 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@callercaller +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4 +; CHECK-NEXT: ret i32 3 ; %B = alloca i32 store i32 2, i32* %B @@ -90,7 +84,5 @@ ret i32 %X } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. 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 @@ -9,20 +9,20 @@ ; Don't drop 'byval' on %X here. define internal i32 @f(%struct.ss* byval(%struct.ss) %b, i32* byval(i32) %X, i32 %i) nounwind { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind 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:%.*]]) #[[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 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__TUNIT_OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 -; IS__TUNIT_OPM-NEXT: store i32 0, i32* [[X]], align 4 -; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* [[X]], align 4 -; IS__TUNIT_OPM-NEXT: [[A:%.*]] = add i32 [[L]], [[TMP2]] -; IS__TUNIT_OPM-NEXT: ret i32 [[A]] +; IS________OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; IS________OPM-LABEL: define {{[^@]+}}@f +; IS________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________OPM-NEXT: entry: +; IS________OPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B]], i32 0, i32 0 +; IS________OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 +; IS________OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; IS________OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 +; IS________OPM-NEXT: store i32 0, i32* [[X]], align 4 +; IS________OPM-NEXT: [[L:%.*]] = load i32, i32* [[X]], align 4 +; IS________OPM-NEXT: [[A:%.*]] = add i32 [[L]], [[TMP2]] +; IS________OPM-NEXT: ret i32 [[A]] ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f ; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -42,19 +42,6 @@ ; IS__TUNIT_NPM-NEXT: [[A:%.*]] = add i32 [[L]], [[TMP2]] ; IS__TUNIT_NPM-NEXT: ret i32 [[A]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_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__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B]], i32 0, i32 0 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__CGSCC_OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[X]], align 4 -; IS__CGSCC_OPM-NEXT: [[L:%.*]] = load i32, i32* [[X]], align 4 -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = add i32 [[L]], [[TMP2]] -; IS__CGSCC_OPM-NEXT: ret i32 [[A]] -; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f ; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { @@ -86,7 +73,7 @@ ; Also make sure we don't drop the call zeroext attribute. define i32 @test(i32* %X) { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test ; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly [[X:%.*]]) #[[ATTR0]] { ; IS__TUNIT_OPM-NEXT: entry: @@ -97,7 +84,7 @@ ; 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]]) #[[ATTR1:[0-9]+]] ; IS__TUNIT_OPM-NEXT: ret i32 [[C]] ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test ; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readonly [[X:%.*]]) #[[ATTR0]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -145,7 +132,7 @@ ret i32 %c } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree norecurse nosync nounwind willreturn } ; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind willreturn } ;. ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.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=5 -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=5 -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-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" @@ -31,17 +31,11 @@ } define i32 @callercaller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@callercaller -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: ret i32 3 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@callercaller -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: ret i32 3 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@callercaller +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4 +; CHECK-NEXT: ret i32 3 ; %B = alloca i32 store i32 2, i32* %B @@ -50,7 +44,5 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll @@ -7,18 +7,18 @@ %struct.ss = type { i32, i64 } define internal void @f(%struct.ss* byval(%struct.ss) %b, i32* byval(i32) %X) nounwind { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind 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 writeonly 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 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__TUNIT_OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 -; IS__TUNIT_OPM-NEXT: store i32 0, i32* [[X]], align 4 -; IS__TUNIT_OPM-NEXT: ret void +; IS________OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; IS________OPM-LABEL: define {{[^@]+}}@f +; IS________OPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull byval([[STRUCT_SS:%.*]]) align 8 dereferenceable(12) [[B:%.*]], i32* noalias nocapture nofree noundef nonnull writeonly byval(i32) align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0:[0-9]+]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B]], i32 0, i32 0 +; IS________OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 +; IS________OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; IS________OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 +; IS________OPM-NEXT: store i32 0, i32* [[X]], align 4 +; IS________OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f ; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -36,17 +36,6 @@ ; IS__TUNIT_NPM-NEXT: store i32 0, i32* [[X_PRIV]], align 4 ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_OPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull byval([[STRUCT_SS:%.*]]) align 8 dereferenceable(12) [[B:%.*]], i32* noalias nocapture nofree noundef nonnull writeonly byval(i32) align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B]], i32 0, i32 0 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__CGSCC_OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[X]], align 4 -; IS__CGSCC_OPM-NEXT: ret void -; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f ; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { @@ -72,7 +61,7 @@ define i32 @test(i32* %X) { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test ; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly [[X:%.*]]) #[[ATTR0]] { ; IS__TUNIT_OPM-NEXT: entry: @@ -83,7 +72,7 @@ ; IS__TUNIT_OPM-NEXT: call void @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]]) #[[ATTR1:[0-9]+]] ; IS__TUNIT_OPM-NEXT: ret i32 0 ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test ; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readonly [[X:%.*]]) #[[ATTR0]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -129,7 +118,7 @@ ret i32 0 } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree norecurse nosync nounwind willreturn } ; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind willreturn } ;. ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll @@ -9,7 +9,7 @@ %struct.ss = type { i32, i64 } define internal i32 @f(%struct.ss* byval(%struct.ss) %b) nounwind { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind 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:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: entry: @@ -19,7 +19,7 @@ ; IS__TUNIT_OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 ; IS__TUNIT_OPM-NEXT: ret i32 [[TMP1]] ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f ; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -66,17 +66,17 @@ define internal i32 @g(%struct.ss* byval(%struct.ss) align 32 %b) nounwind { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@g -; IS__TUNIT_OPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull byval([[STRUCT_SS:%.*]]) align 32 dereferenceable(12) [[B:%.*]]) #[[ATTR0]] { -; 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 32 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__TUNIT_OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 32 -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP2]] +; IS________OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; IS________OPM-LABEL: define {{[^@]+}}@g +; IS________OPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull byval([[STRUCT_SS:%.*]]) align 32 dereferenceable(12) [[B:%.*]]) #[[ATTR0:[0-9]+]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B]], i32 0, i32 0 +; IS________OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 32 +; IS________OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; IS________OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 32 +; IS________OPM-NEXT: ret i32 [[TMP2]] ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@g ; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -91,16 +91,6 @@ ; IS__TUNIT_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 32 ; IS__TUNIT_NPM-NEXT: ret i32 [[TMP2]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@g -; IS__CGSCC_OPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull byval([[STRUCT_SS:%.*]]) align 32 dereferenceable(12) [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B]], i32 0, i32 0 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 32 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__CGSCC_OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 32 -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP2]] -; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@g ; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0]] { @@ -123,7 +113,7 @@ define i32 @main() nounwind { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@main ; IS__TUNIT_OPM-SAME: () #[[ATTR1:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: entry: @@ -136,7 +126,7 @@ ; IS__TUNIT_OPM-NEXT: [[A:%.*]] = add i32 [[C0]], [[C1]] ; IS__TUNIT_OPM-NEXT: ret i32 [[A]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@main ; IS__TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -144,15 +134,15 @@ ; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 ; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[TMP1]], align 8 ; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[S_CAST:%.*]] = bitcast %struct.ss* [[S]] to i32* -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[S_CAST]], align 8 -; IS__TUNIT_NPM-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i64 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_1]], align 8 -; IS__TUNIT_NPM-NEXT: [[C0:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]]) #[[ATTR2:[0-9]+]] ; IS__TUNIT_NPM-NEXT: [[S_CAST1:%.*]] = bitcast %struct.ss* [[S]] to i32* -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[S_CAST1]], align 32 +; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[S_CAST1]], align 8 ; IS__TUNIT_NPM-NEXT: [[S_0_12:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i64 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i64, i64* [[S_0_12]], align 32 +; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_12]], align 8 +; IS__TUNIT_NPM-NEXT: [[C0:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]]) #[[ATTR2:[0-9]+]] +; IS__TUNIT_NPM-NEXT: [[S_CAST:%.*]] = bitcast %struct.ss* [[S]] to i32* +; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[S_CAST]], align 32 +; IS__TUNIT_NPM-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i64 0, i32 1 +; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i64, i64* [[S_0_1]], align 32 ; IS__TUNIT_NPM-NEXT: [[C1:%.*]] = call i32 @g(i32 [[TMP2]], i64 [[TMP3]]) #[[ATTR2]] ; IS__TUNIT_NPM-NEXT: [[A:%.*]] = add i32 [[C0]], [[C1]] ; IS__TUNIT_NPM-NEXT: ret i32 [[A]] @@ -193,8 +183,8 @@ ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind willreturn } ;. ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/chained.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/chained.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/chained.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/chained.ll @@ -26,17 +26,11 @@ } define i32 @caller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@caller +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 0 ; entry: %x = call i32 @test(i32** @G2) @@ -44,7 +38,5 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll @@ -6,27 +6,16 @@ ; Don't promote around control flow. define internal i32 @callee(i1 %C, i32* %P) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@callee -; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: T: -; IS__TUNIT____-NEXT: ret i32 17 -; IS__TUNIT____: F: -; IS__TUNIT____-NEXT: [[X:%.*]] = load i32, i32* [[P]], align 4 -; IS__TUNIT____-NEXT: ret i32 [[X]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@callee -; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: T: -; IS__CGSCC____-NEXT: ret i32 17 -; IS__CGSCC____: F: -; IS__CGSCC____-NEXT: [[X:%.*]] = load i32, i32* [[P]], align 4 -; IS__CGSCC____-NEXT: ret i32 [[X]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@callee +; CHECK-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CHECK: T: +; CHECK-NEXT: ret i32 17 +; CHECK: F: +; CHECK-NEXT: [[X:%.*]] = load i32, i32* [[P]], align 4 +; CHECK-NEXT: ret i32 [[X]] ; entry: br i1 %C, label %T, label %F @@ -40,19 +29,12 @@ } define i32 @foo(i1 %C, i32* %P) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[X:%.*]] = call i32 @callee(i1 [[C]], i32* nocapture nofree readonly [[P]]) #[[ATTR1:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 [[X]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[X:%.*]] = call i32 @callee(i1 [[C]], i32* nocapture nofree readonly [[P]]) #[[ATTR1:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 [[X]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@foo +; CHECK-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[X:%.*]] = call i32 @callee(i1 [[C]], i32* nocapture nofree readonly [[P]]) #[[ATTR1:[0-9]+]] +; CHECK-NEXT: ret i32 [[X]] ; entry: %X = call i32 @callee(i1 %C, i32* %P) @@ -60,7 +42,7 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } ; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readonly willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly 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 @@ -27,17 +27,11 @@ } define i32 @foo() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: ret i32 17 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: ret i32 17 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@foo +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4 +; CHECK-NEXT: ret i32 17 ; %A = alloca i32 ; [#uses=2] store i32 17, i32* %A @@ -46,7 +40,5 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/crash.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/crash.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/crash.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/crash.ll @@ -9,7 +9,7 @@ ; Inlining should nuke the invoke (and any inlined calls) here even with ; argument promotion running along with it. define void @zot() personality i32 (...)* @wibble { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@zot ; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] personality i32 (...)* @wibble { ; IS__TUNIT____-NEXT: bb: @@ -24,7 +24,7 @@ ; IS__CGSCC____-LABEL: define {{[^@]+}}@zot ; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] personality i32 (...)* @wibble { ; IS__CGSCC____-NEXT: bb: -; IS__CGSCC____-NEXT: call void @hoge() #[[ATTR2:[0-9]+]] +; IS__CGSCC____-NEXT: call void @hoge() #[[ATTR3:[0-9]+]] ; IS__CGSCC____-NEXT: unreachable ; IS__CGSCC____: bb1: ; IS__CGSCC____-NEXT: unreachable @@ -45,17 +45,11 @@ } define internal void @hoge() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@hoge -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: bb: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@hoge -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: bb: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@hoge +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: bb: +; CHECK-NEXT: unreachable ; bb: %tmp = call fastcc i8* @spam(i1 (i8*)* @eggs) @@ -75,8 +69,9 @@ } define internal i1 @eggs(i8* %arg) { +; IS__CGSCC____: Function Attrs: norecurse ; IS__CGSCC____-LABEL: define {{[^@]+}}@eggs -; IS__CGSCC____-SAME: (i8* [[ARG:%.*]]) { +; IS__CGSCC____-SAME: (i8* [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__CGSCC____-NEXT: bb: ; IS__CGSCC____-NEXT: [[TMP:%.*]] = call zeroext i1 @barney() ; IS__CGSCC____-NEXT: unreachable @@ -89,7 +84,7 @@ define internal i1 @barney(i8* %arg) { ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@barney -; IS__CGSCC____-SAME: () #[[ATTR1:[0-9]+]] { +; IS__CGSCC____-SAME: () #[[ATTR2:[0-9]+]] { ; IS__CGSCC____-NEXT: bb: ; IS__CGSCC____-NEXT: ret i1 undef ; @@ -98,7 +93,7 @@ } define i32 @test_inf_promote_caller(i32 %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_inf_promote_caller ; IS__TUNIT____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__TUNIT____-NEXT: bb: @@ -106,7 +101,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@test_inf_promote_caller -; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) #[[ATTR2]] { ; IS__CGSCC____-NEXT: bb: ; IS__CGSCC____-NEXT: [[TMP:%.*]] = alloca [[S:%.*]], align 8 ; IS__CGSCC____-NEXT: [[TMP1:%.*]] = alloca [[S]], align 8 @@ -123,7 +118,7 @@ define internal i32 @test_inf_promote_callee(%S* %arg, %S* %arg1) { ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@test_inf_promote_callee -; IS__CGSCC____-SAME: () #[[ATTR1]] { +; IS__CGSCC____-SAME: () #[[ATTR2]] { ; IS__CGSCC____-NEXT: bb: ; IS__CGSCC____-NEXT: ret i32 undef ; @@ -139,11 +134,12 @@ declare i32 @wibble(...) ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__TUNIT____: attributes #[[ATTR2]] = { noreturn nounwind readnone } ;. ; 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]] = { noreturn nounwind readnone } +; IS__CGSCC____: attributes #[[ATTR1]] = { norecurse } +; IS__CGSCC____: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR3]] = { noreturn nounwind readnone } ;. 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 @@ -22,17 +22,11 @@ ;. define void @run() { ; -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@run -; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: entry: -; NOT_CGSCC_NPM-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@run -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@run +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: unreachable ; entry: tail call i8 @UseLongDoubleUnsafely(%union.u* byval(%union.u) align 16 bitcast (%struct.s* @b to %union.u*)) @@ -117,7 +111,7 @@ br label %loop } ;. -; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse noreturn nosync nounwind readnone } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll @@ -10,27 +10,16 @@ ; Argpromote + sroa should change this to passing the two integers by value. define internal i32 @f(%struct.ss* inalloca(%struct.ss) %s) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@f -; IS__TUNIT____-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS:%.*]]) align 4 dereferenceable(8) [[S:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__TUNIT____-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT____-NEXT: [[A:%.*]] = load i32, i32* [[F0]], align 4 -; IS__TUNIT____-NEXT: [[B:%.*]] = load i32, i32* [[F1]], align 4 -; IS__TUNIT____-NEXT: [[R:%.*]] = add i32 [[A]], [[B]] -; IS__TUNIT____-NEXT: ret i32 [[R]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@f -; IS__CGSCC____-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS:%.*]]) align 4 dereferenceable(8) [[S:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__CGSCC____-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__CGSCC____-NEXT: [[A:%.*]] = load i32, i32* [[F0]], align 4 -; IS__CGSCC____-NEXT: [[B:%.*]] = load i32, i32* [[F1]], align 4 -; IS__CGSCC____-NEXT: [[R:%.*]] = add i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: ret i32 [[R]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@f +; CHECK-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS:%.*]]) align 4 dereferenceable(8) [[S:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; CHECK-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; CHECK-NEXT: [[A:%.*]] = load i32, i32* [[F0]], align 4 +; CHECK-NEXT: [[B:%.*]] = load i32, i32* [[F1]], align 4 +; CHECK-NEXT: [[R:%.*]] = add i32 [[A]], [[B]] +; CHECK-NEXT: ret i32 [[R]] ; entry: %f0 = getelementptr %struct.ss, %struct.ss* %s, i32 0, i32 0 @@ -42,29 +31,17 @@ } define i32 @main() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@main -; IS__TUNIT____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[S:%.*]] = alloca inalloca [[STRUCT_SS:%.*]], align 4 -; IS__TUNIT____-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__TUNIT____-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT____-NEXT: store i32 1, i32* [[F0]], align 4 -; IS__TUNIT____-NEXT: store i32 2, i32* [[F1]], align 4 -; IS__TUNIT____-NEXT: [[R:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS]]) align 4 dereferenceable(8) [[S]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 [[R]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@main -; IS__CGSCC____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[S:%.*]] = alloca inalloca [[STRUCT_SS:%.*]], align 4 -; IS__CGSCC____-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__CGSCC____-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__CGSCC____-NEXT: store i32 1, i32* [[F0]], align 4 -; IS__CGSCC____-NEXT: store i32 2, i32* [[F1]], align 4 -; IS__CGSCC____-NEXT: [[R:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS]]) align 4 dereferenceable(8) [[S]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 [[R]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@main +; CHECK-SAME: () #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[S:%.*]] = alloca inalloca [[STRUCT_SS:%.*]], align 4 +; CHECK-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; CHECK-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; CHECK-NEXT: store i32 1, i32* [[F0]], align 4 +; CHECK-NEXT: store i32 2, i32* [[F1]], align 4 +; CHECK-NEXT: [[R:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS]]) align 4 dereferenceable(8) [[S]]) #[[ATTR2:[0-9]+]] +; CHECK-NEXT: ret i32 [[R]] ; entry: %S = alloca inalloca %struct.ss @@ -90,17 +67,11 @@ } define i32 @test() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 0 ; entry: %S = alloca inalloca %struct.ss @@ -108,8 +79,8 @@ ret i32 0 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind readonly willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/invalidation.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/invalidation.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/invalidation.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/invalidation.ll @@ -21,7 +21,7 @@ } define i32 @b() { -; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; CHECK-LABEL: define {{[^@]+}}@b ; CHECK-SAME: () #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: @@ -33,7 +33,7 @@ } define i32 @c() { -; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; CHECK-LABEL: define {{[^@]+}}@c ; CHECK-SAME: () #[[ATTR0]] { ; CHECK-NEXT: entry: @@ -46,5 +46,5 @@ ret i32 %result } ;. -; CHECK: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead.ll @@ -6,7 +6,9 @@ define internal void @dead() { -; IS__CGSCC____-LABEL: define {{[^@]+}}@dead() { +; IS__CGSCC____: Function Attrs: norecurse +; IS__CGSCC____-LABEL: define {{[^@]+}}@dead +; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { ; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @test(i32* noalias noundef align 4294967296 null) ; IS__CGSCC____-NEXT: ret void ; @@ -15,25 +17,15 @@ } define internal i32 @test(i32* %X, i32* %Y) { -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] -; IS__CGSCC_OPM: live: -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[X]], align 4 -; IS__CGSCC_OPM-NEXT: ret i32 undef -; IS__CGSCC_OPM: dead: -; IS__CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test -; IS__CGSCC_NPM-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] -; IS__CGSCC_NPM: live: -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[X]], align 4 -; IS__CGSCC_NPM-NEXT: ret i32 undef -; IS__CGSCC_NPM: dead: -; IS__CGSCC_NPM-NEXT: unreachable +; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@test +; IS__CGSCC____-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR1:[0-9]+]] { +; IS__CGSCC____-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] +; IS__CGSCC____: live: +; IS__CGSCC____-NEXT: store i32 0, i32* [[X]], align 4 +; IS__CGSCC____-NEXT: ret i32 undef +; IS__CGSCC____: dead: +; IS__CGSCC____-NEXT: unreachable ; br i1 true, label %live, label %dead live: @@ -46,19 +38,12 @@ } define internal i32 @caller(i32* %B) { -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller -; IS__CGSCC_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR3:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 undef -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller -; IS__CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 undef +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@caller +; IS__CGSCC____-SAME: () #[[ATTR2:[0-9]+]] { +; IS__CGSCC____-NEXT: [[A:%.*]] = alloca i32, align 4 +; IS__CGSCC____-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR3:[0-9]+]] +; IS__CGSCC____-NEXT: ret i32 undef ; %A = alloca i32 store i32 1, i32* %A @@ -67,23 +52,17 @@ } define i32 @callercaller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@callercaller ; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { ; IS__TUNIT____-NEXT: [[B:%.*]] = alloca i32, align 4 ; IS__TUNIT____-NEXT: ret i32 0 ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callercaller -; IS__CGSCC_OPM-SAME: () #[[ATTR2:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: ret i32 0 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callercaller -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: ret i32 0 +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@callercaller +; IS__CGSCC____-SAME: () #[[ATTR2]] { +; IS__CGSCC____-NEXT: [[B:%.*]] = alloca i32, align 4 +; IS__CGSCC____-NEXT: ret i32 0 ; %B = alloca i32 store i32 2, i32* %B @@ -92,14 +71,10 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR0]] = { norecurse } +; IS__CGSCC____: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn writeonly } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll @@ -6,7 +6,9 @@ define internal void @dead() { -; IS__CGSCC____-LABEL: define {{[^@]+}}@dead() { +; IS__CGSCC____: Function Attrs: norecurse +; IS__CGSCC____-LABEL: define {{[^@]+}}@dead +; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { ; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @test(i32* noalias noundef align 4294967296 null) ; IS__CGSCC____-NEXT: ret void ; @@ -15,25 +17,25 @@ } define internal i32 @test(i32* %X, i32* %Y) { -; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test -; NOT_CGSCC_NPM-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] -; NOT_CGSCC_NPM: live: -; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[X]], align 4 -; NOT_CGSCC_NPM-NEXT: ret i32 undef -; NOT_CGSCC_NPM: dead: -; NOT_CGSCC_NPM-NEXT: unreachable +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS__TUNIT____-LABEL: define {{[^@]+}}@test +; IS__TUNIT____-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { +; IS__TUNIT____-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] +; IS__TUNIT____: live: +; IS__TUNIT____-NEXT: store i32 0, i32* [[X]], align 4 +; IS__TUNIT____-NEXT: ret i32 undef +; IS__TUNIT____: dead: +; IS__TUNIT____-NEXT: unreachable ; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test -; IS__CGSCC_NPM-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] -; IS__CGSCC_NPM: live: -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[X]], align 4 -; IS__CGSCC_NPM-NEXT: ret i32 undef -; IS__CGSCC_NPM: dead: -; IS__CGSCC_NPM-NEXT: unreachable +; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@test +; IS__CGSCC____-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR1:[0-9]+]] { +; IS__CGSCC____-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] +; IS__CGSCC____: live: +; IS__CGSCC____-NEXT: store i32 0, i32* [[X]], align 4 +; IS__CGSCC____-NEXT: ret i32 undef +; IS__CGSCC____: dead: +; IS__CGSCC____-NEXT: unreachable ; br i1 true, label %live, label %dead live: @@ -46,19 +48,19 @@ } define internal i32 @caller(i32* %B) { -; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller -; NOT_CGSCC_NPM-SAME: (i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { -; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR2:[0-9]+]] -; NOT_CGSCC_NPM-NEXT: ret i32 undef +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS__TUNIT____-LABEL: define {{[^@]+}}@caller +; IS__TUNIT____-SAME: (i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { +; IS__TUNIT____-NEXT: [[A:%.*]] = alloca i32, align 4 +; IS__TUNIT____-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR2:[0-9]+]] +; IS__TUNIT____-NEXT: ret i32 undef ; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller -; IS__CGSCC_NPM-SAME: (i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 undef +; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@caller +; IS__CGSCC____-SAME: (i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: [[A:%.*]] = alloca i32, align 4 +; IS__CGSCC____-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR3:[0-9]+]] +; IS__CGSCC____-NEXT: ret i32 undef ; %A = alloca i32 store i32 1, i32* %A @@ -67,26 +69,19 @@ } define i32 @callercaller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@callercaller ; IS__TUNIT____-SAME: () #[[ATTR1:[0-9]+]] { ; IS__TUNIT____-NEXT: [[B:%.*]] = alloca i32, align 4 ; IS__TUNIT____-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR2]] ; IS__TUNIT____-NEXT: ret i32 0 ; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callercaller -; IS__CGSCC_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR3:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 0 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callercaller -; IS__CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR3:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 0 +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@callercaller +; IS__CGSCC____-SAME: () #[[ATTR2:[0-9]+]] { +; IS__CGSCC____-NEXT: [[B:%.*]] = alloca i32, align 4 +; IS__CGSCC____-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR4:[0-9]+]] +; IS__CGSCC____-NEXT: ret i32 0 ; %B = alloca i32 store i32 2, i32* %B @@ -95,17 +90,13 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn writeonly } ;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nounwind willreturn writeonly } -;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nounwind willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR0]] = { norecurse } +; IS__CGSCC____: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR4]] = { nounwind willreturn writeonly } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll @@ -10,25 +10,15 @@ %T = type { i32, i32, i32, i32 } define internal i32 @test(%T* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test -; IS__TUNIT____-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 -; IS__TUNIT____-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 -; IS__TUNIT____-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 -; IS__TUNIT____-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 -; IS__TUNIT____-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] -; IS__TUNIT____-NEXT: ret i32 [[V]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test -; IS__CGSCC____-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 -; IS__CGSCC____-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 -; IS__CGSCC____-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 -; IS__CGSCC____-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 -; IS__CGSCC____-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: ret i32 [[V]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@test +; CHECK-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 +; CHECK-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 +; CHECK-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 +; CHECK-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 +; CHECK-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] +; CHECK-NEXT: ret i32 [[V]] ; %a.gep = getelementptr %T, %T* %p, i64 0, i32 3 %b.gep = getelementptr %T, %T* %p, i64 0, i32 2 @@ -39,17 +29,11 @@ } define i32 @caller(%T* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller -; IS__TUNIT____-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[V:%.*]] = musttail call i32 @test(%T* nocapture nofree readonly [[P]]) #[[ATTR4:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 [[V]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller -; IS__CGSCC____-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[V:%.*]] = musttail call i32 @test(%T* nocapture nofree readonly [[P]]) #[[ATTR4:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 [[V]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@caller +; CHECK-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[V:%.*]] = musttail call i32 @test(%T* nocapture nofree readonly [[P]]) #[[ATTR4:[0-9]+]] +; CHECK-NEXT: ret i32 [[V]] ; %v = musttail call i32 @test(%T* %p) ret i32 %v @@ -58,15 +42,10 @@ ; Don't promote arguments of musttail caller define i32 @foo(%T* %p, i32 %v) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (%T* nocapture nofree readnone [[P:%.*]], i32 [[V:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (%T* nocapture nofree readnone [[P:%.*]], i32 [[V:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@foo +; CHECK-SAME: (%T* nocapture nofree readnone [[P:%.*]], i32 [[V:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: ret i32 0 ; ret i32 0 } @@ -87,15 +66,10 @@ } define i32 @caller2(%T* %g) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller2 -; IS__TUNIT____-SAME: (%T* nocapture nofree readnone [[G:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller2 -; IS__CGSCC____-SAME: (%T* nocapture nofree readnone [[G:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@caller2 +; CHECK-SAME: (%T* nocapture nofree readnone [[G:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret i32 0 ; %v = call i32 @test2(%T* %g, i32 0) ret i32 %v @@ -106,19 +80,12 @@ ; is kept as well. define i32 @bar(%T* %p, i32 %v) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: (%T* nocapture nofree nonnull writeonly dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: [[I32PTR:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 0 -; IS__TUNIT____-NEXT: store i32 [[V]], i32* [[I32PTR]], align 4 -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@bar -; IS__CGSCC____-SAME: (%T* nocapture nofree nonnull writeonly dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: [[I32PTR:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 0 -; IS__CGSCC____-NEXT: store i32 [[V]], i32* [[I32PTR]], align 4 -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@bar +; CHECK-SAME: (%T* nocapture nofree nonnull writeonly dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-NEXT: [[I32PTR:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 0 +; CHECK-NEXT: store i32 [[V]], i32* [[I32PTR]], align 4 +; CHECK-NEXT: ret i32 0 ; %i32ptr = getelementptr %T, %T* %p, i64 0, i32 0 store i32 %v, i32* %i32ptr @@ -126,27 +93,16 @@ } define internal i32 @test2b(%T* %p, i32 %p2) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2b -; IS__TUNIT____-SAME: (%T* nocapture nofree readonly [[P:%.*]], i32 [[P2:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 -; IS__TUNIT____-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 -; IS__TUNIT____-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 -; IS__TUNIT____-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 -; IS__TUNIT____-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] -; IS__TUNIT____-NEXT: [[CA:%.*]] = musttail call i32 @bar(%T* undef, i32 [[V]]) #[[ATTR5:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 [[CA]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2b -; IS__CGSCC____-SAME: (%T* nocapture nofree readonly [[P:%.*]], i32 [[P2:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 -; IS__CGSCC____-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 -; IS__CGSCC____-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 -; IS__CGSCC____-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 -; IS__CGSCC____-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: [[CA:%.*]] = musttail call i32 @bar(%T* undef, i32 [[V]]) #[[ATTR5:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 [[CA]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@test2b +; CHECK-SAME: (%T* nocapture nofree readonly [[P:%.*]], i32 [[P2:%.*]]) #[[ATTR3:[0-9]+]] { +; CHECK-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 +; CHECK-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 +; CHECK-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 +; CHECK-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 +; CHECK-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] +; CHECK-NEXT: [[CA:%.*]] = musttail call i32 @bar(%T* undef, i32 [[V]]) #[[ATTR5:[0-9]+]] +; CHECK-NEXT: ret i32 [[CA]] ; %a.gep = getelementptr %T, %T* %p, i64 0, i32 3 %b.gep = getelementptr %T, %T* %p, i64 0, i32 2 @@ -158,26 +114,20 @@ } define i32 @caller2b(%T* %g) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller2b -; IS__TUNIT____-SAME: (%T* nocapture nofree readonly [[G:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: [[V:%.*]] = call i32 @test2b(%T* nocapture nofree readonly [[G]], i32 undef) #[[ATTR6:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller2b -; IS__CGSCC____-SAME: (%T* nocapture nofree readonly [[G:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: [[V:%.*]] = call i32 @test2b(%T* nocapture nofree readonly [[G]], i32 undef) #[[ATTR6:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@caller2b +; CHECK-SAME: (%T* nocapture nofree readonly [[G:%.*]]) #[[ATTR3]] { +; CHECK-NEXT: [[V:%.*]] = call i32 @test2b(%T* nocapture nofree readonly [[G]], i32 undef) #[[ATTR6:[0-9]+]] +; CHECK-NEXT: ret i32 0 ; %v = call i32 @test2b(%T* %g, i32 0) ret i32 %v } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn } ; IS__TUNIT____: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn } ; IS__TUNIT____: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn writeonly } ; IS__TUNIT____: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/naked_functions.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/naked_functions.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/naked_functions.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/naked_functions.ll @@ -12,7 +12,9 @@ ; CHECK: @[[G:[a-zA-Z0-9_$"\\.-]+]] = common global i32 0, align 4 ;. define i32 @bar() { -; CHECK-LABEL: define {{[^@]+}}@bar() { +; CHECK: Function Attrs: norecurse +; CHECK-LABEL: define {{[^@]+}}@bar +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CALL:%.*]] = call i32 @foo(i32* noundef nonnull align 4 dereferenceable(4) @g) ; CHECK-NEXT: ret i32 [[CALL]] @@ -25,7 +27,7 @@ define internal i32 @foo(i32*) #0 { ; CHECK: Function Attrs: naked ; CHECK-LABEL: define {{[^@]+}}@foo -; CHECK-SAME: (i32* [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-SAME: (i32* [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 ; CHECK-NEXT: call void asm sideeffect "ldr r0, [r0] \0Abx lr \0A", ""() @@ -40,5 +42,6 @@ attributes #0 = { naked } ;. -; CHECK: attributes #[[ATTR0]] = { naked } +; CHECK: attributes #[[ATTR0]] = { norecurse } +; CHECK: attributes #[[ATTR1]] = { naked } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr32917.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr32917.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr32917.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr32917.ll @@ -13,13 +13,13 @@ ; CHECK: @[[A:[a-zA-Z0-9_$"\\.-]+]] = common local_unnamed_addr global i32 0, align 4 ;. define i32 @fn2() local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@fn2 ; IS__TUNIT____-SAME: () local_unnamed_addr #[[ATTR0:[0-9]+]] { ; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32, i32* @b, align 4 ; IS__TUNIT____-NEXT: [[TMP2:%.*]] = sext i32 [[TMP1]] to i64 ; IS__TUNIT____-NEXT: [[TMP3:%.*]] = inttoptr i64 [[TMP2]] to i32* -; IS__TUNIT____-NEXT: call fastcc void @fn1(i32* nocapture nofree readonly align 4 [[TMP3]]) #[[ATTR0]] +; IS__TUNIT____-NEXT: call fastcc void @fn1(i32* nocapture nofree readonly align 4 [[TMP3]]) #[[ATTR1:[0-9]+]] ; IS__TUNIT____-NEXT: ret i32 undef ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn @@ -39,21 +39,13 @@ } define internal fastcc void @fn1(i32* nocapture readonly) unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@fn1 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly align 4 [[TMP0:%.*]]) unnamed_addr #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 -1 -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS__TUNIT____-NEXT: store i32 [[TMP3]], i32* @a, align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@fn1 -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readonly align 4 [[TMP0:%.*]]) unnamed_addr #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 -1 -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS__CGSCC____-NEXT: store i32 [[TMP3]], i32* @a, align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@fn1 +; CHECK-SAME: (i32* nocapture nofree nonnull readonly align 4 [[TMP0:%.*]]) unnamed_addr #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 -1 +; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 +; CHECK-NEXT: store i32 [[TMP3]], i32* @a, align 4 +; CHECK-NEXT: ret void ; %2 = getelementptr inbounds i32, i32* %0, i64 -1 %3 = load i32, i32* %2, align 4 @@ -61,7 +53,8 @@ ret void } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn } ; IS__CGSCC____: attributes #[[ATTR1]] = { nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll @@ -14,17 +14,11 @@ %fun_t = type void (%p_t)* define void @foo() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP:%.*]] = alloca void (i16*)*, align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP:%.*]] = alloca void (i16*)*, align 8 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@foo +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: [[TMP:%.*]] = alloca void (i16*)*, align 8 +; CHECK-NEXT: ret void ; %tmp = alloca %fun_t store %fun_t @bar, %fun_t* %tmp @@ -60,11 +54,8 @@ !5 = !DIExpression() !6 = !DILocation(line: 1, column: 1, scope: !3) ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } ;. ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } 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 @@ -24,23 +24,14 @@ ; CHECK: @[[D:[a-zA-Z0-9_$"\\.-]+]] = global i8 0, align 1 ;. 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: () #[[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 -; IS__TUNIT____-NEXT: store i8 [[CONV1]], i8* @d, align 1, !tbaa [[TBAA4:![0-9]+]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@fn -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* @g, align 4, !tbaa [[TBAA0:![0-9]+]] -; IS__CGSCC____-NEXT: [[CONV1:%.*]] = trunc i32 [[TMP0]] to i8 -; IS__CGSCC____-NEXT: store i8 [[CONV1]], i8* @d, align 1, !tbaa [[TBAA4:![0-9]+]] -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@fn +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @g, align 4, !tbaa [[TBAA0:![0-9]+]] +; CHECK-NEXT: [[CONV1:%.*]] = trunc i32 [[TMP0]] to i8 +; CHECK-NEXT: store i8 [[CONV1]], i8* @d, align 1, !tbaa [[TBAA4:![0-9]+]] +; CHECK-NEXT: ret void ; entry: %0 = load i64, i64* %p2, align 8, !tbaa !1 @@ -52,27 +43,16 @@ } define i32 @main() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@main -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32**, i32*** @e, align 8, !tbaa [[TBAA5:![0-9]+]] -; 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() #[[ATTR0]] -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@main -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32**, i32*** @e, align 8, !tbaa [[TBAA5:![0-9]+]] -; IS__CGSCC____-NEXT: store i32* @g, i32** [[TMP0]], align 8, !tbaa [[TBAA5]] -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = load i32*, i32** @a, align 8, !tbaa [[TBAA5]] -; IS__CGSCC____-NEXT: store i32 1, i32* [[TMP1]], align 4, !tbaa [[TBAA0]] -; IS__CGSCC____-NEXT: call fastcc void @fn() #[[ATTR1:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@main +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[TMP0:%.*]] = load i32**, i32*** @e, align 8, !tbaa [[TBAA5:![0-9]+]] +; CHECK-NEXT: store i32* @g, i32** [[TMP0]], align 8, !tbaa [[TBAA5]] +; CHECK-NEXT: [[TMP1:%.*]] = load i32*, i32** @a, align 8, !tbaa [[TBAA5]] +; CHECK-NEXT: store i32 1, i32* [[TMP1]], align 4, !tbaa [[TBAA0]] +; CHECK-NEXT: call fastcc void @fn() #[[ATTR1:[0-9]+]] +; CHECK-NEXT: ret i32 0 ; entry: %0 = load i32**, i32*** @e, align 8, !tbaa !8 @@ -95,16 +75,17 @@ !9 = !{!"any pointer", !3, i64 0} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn } ; IS__CGSCC____: attributes #[[ATTR1]] = { nounwind willreturn } ;. -; CHECK: [[META0:![0-9]+]] = !{!1, !1, i64 0} +; CHECK: [[TBAA0]] = !{!1, !1, i64 0} ; CHECK: [[META1:![0-9]+]] = !{!"int", !2, i64 0} ; CHECK: [[META2:![0-9]+]] = !{!"omnipotent char", !3, i64 0} ; CHECK: [[META3:![0-9]+]] = !{!"Simple C/C++ TBAA"} -; CHECK: [[META4:![0-9]+]] = !{!2, !2, i64 0} -; CHECK: [[META5:![0-9]+]] = !{!6, !6, i64 0} +; CHECK: [[TBAA4]] = !{!2, !2, i64 0} +; CHECK: [[TBAA5]] = !{!6, !6, i64 0} ; CHECK: [[META6:![0-9]+]] = !{!"any pointer", !2, i64 0} ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll @@ -9,7 +9,7 @@ define internal void @add({i32, i32}* %this, i32* sret(i32) %r) { ; -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@add ; IS__TUNIT____-SAME: ({ i32, i32 }* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[THIS:%.*]], i32* noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT____-NEXT: ret void @@ -29,7 +29,7 @@ } define void @f() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@f ; IS__TUNIT____-SAME: () #[[ATTR1:[0-9]+]] { ; IS__TUNIT____-NEXT: [[R:%.*]] = alloca i32, align 4 @@ -48,8 +48,8 @@ ret void } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn writeonly } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/2008-06-09-WeakProp.ll b/llvm/test/Transforms/Attributor/IPConstantProp/2008-06-09-WeakProp.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/2008-06-09-WeakProp.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/2008-06-09-WeakProp.ll @@ -19,9 +19,9 @@ } define i32 @main() nounwind { -; CHECK: Function Attrs: nounwind +; CHECK: Function Attrs: norecurse nounwind ; CHECK-LABEL: define {{[^@]+}}@main -; CHECK-SAME: () #[[ATTR0]] { +; CHECK-SAME: () #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[R:%.*]] = call i32 @foo() #[[ATTR0]] ; CHECK-NEXT: ret i32 [[R]] @@ -33,4 +33,5 @@ ;. ; CHECK: attributes #[[ATTR0]] = { nounwind } +; CHECK: attributes #[[ATTR1]] = { norecurse nounwind } ;. 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 @@ -14,19 +14,19 @@ ; CHECK: @[[MYSTR:[a-zA-Z0-9_$"\\.-]+]] = internal global [[STRUCT_MYSTR:%.*]] zeroinitializer ;. define internal void @vfu1(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind { -; IS________OPM: Function Attrs: nounwind -; IS________OPM-LABEL: define {{[^@]+}}@vfu1 -; IS________OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) [[U:%.*]]) #[[ATTR0:[0-9]+]] { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 -; IS________OPM-NEXT: store i32 99, i32* [[TMP0]], align 4 -; IS________OPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0 -; IS________OPM-NEXT: store i8 97, i8* [[TMP1]], align 8 -; IS________OPM-NEXT: [[L:%.*]] = load i8, i8* [[TMP1]], align 8 -; IS________OPM-NEXT: call void @use(i8 [[L]]) -; IS________OPM-NEXT: br label [[RETURN:%.*]] -; IS________OPM: return: -; IS________OPM-NEXT: ret void +; IS__TUNIT_OPM: Function Attrs: nounwind +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@vfu1 +; IS__TUNIT_OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull 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* [[U]], i32 0, i32 1 +; IS__TUNIT_OPM-NEXT: store i32 99, i32* [[TMP0]], align 4 +; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0 +; IS__TUNIT_OPM-NEXT: store i8 97, i8* [[TMP1]], align 8 +; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i8, i8* [[TMP1]], align 8 +; IS__TUNIT_OPM-NEXT: call void @use(i8 [[L]]) +; IS__TUNIT_OPM-NEXT: br label [[RETURN:%.*]] +; IS__TUNIT_OPM: return: +; IS__TUNIT_OPM-NEXT: ret void ; ; IS__TUNIT_NPM: Function Attrs: nounwind ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@vfu1 @@ -47,7 +47,21 @@ ; IS__TUNIT_NPM: return: ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC_NPM: Function Attrs: nounwind +; IS__CGSCC_OPM: Function Attrs: norecurse nounwind +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@vfu1 +; IS__CGSCC_OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) [[U:%.*]]) #[[ATTR0:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 +; IS__CGSCC_OPM-NEXT: store i32 99, i32* [[TMP0]], align 4 +; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0 +; IS__CGSCC_OPM-NEXT: store i8 97, i8* [[TMP1]], align 8 +; IS__CGSCC_OPM-NEXT: [[L:%.*]] = load i8, i8* [[TMP1]], align 8 +; IS__CGSCC_OPM-NEXT: call void @use(i8 [[L]]) +; IS__CGSCC_OPM-NEXT: br label [[RETURN:%.*]] +; IS__CGSCC_OPM: return: +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: norecurse nounwind ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@vfu1 ; IS__CGSCC_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__CGSCC_NPM-NEXT: entry: @@ -78,19 +92,19 @@ } define internal i32 @vfu2(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind readonly { -; IS__TUNIT_OPM: Function Attrs: argmemonly 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:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = load i8, i8* [[TMP2]], align 8 -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = zext i8 [[TMP3]] to i32 -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = add i32 [[TMP4]], [[TMP1]] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP5]] +; IS________OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS________OPM-LABEL: define {{[^@]+}}@vfu2 +; IS________OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) [[U:%.*]]) #[[ATTR1:[0-9]+]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 +; IS________OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 +; IS________OPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0 +; IS________OPM-NEXT: [[TMP3:%.*]] = load i8, i8* [[TMP2]], align 8 +; IS________OPM-NEXT: [[TMP4:%.*]] = zext i8 [[TMP3]] to i32 +; IS________OPM-NEXT: [[TMP5:%.*]] = add i32 [[TMP4]], [[TMP1]] +; IS________OPM-NEXT: ret i32 [[TMP5]] ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@vfu2 ; IS__TUNIT_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -107,18 +121,6 @@ ; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP3]] ; IS__TUNIT_NPM-NEXT: ret i32 [[TMP7]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@vfu2 -; IS__CGSCC_OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) [[U:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = load i8, i8* [[TMP2]], align 8 -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = zext i8 [[TMP3]] to i32 -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = add i32 [[TMP4]], [[TMP1]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP5]] -; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@vfu2 ; IS__CGSCC_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1:[0-9]+]] { @@ -171,24 +173,24 @@ ; IS__TUNIT_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP2]], i32 [[TMP3]]) #[[ATTR2:[0-9]+]] ; IS__TUNIT_NPM-NEXT: ret i32 [[RESULT]] ; -; IS__CGSCC_OPM: Function Attrs: nounwind +; IS__CGSCC_OPM: Function Attrs: norecurse nounwind ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@unions ; IS__CGSCC_OPM-SAME: () #[[ATTR0]] { ; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: call void @vfu1(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) @mystr) #[[ATTR0]] -; IS__CGSCC_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR]]) align 8 dereferenceable(8) @mystr) #[[ATTR0]] +; IS__CGSCC_OPM-NEXT: call void @vfu1(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) @mystr) #[[ATTR2:[0-9]+]] +; IS__CGSCC_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR]]) align 8 dereferenceable(8) @mystr) #[[ATTR3:[0-9]+]] ; IS__CGSCC_OPM-NEXT: ret i32 [[RESULT]] ; -; IS__CGSCC_NPM: Function Attrs: nounwind +; IS__CGSCC_NPM: Function Attrs: norecurse nounwind ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@unions ; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i8, i8* getelementptr inbounds ([[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 0), align 8 -; IS__CGSCC_NPM-NEXT: call void @vfu1(i8 [[TMP0]], i32 undef) #[[ATTR0]] +; IS__CGSCC_NPM-NEXT: call void @vfu1(i8 [[TMP0]], i32 undef) #[[ATTR2:[0-9]+]] ; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i8, i8* getelementptr inbounds ([[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 0), align 8 ; IS__CGSCC_NPM-NEXT: [[MYSTR_0_12:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i64 0, i32 1 ; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[MYSTR_0_12]], align 8 -; IS__CGSCC_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP1]], i32 [[TMP2]]) #[[ATTR0]] +; IS__CGSCC_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP1]], i32 [[TMP2]]) #[[ATTR3:[0-9]+]] ; IS__CGSCC_NPM-NEXT: ret i32 [[RESULT]] ; entry: @@ -198,21 +200,21 @@ } define internal i32 @vfu2_v2(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind readonly { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@vfu2_v2 -; IS__TUNIT_OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) [[U:%.*]]) #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[Z:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 -; IS__TUNIT_OPM-NEXT: store i32 99, i32* [[Z]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = load i8, i8* [[TMP2]], align 8 -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = zext i8 [[TMP3]] to i32 -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = add i32 [[TMP4]], [[TMP1]] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP5]] +; IS________OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS________OPM-LABEL: define {{[^@]+}}@vfu2_v2 +; IS________OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) [[U:%.*]]) #[[ATTR1]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: [[Z:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 +; IS________OPM-NEXT: store i32 99, i32* [[Z]], align 4 +; IS________OPM-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 +; IS________OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 +; IS________OPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0 +; IS________OPM-NEXT: [[TMP3:%.*]] = load i8, i8* [[TMP2]], align 8 +; IS________OPM-NEXT: [[TMP4:%.*]] = zext i8 [[TMP3]] to i32 +; IS________OPM-NEXT: [[TMP5:%.*]] = add i32 [[TMP4]], [[TMP1]] +; IS________OPM-NEXT: ret i32 [[TMP5]] ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@vfu2_v2 ; IS__TUNIT_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -231,20 +233,6 @@ ; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP3]] ; IS__TUNIT_NPM-NEXT: ret i32 [[TMP7]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@vfu2_v2 -; IS__CGSCC_OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) [[U:%.*]]) #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[Z:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 -; IS__CGSCC_OPM-NEXT: store i32 99, i32* [[Z]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = load i8, i8* [[TMP2]], align 8 -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = zext i8 [[TMP3]] to i32 -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = add i32 [[TMP4]], [[TMP1]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP5]] -; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@vfu2_v2 ; IS__CGSCC_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1]] { @@ -298,19 +286,19 @@ ; IS__TUNIT_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(i8 [[TMP2]], i32 [[TMP3]]) #[[ATTR2]] ; IS__TUNIT_NPM-NEXT: ret i32 [[RESULT]] ; -; IS__CGSCC_OPM: Function Attrs: nounwind +; IS__CGSCC_OPM: Function Attrs: norecurse nounwind ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@unions_v2 ; IS__CGSCC_OPM-SAME: () #[[ATTR0]] { ; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: call void @vfu1(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) @mystr) #[[ATTR0]] -; IS__CGSCC_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR]]) align 8 dereferenceable(8) @mystr) #[[ATTR0]] +; IS__CGSCC_OPM-NEXT: call void @vfu1(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) @mystr) #[[ATTR2]] +; IS__CGSCC_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR]]) align 8 dereferenceable(8) @mystr) #[[ATTR3]] ; IS__CGSCC_OPM-NEXT: ret i32 [[RESULT]] ; -; IS__CGSCC_NPM: Function Attrs: nounwind +; IS__CGSCC_NPM: Function Attrs: norecurse nounwind ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@unions_v2 ; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { ; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: call void @vfu1(i8 noundef 0, i32 undef) #[[ATTR0]] +; IS__CGSCC_NPM-NEXT: call void @vfu1(i8 noundef 0, i32 undef) #[[ATTR2]] ; IS__CGSCC_NPM-NEXT: ret i32 99 ; entry: @@ -320,12 +308,16 @@ } ;. ; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } ; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nounwind readonly } ;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR0]] = { norecurse nounwind } ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nounwind readonly } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nounwind } +; IS__CGSCC_NPM: attributes #[[ATTR0]] = { norecurse nounwind } ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nounwind } +; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nounwind readonly } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll b/llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll @@ -9,7 +9,7 @@ define i64 @fn2() { ; -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@fn2 ; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: @@ -32,39 +32,22 @@ define i64 @fn2b(i32 %arg) { ; -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fn2b -; IS__TUNIT_OPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64 -; IS__TUNIT_OPM-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]] -; IS__TUNIT_OPM-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 [[DIV]]) #[[ATTR0]] -; IS__TUNIT_OPM-NEXT: ret i64 [[CALL2]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________OPM-LABEL: define {{[^@]+}}@fn2b +; IS________OPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64 +; IS________OPM-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]] +; IS________OPM-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 [[DIV]]) #[[ATTR1:[0-9]+]] +; IS________OPM-NEXT: ret i64 [[CALL2]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fn2b -; IS__TUNIT_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64 -; IS__TUNIT_NPM-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]] -; IS__TUNIT_NPM-NEXT: ret i64 [[DIV]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fn2b -; IS__CGSCC_OPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64 -; IS__CGSCC_OPM-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]] -; IS__CGSCC_OPM-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 [[DIV]]) #[[ATTR1:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i64 [[CALL2]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fn2b -; IS__CGSCC_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64 -; IS__CGSCC_NPM-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]] -; IS__CGSCC_NPM-NEXT: ret i64 [[DIV]] +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@fn2b +; IS________NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64 +; IS________NPM-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]] +; IS________NPM-NEXT: ret i64 [[DIV]] ; entry: %conv = sext i32 %arg to i64 @@ -74,7 +57,7 @@ } define i64 @fn2c() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@fn2c ; IS__TUNIT____-SAME: () #[[ATTR0]] { ; IS__TUNIT____-NEXT: entry: @@ -96,17 +79,11 @@ } define internal i64 @fn1(i64 %p1) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fn1 -; IS__TUNIT_OPM-SAME: (i64 returned [[P1:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: ret i64 [[P1]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fn1 -; IS__CGSCC_OPM-SAME: (i64 returned [[P1:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: ret i64 [[P1]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________OPM-LABEL: define {{[^@]+}}@fn1 +; IS________OPM-SAME: (i64 returned [[P1:%.*]]) #[[ATTR0]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: ret i64 [[P1]] ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fn1 @@ -120,10 +97,11 @@ ret i64 %cond } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +;. +; IS________NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { readnone willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll b/llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll @@ -8,7 +8,7 @@ define void @fn2(i32* %P, i1 %C) { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind +; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fn2 ; IS__TUNIT_OPM-SAME: (i32* nocapture nofree [[P:%.*]], i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: entry: @@ -24,7 +24,7 @@ ; IS__TUNIT_OPM: exit: ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fn2 ; IS__TUNIT_NPM-SAME: (i32* nocapture nofree [[P:%.*]], i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -49,7 +49,7 @@ ; IS__CGSCC_OPM: if.end: ; IS__CGSCC_OPM-NEXT: [[E_2:%.*]] = phi i32* [ [[P]], [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] ; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[E_2]], align 4 -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @fn1(i32 [[TMP0]]) +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @fn1(i32 [[TMP0]]) #[[ATTR3:[0-9]+]] ; IS__CGSCC_OPM-NEXT: store i32 [[CALL]], i32* [[P]], align 4 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND1]] ; IS__CGSCC_OPM: exit: @@ -87,17 +87,11 @@ } define internal i32 @fn1(i32 %p1) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fn1 -; IS__TUNIT_OPM-SAME: (i32 returned [[P1:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: ret i32 [[P1]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fn1 -; IS__CGSCC_OPM-SAME: (i32 returned [[P1:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: ret i32 [[P1]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________OPM-LABEL: define {{[^@]+}}@fn1 +; IS________OPM-SAME: (i32 returned [[P1:%.*]]) #[[ATTR1:[0-9]+]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: ret i32 [[P1]] ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fn1 @@ -113,7 +107,7 @@ define void @fn_no_null_opt(i32* %P, i1 %C) null_pointer_is_valid { ; -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind null_pointer_is_valid +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fn_no_null_opt ; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: entry: @@ -129,7 +123,7 @@ ; IS__TUNIT_OPM: exit: ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind null_pointer_is_valid +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fn_no_null_opt ; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i1 [[C:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -154,7 +148,7 @@ ; IS__CGSCC_OPM: if.end: ; IS__CGSCC_OPM-NEXT: [[E_2:%.*]] = phi i32* [ undef, [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] ; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* null, align 4294967296 -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @fn0(i32 [[TMP0]]) +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @fn0(i32 [[TMP0]]) #[[ATTR3]] ; IS__CGSCC_OPM-NEXT: store i32 [[CALL]], i32* [[P]], align 4 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND1]] ; IS__CGSCC_OPM: exit: @@ -192,17 +186,11 @@ } define internal i32 @fn0(i32 %p1) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fn0 -; IS__TUNIT_OPM-SAME: (i32 returned [[P1:%.*]]) #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: ret i32 [[P1]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fn0 -; IS__CGSCC_OPM-SAME: (i32 returned [[P1:%.*]]) #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: ret i32 [[P1]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________OPM-LABEL: define {{[^@]+}}@fn0 +; IS________OPM-SAME: (i32 returned [[P1:%.*]]) #[[ATTR1]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: ret i32 [[P1]] ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fn0 @@ -216,15 +204,20 @@ ret i32 %cond } ;. -; IS__TUNIT_OPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind } -; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind null_pointer_is_valid } +; IS__TUNIT_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind } +; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind null_pointer_is_valid } ; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind readnone } ;. -; IS__TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind } -; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind null_pointer_is_valid } +; IS__TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind } +; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind null_pointer_is_valid } +;. +; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind null_pointer_is_valid } +; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nounwind readnone } ;. -; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree norecurse nosync nounwind } -; IS__CGSCC____: attributes #[[ATTR1:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR2:[0-9]+]] = { nofree norecurse nosync nounwind null_pointer_is_valid } +; IS__CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind } +; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind null_pointer_is_valid } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll b/llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll @@ -10,36 +10,23 @@ declare dso_local fastcc float @bar(%struct.wobble* noalias, <8 x i32>) unnamed_addr define %struct.zot @widget(<8 x i32> %arg) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@widget -; IS__TUNIT____-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: bb: -; IS__TUNIT____-NEXT: ret [[STRUCT_ZOT:%.*]] undef -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@widget -; IS__CGSCC____-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: bb: -; IS__CGSCC____-NEXT: ret [[STRUCT_ZOT:%.*]] undef +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@widget +; CHECK-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: bb: +; CHECK-NEXT: ret [[STRUCT_ZOT:%.*]] undef ; bb: ret %struct.zot undef } define void @baz(<8 x i32> %arg) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@baz -; IS__TUNIT____-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT____-NEXT: bb: -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = extractvalue [[STRUCT_ZOT:%.*]] undef, 0, 0 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@baz -; IS__CGSCC____-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC____-NEXT: bb: -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = extractvalue [[STRUCT_ZOT:%.*]] undef, 0, 0 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@baz +; CHECK-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0]] { +; CHECK-NEXT: bb: +; CHECK-NEXT: [[TMP1:%.*]] = extractvalue [[STRUCT_ZOT:%.*]] undef, 0, 0 +; CHECK-NEXT: ret void ; bb: %tmp = call %struct.zot @widget(<8 x i32> %arg) @@ -47,7 +34,5 @@ ret void } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll b/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll @@ -36,8 +36,9 @@ ; FIXME we should recognize this as UB and make it an unreachable. define dso_local i16 @foo(i16 %a) { +; NOT_CGSCC_NPM: Function Attrs: norecurse ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo -; NOT_CGSCC_NPM-SAME: (i16 [[A:%.*]]) { +; NOT_CGSCC_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR0:[0-9]+]] { ; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16)*)(i16 [[A]]) ; NOT_CGSCC_NPM-NEXT: ret i16 [[CALL]] ; @@ -52,27 +53,18 @@ } define internal i16 @bar(i16 %p1, i16 %p2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i16 0 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bar -; IS__CGSCC_OPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: ret i16 0 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bar -; IS__CGSCC_NPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: ret i16 0 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@bar +; CHECK-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: ret i16 0 ; ret i16 0 } define dso_local i16 @foo2(i16 %a) { +; NOT_CGSCC_NPM: Function Attrs: norecurse ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo2 -; NOT_CGSCC_NPM-SAME: (i16 [[A:%.*]]) { +; NOT_CGSCC_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR0]] { ; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar2 to i16 (i16)*)(i16 [[A]]) ; NOT_CGSCC_NPM-NEXT: ret i16 [[CALL]] ; @@ -87,23 +79,11 @@ } define internal i16 @bar2(i16 %p1, i16 %p2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar2 -; IS__TUNIT____-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = add i16 [[P1]], [[P2]] -; IS__TUNIT____-NEXT: ret i16 [[A]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bar2 -; IS__CGSCC_OPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = add i16 [[P1]], [[P2]] -; IS__CGSCC_OPM-NEXT: ret i16 [[A]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bar2 -; IS__CGSCC_NPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = add i16 [[P1]], [[P2]] -; IS__CGSCC_NPM-NEXT: ret i16 [[A]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@bar2 +; CHECK-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: [[A:%.*]] = add i16 [[P1]], [[P2]] +; CHECK-NEXT: ret i16 [[A]] ; %a = add i16 %p1, %p2 ret i16 %a @@ -116,8 +96,9 @@ ; been provided), define dso_local i16 @vararg_tests(i16 %a) { +; NOT_CGSCC_NPM: Function Attrs: norecurse ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@vararg_tests -; NOT_CGSCC_NPM-SAME: (i16 [[A:%.*]]) { +; NOT_CGSCC_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR0]] { ; NOT_CGSCC_NPM-NEXT: [[CALL2:%.*]] = call i16 bitcast (i16 (i16, i16, ...)* @vararg_no_prop to i16 (i16)*)(i16 noundef 7) ; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = add i16 7, [[CALL2]] ; NOT_CGSCC_NPM-NEXT: ret i16 [[ADD]] @@ -136,42 +117,26 @@ } define internal i16 @vararg_prop(i16 %p1, ...) { -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@vararg_prop -; IS__CGSCC_OPM-SAME: (i16 [[P1:%.*]], ...) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: ret i16 undef -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@vararg_prop -; IS__CGSCC_NPM-SAME: (i16 [[P1:%.*]], ...) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i16 undef +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@vararg_prop +; IS__CGSCC____-SAME: (i16 [[P1:%.*]], ...) #[[ATTR1]] { +; IS__CGSCC____-NEXT: ret i16 undef ; ret i16 %p1 } define internal i16 @vararg_no_prop(i16 %p1, i16 %p2, ...) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@vararg_no_prop -; IS__TUNIT____-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i16 7 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@vararg_no_prop -; IS__CGSCC_OPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: ret i16 7 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@vararg_no_prop -; IS__CGSCC_NPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i16 7 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@vararg_no_prop +; CHECK-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR1]] { +; CHECK-NEXT: ret i16 7 ; ret i16 %p1 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { norecurse } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ;. ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone } ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll b/llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll @@ -8,8 +8,9 @@ ; argument type between the caller and callee. define dso_local i16 @foo(i16 %a) { +; NOT_CGSCC_NPM: Function Attrs: norecurse ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo -; NOT_CGSCC_NPM-SAME: (i16 [[A:%.*]]) { +; NOT_CGSCC_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR0:[0-9]+]] { ; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16, i32)*)(i16 [[A]], i32 7) ; NOT_CGSCC_NPM-NEXT: ret i16 [[CALL]] ; @@ -24,29 +25,18 @@ } define internal i16 @bar(i16 %p1, i16 %p2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: (i16 [[P1:%.*]], i16 returned [[P2:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i16 [[P2]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bar -; IS__CGSCC_OPM-SAME: (i16 [[P1:%.*]], i16 returned [[P2:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: ret i16 [[P2]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bar -; IS__CGSCC_NPM-SAME: (i16 [[P1:%.*]], i16 returned [[P2:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: ret i16 [[P2]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@bar +; CHECK-SAME: (i16 [[P1:%.*]], i16 returned [[P2:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: ret i16 [[P2]] ; ret i16 %p2 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { norecurse } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ;. ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone } ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/comdat-ipo.ll b/llvm/test/Transforms/Attributor/IPConstantProp/comdat-ipo.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/comdat-ipo.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/comdat-ipo.ll @@ -7,15 +7,10 @@ ; See PR26774 define i32 @baz() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@baz -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32 10 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@baz -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32 10 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@baz +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: ret i32 10 ; ret i32 10 } @@ -33,7 +28,9 @@ } define i32 @bar() { -; CHECK-LABEL: define {{[^@]+}}@bar() { +; CHECK: Function Attrs: norecurse +; CHECK-LABEL: define {{[^@]+}}@bar +; CHECK-SAME: () #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: [[VAL:%.*]] = call i32 @foo() ; CHECK-NEXT: ret i32 [[VAL]] ; @@ -42,7 +39,6 @@ ret i32 %val } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR1]] = { norecurse } ;. 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 @@ -72,7 +72,7 @@ } define i32 @main() nounwind readnone { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@main ; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: @@ -88,7 +88,7 @@ ret i32 0 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nounwind readnone } ; IS__CGSCC____: attributes #[[ATTR1]] = { nounwind readonly } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/deadarg.ll b/llvm/test/Transforms/Attributor/IPConstantProp/deadarg.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/deadarg.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/deadarg.ll @@ -14,20 +14,13 @@ } define void @bar() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bar -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@bar +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: ret void ; ret void } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll b/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll @@ -7,61 +7,33 @@ target triple = "powerpc64le-unknown-linux" define void @test(i32 signext %n) { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@test -; IS__TUNIT____-SAME: (i32 signext [[N:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.then2: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.end4: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.then9: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.then12: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.else14: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: do.body: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.then33: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: cond.false.i28: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: _ZN5boost4math4signIgEEiRKT_.exit30: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@test -; IS__CGSCC____-SAME: (i32 signext [[N:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.then2: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.end4: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.then9: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.then12: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.else14: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: do.body: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.then33: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: cond.false.i28: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: _ZN5boost4math4signIgEEiRKT_.exit30: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse noreturn nosync nounwind readnone +; CHECK-LABEL: define {{[^@]+}}@test +; CHECK-SAME: (i32 signext [[N:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: unreachable +; CHECK: if.then: +; CHECK-NEXT: unreachable +; CHECK: if.end: +; CHECK-NEXT: unreachable +; CHECK: if.then2: +; CHECK-NEXT: unreachable +; CHECK: if.end4: +; CHECK-NEXT: unreachable +; CHECK: if.then9: +; CHECK-NEXT: unreachable +; CHECK: if.then12: +; CHECK-NEXT: unreachable +; CHECK: if.else14: +; CHECK-NEXT: unreachable +; CHECK: do.body: +; CHECK-NEXT: unreachable +; CHECK: if.then33: +; CHECK-NEXT: unreachable +; CHECK: cond.false.i28: +; CHECK-NEXT: unreachable +; CHECK: _ZN5boost4math4signIgEEiRKT_.exit30: +; CHECK-NEXT: unreachable ; entry: @@ -109,7 +81,5 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/global.ll b/llvm/test/Transforms/Attributor/IPConstantProp/global.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/global.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/global.ll @@ -10,25 +10,15 @@ ; CHECK: @[[_ZL6TEST1G:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 42, align 4 ;. define void @_Z7test1f1v() nounwind { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@_Z7test1f1v -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[IF_END:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@_Z7test1f1v -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@_Z7test1f1v +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: br label [[IF_END:%.*]] +; CHECK: if.then: +; CHECK-NEXT: unreachable +; CHECK: if.end: +; CHECK-NEXT: ret void ; entry: %tmp = load i32, i32* @_ZL6test1g, align 4 @@ -44,24 +34,16 @@ } define i32 @_Z7test1f2v() nounwind { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@_Z7test1f2v -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 42 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@_Z7test1f2v -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 42 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@_Z7test1f2v +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 42 ; entry: %tmp = load i32, i32* @_ZL6test1g, align 4 ret i32 %tmp } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/multiple_callbacks.ll b/llvm/test/Transforms/Attributor/IPConstantProp/multiple_callbacks.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/multiple_callbacks.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/multiple_callbacks.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=1 -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=1 -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=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-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 ; @@ -40,51 +40,33 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" define internal i32 @cb0(i32 %zero) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cb0 -; IS__TUNIT____-SAME: (i32 [[ZERO:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cb0 -; IS__CGSCC____-SAME: (i32 [[ZERO:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@cb0 +; CHECK-SAME: (i32 [[ZERO:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 0 ; entry: ret i32 %zero } define internal i32 @cb1(i32 %unknown) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cb1 -; IS__TUNIT____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 [[UNKNOWN]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cb1 -; IS__CGSCC____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 [[UNKNOWN]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@cb1 +; CHECK-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 [[UNKNOWN]] ; entry: ret i32 %unknown } define internal i32 @cb2(i32 %unknown) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cb2 -; IS__TUNIT____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 [[UNKNOWN]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cb2 -; IS__CGSCC____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 [[UNKNOWN]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@cb2 +; CHECK-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 [[UNKNOWN]] ; entry: %call = call i32 @cb0(i32 0) @@ -92,47 +74,45 @@ } define internal i32 @cb3(i32 %unknown) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cb3 -; IS__TUNIT____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 [[UNKNOWN]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cb3 -; IS__CGSCC____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 [[UNKNOWN]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@cb3 +; CHECK-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 [[UNKNOWN]] ; entry: ret i32 %unknown } define internal i32 @cb4(i32 %unknown) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cb4 -; IS__TUNIT____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 [[UNKNOWN]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cb4 -; IS__CGSCC____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 [[UNKNOWN]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@cb4 +; CHECK-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 [[UNKNOWN]] ; entry: ret i32 %unknown } define void @foo() { -; CHECK-LABEL: define {{[^@]+}}@foo() { -; CHECK-NEXT: entry: -; CHECK-NEXT: call void @broker(i32 (i32)* noundef nonnull @cb0, i32 (i32)* noundef nonnull @cb1, i32 (i32)* noundef nonnull @cb0, i32 noundef 0, i32 noundef 1) -; CHECK-NEXT: call void @broker(i32 (i32)* noundef nonnull @cb1, i32 (i32)* noundef nonnull @cb2, i32 (i32)* noundef nonnull @cb2, i32 noundef 0, i32 noundef 1) -; CHECK-NEXT: call void @broker(i32 (i32)* noundef nonnull @cb3, i32 (i32)* noundef nonnull @cb2, i32 (i32)* noundef nonnull @cb3, i32 noundef 0, i32 noundef 1) -; CHECK-NEXT: call void @broker(i32 (i32)* noundef nonnull @cb4, i32 (i32)* noundef nonnull @cb4, i32 (i32)* noundef nonnull @cb4, i32 noundef 0, i32 noundef 1) -; CHECK-NEXT: ret void +; IS__TUNIT____-LABEL: define {{[^@]+}}@foo() { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: call void @broker(i32 (i32)* noundef nonnull @cb0, i32 (i32)* noundef nonnull @cb1, i32 (i32)* noundef nonnull @cb0, i32 noundef 0, i32 noundef 1) +; IS__TUNIT____-NEXT: call void @broker(i32 (i32)* noundef nonnull @cb1, i32 (i32)* noundef nonnull @cb2, i32 (i32)* noundef nonnull @cb2, i32 noundef 0, i32 noundef 1) +; IS__TUNIT____-NEXT: call void @broker(i32 (i32)* noundef nonnull @cb3, i32 (i32)* noundef nonnull @cb2, i32 (i32)* noundef nonnull @cb3, i32 noundef 0, i32 noundef 1) +; IS__TUNIT____-NEXT: call void @broker(i32 (i32)* noundef nonnull @cb4, i32 (i32)* noundef nonnull @cb4, i32 (i32)* noundef nonnull @cb4, i32 noundef 0, i32 noundef 1) +; IS__TUNIT____-NEXT: ret void +; +; IS__CGSCC____: Function Attrs: norecurse +; IS__CGSCC____-LABEL: define {{[^@]+}}@foo +; IS__CGSCC____-SAME: () #[[ATTR1:[0-9]+]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: call void @broker(i32 (i32)* noundef nonnull @cb0, i32 (i32)* noundef nonnull @cb1, i32 (i32)* noundef nonnull @cb0, i32 noundef 0, i32 noundef 1) +; IS__CGSCC____-NEXT: call void @broker(i32 (i32)* noundef nonnull @cb1, i32 (i32)* noundef nonnull @cb2, i32 (i32)* noundef nonnull @cb2, i32 noundef 0, i32 noundef 1) +; IS__CGSCC____-NEXT: call void @broker(i32 (i32)* noundef nonnull @cb3, i32 (i32)* noundef nonnull @cb2, i32 (i32)* noundef nonnull @cb3, i32 noundef 0, i32 noundef 1) +; IS__CGSCC____-NEXT: call void @broker(i32 (i32)* noundef nonnull @cb4, i32 (i32)* noundef nonnull @cb4, i32 (i32)* noundef nonnull @cb4, i32 noundef 0, i32 noundef 1) +; IS__CGSCC____-NEXT: ret void ; entry: %call = call i32 @cb0(i32 0) @@ -151,9 +131,10 @@ !2 = !{i64 2, i64 3, i1 false} !3 = !{!0, !2, !1} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR1]] = { norecurse } ;. ; CHECK: [[META0:![0-9]+]] = !{!1, !2, !3} ; CHECK: [[META1:![0-9]+]] = !{i64 0, i64 3, i1 false} diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/naked-return.ll b/llvm/test/Transforms/Attributor/IPConstantProp/naked-return.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/naked-return.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/naked-return.ll @@ -34,6 +34,7 @@ } define void @patatino(i32, i32, i32) local_unnamed_addr #1 { +; CHECK: Function Attrs: norecurse ; CHECK-LABEL: define {{[^@]+}}@patatino ; CHECK-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32 [[TMP2:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: bb: @@ -52,5 +53,5 @@ attributes #1 = { "frame-pointer"="all" } ;. ; CHECK: attributes #[[ATTR0]] = { naked } -; CHECK: attributes #[[ATTR1]] = { "frame-pointer"="all" } +; CHECK: attributes #[[ATTR1]] = { norecurse "frame-pointer"="all" } ;. 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 @@ -53,8 +53,9 @@ ; IS__TUNIT_NPM-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 3, void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, float*, i64)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N_ADDR]], float* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) undef, i64 undef) ; IS__TUNIT_NPM-NEXT: ret void ; +; IS__CGSCC_OPM: Function Attrs: norecurse ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@foo -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) { +; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4 ; IS__CGSCC_OPM-NEXT: [[P:%.*]] = alloca float, align 4 @@ -63,8 +64,9 @@ ; IS__CGSCC_OPM-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 3, void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, float*, i64)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N_ADDR]], float* noalias nocapture nofree noundef nonnull readnone align 4 dereferenceable(4) [[P]], i64 noundef 4617315517961601024) ; IS__CGSCC_OPM-NEXT: ret void ; +; IS__CGSCC_NPM: Function Attrs: norecurse ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@foo -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) { +; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4 ; IS__CGSCC_NPM-NEXT: [[P:%.*]] = alloca float, align 4 @@ -204,8 +206,9 @@ ; IS__TUNIT_NPM: omp.precond.end: ; IS__TUNIT_NPM-NEXT: ret void ; +; IS__CGSCC_OPM: Function Attrs: norecurse ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@.omp_outlined. -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N:%.*]], float* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[P:%.*]], i64 [[Q:%.*]]) { +; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N:%.*]], float* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[P:%.*]], i64 [[Q:%.*]]) #[[ATTR0]] { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[Q_ADDR:%.*]] = alloca i64, align 8 ; IS__CGSCC_OPM-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4 @@ -264,8 +267,9 @@ ; IS__CGSCC_OPM: omp.precond.end: ; IS__CGSCC_OPM-NEXT: ret void ; +; IS__CGSCC_NPM: Function Attrs: norecurse ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@.omp_outlined. -; IS__CGSCC_NPM-SAME: (i32* noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N:%.*]], float* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[P:%.*]], i64 [[Q:%.*]]) { +; IS__CGSCC_NPM-SAME: (i32* noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N:%.*]], float* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[P:%.*]], i64 [[Q:%.*]]) #[[ATTR0]] { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: [[Q_ADDR:%.*]] = alloca i64, align 8 ; IS__CGSCC_NPM-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4 @@ -407,6 +411,8 @@ !1 = !{i64 2, i64 -1, i64 -1, i1 true} !0 = !{!1} ;. +; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { norecurse } +;. ; CHECK: [[META0:![0-9]+]] = !{!1} ; CHECK: [[META1:![0-9]+]] = !{i64 2, i64 -1, i64 -1, i1 true} ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll b/llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll @@ -45,7 +45,9 @@ ; IS__TUNIT____-NEXT: [[CALL3:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @buz, i8* noalias nofree noundef nonnull readnone align 8 dereferenceable(1) "no-capture-maybe-returned" [[ALLOC2]]) ; IS__TUNIT____-NEXT: ret i32 0 ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@main() { +; IS__CGSCC____: Function Attrs: norecurse +; IS__CGSCC____-LABEL: define {{[^@]+}}@main +; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: [[ALLOC1:%.*]] = alloca i8, align 8 ; IS__CGSCC____-NEXT: [[ALLOC2:%.*]] = alloca i8, align 8 @@ -70,7 +72,7 @@ declare !callback !0 dso_local i32 @pthread_create(i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*) define internal i8* @foo(i8* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@foo ; IS__TUNIT____-SAME: (i8* noalias nocapture nofree readnone align 4294967296 [[ARG:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: @@ -78,7 +80,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (i8* noalias nocapture nofree readnone align 4294967296 [[ARG:%.*]]) #[[ATTR0:[0-9]+]] { +; IS__CGSCC____-SAME: (i8* noalias nocapture nofree readnone align 4294967296 [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: ret i8* null ; @@ -87,7 +89,7 @@ } define internal i8* @bar(i8* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@bar ; IS__TUNIT____-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR0]] { ; IS__TUNIT____-NEXT: entry: @@ -95,7 +97,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@bar -; IS__CGSCC____-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR0]] { +; IS__CGSCC____-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR1]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: ret i8* bitcast (i8** @GlobalVPtr to i8*) ; @@ -104,7 +106,7 @@ } define internal i8* @baz(i8* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@baz ; IS__TUNIT____-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { ; IS__TUNIT____-NEXT: entry: @@ -112,7 +114,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@baz -; IS__CGSCC____-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { +; IS__CGSCC____-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: ret i8* [[ARG]] ; @@ -121,7 +123,7 @@ } define internal i8* @buz(i8* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@buz ; IS__TUNIT____-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { ; IS__TUNIT____-NEXT: entry: @@ -129,7 +131,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@buz -; IS__CGSCC____-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { +; IS__CGSCC____-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: ret i8* [[ARG]] ; @@ -140,9 +142,10 @@ !1 = !{i64 2, i64 3, i1 false} !0 = !{!1} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR0]] = { norecurse } +; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ;. ; CHECK: [[META0:![0-9]+]] = !{!1} ; CHECK: [[META1:![0-9]+]] = !{i64 2, i64 3, i1 false} diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/recursion.ll b/llvm/test/Transforms/Attributor/IPConstantProp/recursion.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/recursion.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/recursion.ll @@ -18,22 +18,15 @@ } define void @bar() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bar -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@bar +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: ret void ; call i32 @foo( i32 17 ) ; :1 [#uses=0] ret void } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/remove-call-inst.ll b/llvm/test/Transforms/Attributor/IPConstantProp/remove-call-inst.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/remove-call-inst.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/remove-call-inst.ll @@ -11,17 +11,11 @@ ; FIXME: Remove obsolete calls/instructions define i32 @main() noreturn nounwind { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@main -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 123 -; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@main -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 123 +; CHECK: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@main +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 123 ; entry: %call2 = tail call i32 @wwrite(i64 0) nounwind @@ -55,7 +49,7 @@ ret i32 0 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } ; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll b/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll @@ -6,33 +6,19 @@ ;; This function returns its second argument on all return statements define internal i32* @incdec(i1 %C, i32* %V) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@incdec -; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* noalias nofree noundef nonnull returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[X:%.*]] = load i32, i32* [[V]], align 4 -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: T: -; IS__TUNIT____-NEXT: [[X1:%.*]] = add i32 [[X]], 1 -; IS__TUNIT____-NEXT: store i32 [[X1]], i32* [[V]], align 4 -; IS__TUNIT____-NEXT: ret i32* [[V]] -; IS__TUNIT____: F: -; IS__TUNIT____-NEXT: [[X2:%.*]] = sub i32 [[X]], 1 -; IS__TUNIT____-NEXT: store i32 [[X2]], i32* [[V]], align 4 -; IS__TUNIT____-NEXT: ret i32* [[V]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@incdec -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* noalias nofree noundef nonnull returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[X:%.*]] = load i32, i32* [[V]], align 4 -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_OPM: T: -; IS__CGSCC_OPM-NEXT: [[X1:%.*]] = add i32 [[X]], 1 -; IS__CGSCC_OPM-NEXT: store i32 [[X1]], i32* [[V]], align 4 -; IS__CGSCC_OPM-NEXT: ret i32* [[V]] -; IS__CGSCC_OPM: F: -; IS__CGSCC_OPM-NEXT: [[X2:%.*]] = sub i32 [[X]], 1 -; IS__CGSCC_OPM-NEXT: store i32 [[X2]], i32* [[V]], align 4 -; IS__CGSCC_OPM-NEXT: ret i32* [[V]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@incdec +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* noalias nofree noundef nonnull returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = load i32, i32* [[V]], align 4 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: T: +; NOT_CGSCC_NPM-NEXT: [[X1:%.*]] = add i32 [[X]], 1 +; NOT_CGSCC_NPM-NEXT: store i32 [[X1]], i32* [[V]], align 4 +; NOT_CGSCC_NPM-NEXT: ret i32* [[V]] +; NOT_CGSCC_NPM: F: +; NOT_CGSCC_NPM-NEXT: [[X2:%.*]] = sub i32 [[X]], 1 +; NOT_CGSCC_NPM-NEXT: store i32 [[X2]], i32* [[V]], align 4 +; NOT_CGSCC_NPM-NEXT: ret i32* [[V]] ; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@incdec @@ -65,21 +51,13 @@ ;; This function returns its first argument as a part of a multiple return ;; value define internal { i32, i32 } @foo(i32 %A, i32 %B) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: [[X:%.*]] = add i32 [[A]], [[B]] -; IS__TUNIT____-NEXT: [[Y:%.*]] = insertvalue { i32, i32 } undef, i32 [[A]], 0 -; IS__TUNIT____-NEXT: [[Z:%.*]] = insertvalue { i32, i32 } [[Y]], i32 [[X]], 1 -; IS__TUNIT____-NEXT: ret { i32, i32 } [[Z]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: [[X:%.*]] = add i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: [[Y:%.*]] = insertvalue { i32, i32 } undef, i32 [[A]], 0 -; IS__CGSCC____-NEXT: [[Z:%.*]] = insertvalue { i32, i32 } [[Y]], i32 [[X]], 1 -; IS__CGSCC____-NEXT: ret { i32, i32 } [[Z]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@foo +; CHECK-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: [[X:%.*]] = add i32 [[A]], [[B]] +; CHECK-NEXT: [[Y:%.*]] = insertvalue { i32, i32 } undef, i32 [[A]], 0 +; CHECK-NEXT: [[Z:%.*]] = insertvalue { i32, i32 } [[Y]], i32 [[X]], 1 +; CHECK-NEXT: ret { i32, i32 } [[Z]] ; %X = add i32 %A, %B %Y = insertvalue { i32, i32 } undef, i32 %A, 0 @@ -88,14 +66,14 @@ } define void @caller(i1 %C) personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@caller ; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] personality i32 (...)* @__gxx_personality_v0 { ; IS__TUNIT_OPM-NEXT: [[Q:%.*]] = alloca i32, align 4 ; IS__TUNIT_OPM-NEXT: [[W:%.*]] = call align 4 i32* @incdec(i1 [[C]], i32* noalias nofree noundef nonnull align 4 dereferenceable(4) "no-capture-maybe-returned" [[Q]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT_OPM-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR1]] +; IS__TUNIT_OPM-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR3:[0-9]+]] ; IS__TUNIT_OPM-NEXT: [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0 -; IS__TUNIT_OPM-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR1]] +; IS__TUNIT_OPM-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR3]] ; IS__TUNIT_OPM-NEXT: br label [[OK:%.*]] ; IS__TUNIT_OPM: OK: ; IS__TUNIT_OPM-NEXT: [[X2:%.*]] = extractvalue { i32, i32 } [[S2]], 0 @@ -107,14 +85,14 @@ ; IS__TUNIT_OPM: RET: ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@caller ; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] personality i32 (...)* @__gxx_personality_v0 { ; IS__TUNIT_NPM-NEXT: [[Q:%.*]] = alloca i32, align 4 ; IS__TUNIT_NPM-NEXT: [[W:%.*]] = call align 4 i32* @incdec(i1 [[C]], i32* noalias nofree noundef nonnull align 4 dereferenceable(4) "no-capture-maybe-returned" [[Q]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT_NPM-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR1]] +; IS__TUNIT_NPM-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR3:[0-9]+]] ; IS__TUNIT_NPM-NEXT: [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0 -; IS__TUNIT_NPM-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR1]] +; IS__TUNIT_NPM-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR3]] ; IS__TUNIT_NPM-NEXT: br label [[OK:%.*]] ; IS__TUNIT_NPM: OK: ; IS__TUNIT_NPM-NEXT: [[X2:%.*]] = extractvalue { i32, i32 } [[S2]], 0 @@ -192,11 +170,12 @@ declare i32 @__gxx_personality_v0(...) ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR3:[0-9]+]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn } ; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC____: attributes #[[ATTR2:[0-9]+]] = { nounwind willreturn } ; IS__CGSCC____: attributes #[[ATTR3:[0-9]+]] = { readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll b/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll @@ -7,25 +7,15 @@ ; FIXME: icmp folding is missing define i1 @invokecaller(i1 %C) personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@invokecaller -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT____-NEXT: [[X:%.*]] = call i32 @foo(i1 [[C]]) #[[ATTR1:[0-9]+]] -; IS__TUNIT____-NEXT: br label [[OK:%.*]] -; IS__TUNIT____: OK: -; IS__TUNIT____-NEXT: ret i1 true -; IS__TUNIT____: FAIL: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@invokecaller -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 { -; IS__CGSCC____-NEXT: [[X:%.*]] = call i32 @foo(i1 [[C]]) #[[ATTR1:[0-9]+]] -; IS__CGSCC____-NEXT: br label [[OK:%.*]] -; IS__CGSCC____: OK: -; IS__CGSCC____-NEXT: ret i1 true -; IS__CGSCC____: FAIL: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@invokecaller +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 { +; CHECK-NEXT: [[X:%.*]] = call i32 @foo(i1 [[C]]) #[[ATTR1:[0-9]+]] +; CHECK-NEXT: br label [[OK:%.*]] +; CHECK: OK: +; CHECK-NEXT: ret i1 true +; CHECK: FAIL: +; CHECK-NEXT: unreachable ; %X = invoke i32 @foo( i1 %C ) to label %OK unwind label %FAIL ; [#uses=1] OK: @@ -38,23 +28,14 @@ } define internal i32 @foo(i1 %C) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: T: -; IS__TUNIT____-NEXT: ret i32 undef -; IS__TUNIT____: F: -; IS__TUNIT____-NEXT: ret i32 undef -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: T: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: F: -; IS__CGSCC____-NEXT: ret i32 undef +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@foo +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CHECK: T: +; CHECK-NEXT: ret i32 undef +; CHECK: F: +; CHECK-NEXT: ret i32 undef ; br i1 %C, label %T, label %F @@ -66,15 +47,10 @@ } define i1 @caller(i1 %C) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i1 true -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 true +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@caller +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: ret i1 true ; %X = call i32 @foo( i1 %C ) ; [#uses=1] %Y = icmp ne i32 %X, 0 ; [#uses=1] @@ -83,9 +59,6 @@ declare i32 @__gxx_personality_v0(...) ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nounwind readnone } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nounwind readnone } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR1]] = { nounwind readnone } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll b/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll @@ -9,31 +9,18 @@ %0 = type { i32, i32 } define internal %0 @foo(i1 %Q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (i1 [[Q:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: T: -; IS__TUNIT____-NEXT: [[MRV:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 -; IS__TUNIT____-NEXT: [[MRV1:%.*]] = insertvalue [[TMP0]] [[MRV]], i32 22, 1 -; IS__TUNIT____-NEXT: ret [[TMP0]] [[MRV1]] -; IS__TUNIT____: F: -; IS__TUNIT____-NEXT: [[MRV2:%.*]] = insertvalue [[TMP0]] undef, i32 21, 0 -; IS__TUNIT____-NEXT: [[MRV3:%.*]] = insertvalue [[TMP0]] [[MRV2]], i32 23, 1 -; IS__TUNIT____-NEXT: ret [[TMP0]] [[MRV3]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (i1 [[Q:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: T: -; IS__CGSCC____-NEXT: [[MRV:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 -; IS__CGSCC____-NEXT: [[MRV1:%.*]] = insertvalue [[TMP0]] [[MRV]], i32 22, 1 -; IS__CGSCC____-NEXT: ret [[TMP0]] [[MRV1]] -; IS__CGSCC____: F: -; IS__CGSCC____-NEXT: [[MRV2:%.*]] = insertvalue [[TMP0]] undef, i32 21, 0 -; IS__CGSCC____-NEXT: [[MRV3:%.*]] = insertvalue [[TMP0]] [[MRV2]], i32 23, 1 -; IS__CGSCC____-NEXT: ret [[TMP0]] [[MRV3]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@foo +; CHECK-SAME: (i1 [[Q:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] +; CHECK: T: +; CHECK-NEXT: [[MRV:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 +; CHECK-NEXT: [[MRV1:%.*]] = insertvalue [[TMP0]] [[MRV]], i32 22, 1 +; CHECK-NEXT: ret [[TMP0]] [[MRV1]] +; CHECK: F: +; CHECK-NEXT: [[MRV2:%.*]] = insertvalue [[TMP0]] undef, i32 21, 0 +; CHECK-NEXT: [[MRV3:%.*]] = insertvalue [[TMP0]] [[MRV2]], i32 23, 1 +; CHECK-NEXT: ret [[TMP0]] [[MRV3]] ; br i1 %Q, label %T, label %F @@ -49,29 +36,17 @@ } define internal %0 @bar(i1 %Q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 -; IS__TUNIT____-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: T: -; IS__TUNIT____-NEXT: [[B:%.*]] = insertvalue [[TMP0]] [[A]], i32 22, 1 -; IS__TUNIT____-NEXT: ret [[TMP0]] [[B]] -; IS__TUNIT____: F: -; IS__TUNIT____-NEXT: [[C:%.*]] = insertvalue [[TMP0]] [[A]], i32 23, 1 -; IS__TUNIT____-NEXT: ret [[TMP0]] [[C]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bar -; IS__CGSCC____-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 -; IS__CGSCC____-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: T: -; IS__CGSCC____-NEXT: [[B:%.*]] = insertvalue [[TMP0]] [[A]], i32 22, 1 -; IS__CGSCC____-NEXT: ret [[TMP0]] [[B]] -; IS__CGSCC____: F: -; IS__CGSCC____-NEXT: [[C:%.*]] = insertvalue [[TMP0]] [[A]], i32 23, 1 -; IS__CGSCC____-NEXT: ret [[TMP0]] [[C]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@bar +; CHECK-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[A:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 +; CHECK-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] +; CHECK: T: +; CHECK-NEXT: [[B:%.*]] = insertvalue [[TMP0]] [[A]], i32 22, 1 +; CHECK-NEXT: ret [[TMP0]] [[B]] +; CHECK: F: +; CHECK-NEXT: [[C:%.*]] = insertvalue [[TMP0]] [[A]], i32 23, 1 +; CHECK-NEXT: ret [[TMP0]] [[C]] ; %A = insertvalue %0 undef, i32 21, 0 br i1 %Q, label %T, label %F @@ -86,17 +61,11 @@ } define %0 @caller(i1 %Q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller -; IS__TUNIT____-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR0]] -; IS__TUNIT____-NEXT: ret [[TMP0]] [[X]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller -; IS__CGSCC____-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR1:[0-9]+]] -; IS__CGSCC____-NEXT: ret [[TMP0]] [[X]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@caller +; CHECK-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR1:[0-9]+]] +; CHECK-NEXT: ret [[TMP0]] [[X]] ; %X = call %0 @foo(i1 %Q) %A = extractvalue %0 %X, 0 @@ -111,13 +80,13 @@ ; Similar to @caller but the result of both calls are actually used. define i32 @caller2(i1 %Q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@caller2 ; IS__TUNIT____-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR0]] +; IS__TUNIT____-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR1]] ; IS__TUNIT____-NEXT: [[A:%.*]] = extractvalue [[TMP0]] [[X]], 0 ; IS__TUNIT____-NEXT: [[B:%.*]] = extractvalue [[TMP0]] [[X]], 1 -; IS__TUNIT____-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 [[Q]]) #[[ATTR0]] +; IS__TUNIT____-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 [[Q]]) #[[ATTR1]] ; IS__TUNIT____-NEXT: [[C:%.*]] = extractvalue [[TMP0]] [[Y]], 0 ; IS__TUNIT____-NEXT: [[D:%.*]] = extractvalue [[TMP0]] [[Y]], 1 ; IS__TUNIT____-NEXT: [[M:%.*]] = add i32 [[A]], [[C]] @@ -131,7 +100,7 @@ ; IS__CGSCC____-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR1]] ; IS__CGSCC____-NEXT: [[A:%.*]] = extractvalue [[TMP0]] [[X]], 0 ; IS__CGSCC____-NEXT: [[B:%.*]] = extractvalue [[TMP0]] [[X]], 1 -; IS__CGSCC____-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 [[Q]]) #[[ATTR1]] +; IS__CGSCC____-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 [[Q]]) #[[ATTR2:[0-9]+]] ; IS__CGSCC____-NEXT: [[C:%.*]] = extractvalue [[TMP0]] [[Y]], 0 ; IS__CGSCC____-NEXT: [[D:%.*]] = extractvalue [[TMP0]] [[Y]], 1 ; IS__CGSCC____-NEXT: [[M:%.*]] = add i32 [[A]], [[C]] @@ -152,8 +121,10 @@ ret i32 %R } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR1]] = { nounwind readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR2]] = { readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll b/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll @@ -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=1 -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=1 -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=5 -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=5 -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 @@ -59,21 +59,14 @@ } define i32 @main(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@main -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32 99 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@main -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 99 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@main +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: ret i32 99 ; %res = call i32 @test1(i1 %c) ret i32 %res } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/thread_local_acs.ll b/llvm/test/Transforms/Attributor/IPConstantProp/thread_local_acs.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/thread_local_acs.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/thread_local_acs.ll @@ -28,23 +28,14 @@ ; CHECK: @[[GSH:[a-zA-Z0-9_$"\\.-]+]] = dso_local global i32 0, align 4 ;. define internal i32 @callee(i32* %thread_local_ptr, i32* %shared_ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@callee -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[THREAD_LOCAL_PTR:%.*]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[SHARED_PTR:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TMP:%.*]] = load i32, i32* [[THREAD_LOCAL_PTR]], align 4 -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32, i32* @gsh, align 4 -; IS__TUNIT____-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP]], [[TMP1]] -; IS__TUNIT____-NEXT: ret i32 [[ADD]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@callee -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[THREAD_LOCAL_PTR:%.*]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[SHARED_PTR:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP:%.*]] = load i32, i32* [[THREAD_LOCAL_PTR]], align 4 -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = load i32, i32* @gsh, align 4 -; IS__CGSCC____-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP]], [[TMP1]] -; IS__CGSCC____-NEXT: ret i32 [[ADD]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@callee +; CHECK-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[THREAD_LOCAL_PTR:%.*]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[SHARED_PTR:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[TMP:%.*]] = load i32, i32* [[THREAD_LOCAL_PTR]], align 4 +; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* @gsh, align 4 +; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP]], [[TMP1]] +; CHECK-NEXT: ret i32 [[ADD]] ; entry: %tmp = load i32, i32* %thread_local_ptr, align 4 @@ -59,7 +50,9 @@ ; IS__TUNIT____-NEXT: call void @broker(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) @gtl, i32 (i32*, i32*)* noundef nonnull @callee, i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) undef) ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller() { +; IS__CGSCC____: Function Attrs: norecurse +; IS__CGSCC____-LABEL: define {{[^@]+}}@caller +; IS__CGSCC____-SAME: () #[[ATTR1:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: call void @broker(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) @gtl, i32 (i32*, i32*)* noundef nonnull @callee, i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) @gsh) ; IS__CGSCC____-NEXT: ret void @@ -74,9 +67,10 @@ !1 = !{i64 1, i64 0, i64 2, i1 false} !0 = !{!1} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readonly willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes #[[ATTR1]] = { norecurse } ;. ; CHECK: [[META0:![0-9]+]] = !{!1} ; CHECK: [[META1:![0-9]+]] = !{i64 1, i64 0, i64 2, i1 false} 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 @@ -18,47 +18,31 @@ ; CHECK: @[[CND:[a-zA-Z0-9_$"\\.-]+]] = external global i1 ;. define i32* @test1(i32* align 8 %0) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test1 -; IS__TUNIT____-SAME: (i32* nofree readnone returned align 8 "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32* [[TMP0]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test1 -; IS__CGSCC____-SAME: (i32* nofree readnone returned align 8 "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32* [[TMP0]] +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@test1 +; CHECK-SAME: (i32* nofree readnone returned align 8 "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: ret i32* [[TMP0]] ; ret i32* %0 } ; TEST 2 define i32* @test2(i32* %0) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* [[TMP0]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* [[TMP0]] +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@test2 +; CHECK-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: ret i32* [[TMP0]] ; ret i32* %0 } ; TEST 3 define i32* @test3(i32* align 8 %0, i32* align 4 %1, i1 %2) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test3 -; IS__TUNIT____-SAME: (i32* nofree readnone align 8 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 4 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] -; IS__TUNIT____-NEXT: ret i32* [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test3 -; IS__CGSCC____-SAME: (i32* nofree readnone align 8 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 4 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] -; IS__CGSCC____-NEXT: ret i32* [[RET]] +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@test3 +; CHECK-SAME: (i32* nofree readnone align 8 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 4 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] +; CHECK-NEXT: ret i32* [[RET]] ; %ret = select i1 %2, i32* %0, i32* %1 ret i32* %ret @@ -66,17 +50,11 @@ ; TEST 4 define i32* @test4(i32* align 32 %0, i32* align 32 %1, i1 %2) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test4 -; IS__TUNIT____-SAME: (i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] -; IS__TUNIT____-NEXT: ret i32* [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test4 -; IS__CGSCC____-SAME: (i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] -; IS__CGSCC____-NEXT: ret i32* [[RET]] +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@test4 +; CHECK-SAME: (i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] +; CHECK-NEXT: ret i32* [[RET]] ; %ret = select i1 %2, i32* %0, i32* %1 ret i32* %ret @@ -108,40 +86,20 @@ ; TEST 6 ; SCC define i32* @test6_1() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test6_1 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* undef -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test6_1 -; IS__CGSCC_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: ret i32* undef -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test6_1 -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: ret i32* undef +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@test6_1 +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i32* undef ; %ret = tail call i32* @test6_2() ret i32* %ret } define i32* @test6_2() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test6_2 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* undef -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test6_2 -; IS__CGSCC_OPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: ret i32* undef -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test6_2 -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: ret i32* undef +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@test6_2 +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i32* undef ; %ret = tail call i32* @test6_1() ret i32* %ret @@ -167,9 +125,9 @@ ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f1(i8* readnone %0) local_unnamed_addr #0 { -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; IS__CGSCC_OPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(1) [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { +; IS__CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(1) [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { ; IS__CGSCC_OPM-NEXT: br label [[TMP3:%.*]] ; IS__CGSCC_OPM: 2: ; IS__CGSCC_OPM-NEXT: unreachable @@ -200,27 +158,16 @@ ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f2(i8* readnone %0) local_unnamed_addr #0 { -; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f2 -; IS__CGSCC_OPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: 2: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: 4: -; IS__CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f2 -; IS__CGSCC_NPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: 2: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: 4: -; IS__CGSCC_NPM-NEXT: unreachable +; IS__CGSCC____: Function Attrs: noinline nounwind uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@f2 +; IS__CGSCC____-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: 2: +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: 3: +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: 4: +; IS__CGSCC____-NEXT: unreachable ; %2 = icmp eq i8* %0, null br i1 %2, label %5, label %3 @@ -241,23 +188,14 @@ ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f3(i8* readnone %0) local_unnamed_addr #0 { -; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f3 -; IS__CGSCC_OPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: br label [[TMP3:%.*]] -; IS__CGSCC_OPM: 2: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: ret i8* @a1 -; -; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f3 -; IS__CGSCC_NPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: br label [[TMP3:%.*]] -; IS__CGSCC_NPM: 2: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: ret i8* @a1 +; IS__CGSCC____: Function Attrs: noinline nounwind uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@f3 +; IS__CGSCC____-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { +; IS__CGSCC____-NEXT: br label [[TMP3:%.*]] +; IS__CGSCC____: 2: +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: 3: +; IS__CGSCC____-NEXT: ret i8* @a1 ; %2 = icmp eq i8* %0, null br i1 %2, label %3, label %5 @@ -274,15 +212,10 @@ ; TEST 7 ; Better than IR information define align 4 i8* @test7() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test7 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i8* @a1 -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test7 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i8* @a1 +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@test7 +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i8* @a1 ; %c = tail call i8* @f1(i8* align 8 dereferenceable(1) @a1) ret i8* %c @@ -291,9 +224,9 @@ ; TEST 7b ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f1b(i8* readnone %0) local_unnamed_addr #0 { -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; IS__CGSCC_OPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f1b -; IS__CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(1) [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { +; IS__CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(1) [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { ; IS__CGSCC_OPM-NEXT: br label [[TMP3:%.*]] ; IS__CGSCC_OPM: 2: ; IS__CGSCC_OPM-NEXT: unreachable @@ -326,27 +259,16 @@ ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f2b(i8* readnone %0) local_unnamed_addr #0 { ; -; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f2b -; IS__CGSCC_OPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: 2: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: 4: -; IS__CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f2b -; IS__CGSCC_NPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: 2: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: 4: -; IS__CGSCC_NPM-NEXT: unreachable +; IS__CGSCC____: Function Attrs: noinline nounwind uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@f2b +; IS__CGSCC____-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: 2: +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: 3: +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: 4: +; IS__CGSCC____-NEXT: unreachable ; %2 = icmp eq i8* %0, null br i1 %2, label %5, label %3 @@ -368,23 +290,14 @@ ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f3b(i8* readnone %0) local_unnamed_addr #0 { ; -; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f3b -; IS__CGSCC_OPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: br label [[TMP3:%.*]] -; IS__CGSCC_OPM: 2: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: ret i8* @a1 -; -; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f3b -; IS__CGSCC_NPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: br label [[TMP3:%.*]] -; IS__CGSCC_NPM: 2: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: ret i8* @a1 +; IS__CGSCC____: Function Attrs: noinline nounwind uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@f3b +; IS__CGSCC____-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { +; IS__CGSCC____-NEXT: br label [[TMP3:%.*]] +; IS__CGSCC____: 2: +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: 3: +; IS__CGSCC____-NEXT: ret i8* @a1 ; %2 = icmp eq i8* %0, null br i1 %2, label %3, label %5 @@ -399,15 +312,10 @@ } define align 4 i32* @test7b(i32* align 32 %p) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test7b -; IS__TUNIT____-SAME: (i32* nofree readnone returned align 32 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* [[P]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test7b -; IS__CGSCC____-SAME: (i32* nofree readnone returned align 32 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* [[P]] +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@test7b +; CHECK-SAME: (i32* nofree readnone returned align 32 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: ret i32* [[P]] ; tail call i8* @f1b(i8* align 8 dereferenceable(1) @a1) ret i32* %p @@ -424,23 +332,14 @@ ; IS__TUNIT____-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR1]] ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test8_helper() { -; IS__CGSCC_OPM-NEXT: [[PTR0:%.*]] = tail call i32* @unknown() -; IS__CGSCC_OPM-NEXT: [[PTR1:%.*]] = tail call align 4 i32* @unknown() -; IS__CGSCC_OPM-NEXT: [[PTR2:%.*]] = tail call align 8 i32* @unknown() -; IS__CGSCC_OPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone [[PTR0]]) #[[ATTR3:[0-9]+]] -; IS__CGSCC_OPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR3]] -; IS__CGSCC_OPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR3]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test8_helper() { -; IS__CGSCC_NPM-NEXT: [[PTR0:%.*]] = tail call i32* @unknown() -; IS__CGSCC_NPM-NEXT: [[PTR1:%.*]] = tail call align 4 i32* @unknown() -; IS__CGSCC_NPM-NEXT: [[PTR2:%.*]] = tail call align 8 i32* @unknown() -; IS__CGSCC_NPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone [[PTR0]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC_NPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR2]] -; IS__CGSCC_NPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR2]] -; IS__CGSCC_NPM-NEXT: ret void +; IS__CGSCC____-LABEL: define {{[^@]+}}@test8_helper() { +; IS__CGSCC____-NEXT: [[PTR0:%.*]] = tail call i32* @unknown() +; IS__CGSCC____-NEXT: [[PTR1:%.*]] = tail call align 4 i32* @unknown() +; IS__CGSCC____-NEXT: [[PTR2:%.*]] = tail call align 8 i32* @unknown() +; IS__CGSCC____-NEXT: tail call void @test8(i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone [[PTR0]]) #[[ATTR2:[0-9]+]] +; IS__CGSCC____-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR2]] +; IS__CGSCC____-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR2]] +; IS__CGSCC____-NEXT: ret void ; %ptr0 = tail call i32* @unknown() %ptr1 = tail call align 4 i32* @unknown() @@ -462,21 +361,13 @@ ; IS__TUNIT____-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) #[[ATTR1]] ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test8 -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture readnone align 4 [[A:%.*]], i32* noalias nocapture readnone align 4 [[B:%.*]], i32* noalias nocapture readnone [[C:%.*]]) #[[ATTR3]] { -; IS__CGSCC_OPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) #[[ATTR3]] -; IS__CGSCC_OPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) #[[ATTR3]] -; IS__CGSCC_OPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) #[[ATTR3]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nounwind -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test8 -; IS__CGSCC_NPM-SAME: (i32* noalias nocapture readnone align 4 [[A:%.*]], i32* noalias nocapture readnone align 4 [[B:%.*]], i32* noalias nocapture readnone [[C:%.*]]) #[[ATTR2]] { -; IS__CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) #[[ATTR2]] -; IS__CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) #[[ATTR2]] -; IS__CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) #[[ATTR2]] -; IS__CGSCC_NPM-NEXT: ret void +; IS__CGSCC____: Function Attrs: nounwind +; IS__CGSCC____-LABEL: define {{[^@]+}}@test8 +; IS__CGSCC____-SAME: (i32* noalias nocapture readnone align 4 [[A:%.*]], i32* noalias nocapture readnone align 4 [[B:%.*]], i32* noalias nocapture readnone [[C:%.*]]) #[[ATTR2]] { +; IS__CGSCC____-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) #[[ATTR2]] +; IS__CGSCC____-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) #[[ATTR2]] +; IS__CGSCC____-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) #[[ATTR2]] +; IS__CGSCC____-NEXT: ret void ; call void @user_i32_ptr(i32* %a) call void @user_i32_ptr(i32* %b) @@ -523,43 +414,24 @@ ; IS__TUNIT____-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] ; IS__TUNIT____-NEXT: ret i32* [[PHI]] ; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test10a -; IS__CGSCC_OPM-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_OPM: t: -; IS__CGSCC_OPM-NEXT: [[R:%.*]] = call align 32 i32* @test10a(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[R]], align 32 -; IS__CGSCC_OPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__CGSCC_OPM-NEXT: br label [[E:%.*]] -; IS__CGSCC_OPM: f: -; IS__CGSCC_OPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__CGSCC_OPM-NEXT: store i32 -1, i32* [[G1]], align 32 -; IS__CGSCC_OPM-NEXT: br label [[E]] -; IS__CGSCC_OPM: e: -; IS__CGSCC_OPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] -; IS__CGSCC_OPM-NEXT: ret i32* [[PHI]] -; -; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test10a -; IS__CGSCC_NPM-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_NPM: t: -; IS__CGSCC_NPM-NEXT: [[R:%.*]] = call align 32 i32* @test10a(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR3]] -; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[R]], align 32 -; IS__CGSCC_NPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__CGSCC_NPM-NEXT: br label [[E:%.*]] -; IS__CGSCC_NPM: f: -; IS__CGSCC_NPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__CGSCC_NPM-NEXT: store i32 -1, i32* [[G1]], align 32 -; IS__CGSCC_NPM-NEXT: br label [[E]] -; IS__CGSCC_NPM: e: -; IS__CGSCC_NPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] -; IS__CGSCC_NPM-NEXT: ret i32* [[PHI]] +; IS__CGSCC____: Function Attrs: nofree nosync nounwind +; IS__CGSCC____-LABEL: define {{[^@]+}}@test10a +; IS__CGSCC____-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3:[0-9]+]] { +; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 +; IS__CGSCC____-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 +; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC____: t: +; IS__CGSCC____-NEXT: [[R:%.*]] = call align 32 i32* @test10a(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR3]] +; IS__CGSCC____-NEXT: store i32 1, i32* [[R]], align 32 +; IS__CGSCC____-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; IS__CGSCC____-NEXT: br label [[E:%.*]] +; IS__CGSCC____: f: +; IS__CGSCC____-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; IS__CGSCC____-NEXT: store i32 -1, i32* [[G1]], align 32 +; IS__CGSCC____-NEXT: br label [[E]] +; IS__CGSCC____: e: +; IS__CGSCC____-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] +; IS__CGSCC____-NEXT: ret i32* [[PHI]] ; %l = load i32, i32* %p %c = icmp eq i32 %l, 0 @@ -604,43 +476,24 @@ ; IS__TUNIT____-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] ; IS__TUNIT____-NEXT: ret i32* [[PHI]] ; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test10b -; IS__CGSCC_OPM-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_OPM: t: -; IS__CGSCC_OPM-NEXT: [[R:%.*]] = call align 32 i32* @test10b(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[R]], align 32 -; IS__CGSCC_OPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__CGSCC_OPM-NEXT: br label [[E:%.*]] -; IS__CGSCC_OPM: f: -; IS__CGSCC_OPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8 -; IS__CGSCC_OPM-NEXT: store i32 -1, i32* [[G1]], align 32 -; IS__CGSCC_OPM-NEXT: br label [[E]] -; IS__CGSCC_OPM: e: -; IS__CGSCC_OPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] -; IS__CGSCC_OPM-NEXT: ret i32* [[PHI]] -; -; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test10b -; IS__CGSCC_NPM-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3]] { -; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_NPM: t: -; IS__CGSCC_NPM-NEXT: [[R:%.*]] = call align 32 i32* @test10b(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR3]] -; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[R]], align 32 -; IS__CGSCC_NPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__CGSCC_NPM-NEXT: br label [[E:%.*]] -; IS__CGSCC_NPM: f: -; IS__CGSCC_NPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8 -; IS__CGSCC_NPM-NEXT: store i32 -1, i32* [[G1]], align 32 -; IS__CGSCC_NPM-NEXT: br label [[E]] -; IS__CGSCC_NPM: e: -; IS__CGSCC_NPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] -; IS__CGSCC_NPM-NEXT: ret i32* [[PHI]] +; IS__CGSCC____: Function Attrs: nofree nosync nounwind +; IS__CGSCC____-LABEL: define {{[^@]+}}@test10b +; IS__CGSCC____-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3]] { +; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 +; IS__CGSCC____-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 +; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC____: t: +; IS__CGSCC____-NEXT: [[R:%.*]] = call align 32 i32* @test10b(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR3]] +; IS__CGSCC____-NEXT: store i32 1, i32* [[R]], align 32 +; IS__CGSCC____-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; IS__CGSCC____-NEXT: br label [[E:%.*]] +; IS__CGSCC____: f: +; IS__CGSCC____-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8 +; IS__CGSCC____-NEXT: store i32 -1, i32* [[G1]], align 32 +; IS__CGSCC____-NEXT: br label [[E]] +; IS__CGSCC____: e: +; IS__CGSCC____-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] +; IS__CGSCC____-NEXT: ret i32* [[PHI]] ; %l = load i32, i32* %p %c = icmp eq i32 %l, 0 @@ -661,26 +514,19 @@ define i64 @test11(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test11 ; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR3:[0-9]+]] { ; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* ; IS__TUNIT____-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8 ; IS__TUNIT____-NEXT: ret i64 [[RET]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test11 -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8 -; IS__CGSCC_OPM-NEXT: ret i64 [[RET]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test11 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8 -; IS__CGSCC_NPM-NEXT: ret i64 [[RET]] +; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@test11 +; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR4:[0-9]+]] { +; IS__CGSCC____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; IS__CGSCC____-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8 +; IS__CGSCC____-NEXT: ret i64 [[RET]] ; %p-cast = bitcast i32* %p to i64* %ret = load i64, i64* %p-cast, align 8 @@ -692,7 +538,7 @@ ; FXIME: %p should have nonnull define i64 @test12-1(i32* align 4 %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-1 ; IS__TUNIT____-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR3]] { ; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* @@ -701,23 +547,14 @@ ; IS__TUNIT____-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16 ; IS__TUNIT____-NEXT: ret i64 [[RET]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-1 -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR5]] { -; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16 -; IS__CGSCC_OPM-NEXT: ret i64 [[RET]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-1 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR4]] { -; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16 -; IS__CGSCC_NPM-NEXT: ret i64 [[RET]] +; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@test12-1 +; IS__CGSCC____-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR4]] { +; IS__CGSCC____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; IS__CGSCC____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; IS__CGSCC____-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16 +; IS__CGSCC____-NEXT: ret i64 [[RET]] ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 1 @@ -727,7 +564,7 @@ } define i64 @test12-2(i32* align 4 %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-2 ; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR3]] { ; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* @@ -735,21 +572,13 @@ ; IS__TUNIT____-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16 ; IS__TUNIT____-NEXT: ret i64 [[RET]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-2 -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] { -; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16 -; IS__CGSCC_OPM-NEXT: ret i64 [[RET]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-2 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR4]] { -; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16 -; IS__CGSCC_NPM-NEXT: ret i64 [[RET]] +; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@test12-2 +; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR4]] { +; IS__CGSCC____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; IS__CGSCC____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; IS__CGSCC____-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16 +; IS__CGSCC____-NEXT: ret i64 [[RET]] ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 0 @@ -759,7 +588,7 @@ ; FXIME: %p should have nonnull define void @test12-3(i32* align 4 %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-3 ; IS__TUNIT____-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR4:[0-9]+]] { ; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* @@ -768,23 +597,14 @@ ; IS__TUNIT____-NEXT: store i64 0, i64* [[ARRAYIDX1]], align 16 ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-3 -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 -; IS__CGSCC_OPM-NEXT: store i64 0, i64* [[ARRAYIDX1]], align 16 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-3 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 -; IS__CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX1]], align 16 -; IS__CGSCC_NPM-NEXT: ret void +; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@test12-3 +; IS__CGSCC____-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR5:[0-9]+]] { +; IS__CGSCC____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; IS__CGSCC____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; IS__CGSCC____-NEXT: store i64 0, i64* [[ARRAYIDX1]], align 16 +; IS__CGSCC____-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 1 @@ -794,7 +614,7 @@ } define void @test12-4(i32* align 4 %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-4 ; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR4]] { ; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* @@ -802,21 +622,13 @@ ; IS__TUNIT____-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16 ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-4 -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR6]] { -; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; IS__CGSCC_OPM-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-4 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] { -; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; IS__CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16 -; IS__CGSCC_NPM-NEXT: ret void +; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@test12-4 +; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] { +; IS__CGSCC____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; IS__CGSCC____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; IS__CGSCC____-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16 +; IS__CGSCC____-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 0 @@ -836,23 +648,14 @@ ; IS__TUNIT____-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX1]]) #[[ATTR5]] ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-5 -; IS__CGSCC_OPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 -; IS__CGSCC_OPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX1]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-5 -; IS__CGSCC_NPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 -; IS__CGSCC_NPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX1]]) #[[ATTR6]] -; IS__CGSCC_NPM-NEXT: ret void +; IS__CGSCC____: Function Attrs: nounwind willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@test12-5 +; IS__CGSCC____-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR6:[0-9]+]] { +; IS__CGSCC____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; IS__CGSCC____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; IS__CGSCC____-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX1]]) #[[ATTR6]] +; IS__CGSCC____-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 1 @@ -870,21 +673,13 @@ ; IS__TUNIT____-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) #[[ATTR5]] ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-6 -; IS__CGSCC_OPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR7]] { -; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; IS__CGSCC_OPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-6 -; IS__CGSCC_NPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR6]] { -; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; IS__CGSCC_NPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) #[[ATTR6]] -; IS__CGSCC_NPM-NEXT: ret void +; IS__CGSCC____: Function Attrs: nounwind willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@test12-6 +; IS__CGSCC____-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR6]] { +; IS__CGSCC____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; IS__CGSCC____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; IS__CGSCC____-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) #[[ATTR6]] +; IS__CGSCC____-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 0 @@ -893,7 +688,7 @@ } define void @test13(i1 %c, i32* align 32 %dst) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; IS__TUNIT____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@test13 ; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR6:[0-9]+]] { ; IS__TUNIT____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] @@ -906,31 +701,18 @@ ; IS__TUNIT____-NEXT: store i32 0, i32* [[PTR]], align 32 ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC_OPM: truebb: -; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_OPM: falsebb: -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ null, [[FALSEBB]] ] -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test13 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC_NPM: truebb: -; IS__CGSCC_NPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_NPM: falsebb: -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ null, [[FALSEBB]] ] -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__CGSCC_NPM-NEXT: ret void +; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@test13 +; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR7:[0-9]+]] { +; IS__CGSCC____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; IS__CGSCC____: truebb: +; IS__CGSCC____-NEXT: br label [[END:%.*]] +; IS__CGSCC____: falsebb: +; IS__CGSCC____-NEXT: br label [[END]] +; IS__CGSCC____: end: +; IS__CGSCC____-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ null, [[FALSEBB]] ] +; IS__CGSCC____-NEXT: store i32 0, i32* [[PTR]], align 32 +; IS__CGSCC____-NEXT: ret void ; br i1 %c, label %truebb, label %falsebb truebb: @@ -944,7 +726,7 @@ } define void @test13-1(i1 %c, i32* align 32 %dst) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@test13-1 ; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR7:[0-9]+]] { ; IS__TUNIT____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] @@ -957,31 +739,18 @@ ; IS__TUNIT____-NEXT: store i32 0, i32* [[PTR]], align 16 ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13-1 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC_OPM: truebb: -; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_OPM: falsebb: -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 48 to i32*), [[FALSEBB]] ] -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 16 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test13-1 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC_NPM: truebb: -; IS__CGSCC_NPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_NPM: falsebb: -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 48 to i32*), [[FALSEBB]] ] -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[PTR]], align 16 -; IS__CGSCC_NPM-NEXT: ret void +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@test13-1 +; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] { +; IS__CGSCC____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; IS__CGSCC____: truebb: +; IS__CGSCC____-NEXT: br label [[END:%.*]] +; IS__CGSCC____: falsebb: +; IS__CGSCC____-NEXT: br label [[END]] +; IS__CGSCC____: end: +; IS__CGSCC____-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 48 to i32*), [[FALSEBB]] ] +; IS__CGSCC____-NEXT: store i32 0, i32* [[PTR]], align 16 +; IS__CGSCC____-NEXT: ret void ; br i1 %c, label %truebb, label %falsebb truebb: @@ -995,7 +764,7 @@ } define void @test13-2(i1 %c, i32* align 32 %dst) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@test13-2 ; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR7]] { ; IS__TUNIT____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] @@ -1008,31 +777,18 @@ ; IS__TUNIT____-NEXT: store i32 0, i32* [[PTR]], align 32 ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13-2 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC_OPM: truebb: -; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_OPM: falsebb: -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 160 to i32*), [[FALSEBB]] ] -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test13-2 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC_NPM: truebb: -; IS__CGSCC_NPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_NPM: falsebb: -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 160 to i32*), [[FALSEBB]] ] -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__CGSCC_NPM-NEXT: ret void +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@test13-2 +; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { +; IS__CGSCC____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; IS__CGSCC____: truebb: +; IS__CGSCC____-NEXT: br label [[END:%.*]] +; IS__CGSCC____: falsebb: +; IS__CGSCC____-NEXT: br label [[END]] +; IS__CGSCC____: end: +; IS__CGSCC____-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 160 to i32*), [[FALSEBB]] ] +; IS__CGSCC____-NEXT: store i32 0, i32* [[PTR]], align 32 +; IS__CGSCC____-NEXT: ret void ; br i1 %c, label %truebb, label %falsebb truebb: @@ -1046,7 +802,7 @@ } define void @test13-3(i1 %c, i32* align 32 %dst) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@test13-3 ; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR7]] { ; IS__TUNIT____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] @@ -1059,31 +815,18 @@ ; IS__TUNIT____-NEXT: store i32 0, i32* [[PTR]], align 32 ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13-3 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC_OPM: truebb: -; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_OPM: falsebb: -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 128 to i32*), [[FALSEBB]] ] -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test13-3 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC_NPM: truebb: -; IS__CGSCC_NPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_NPM: falsebb: -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 128 to i32*), [[FALSEBB]] ] -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__CGSCC_NPM-NEXT: ret void +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@test13-3 +; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { +; IS__CGSCC____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; IS__CGSCC____: truebb: +; IS__CGSCC____-NEXT: br label [[END:%.*]] +; IS__CGSCC____: falsebb: +; IS__CGSCC____-NEXT: br label [[END]] +; IS__CGSCC____: end: +; IS__CGSCC____-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 128 to i32*), [[FALSEBB]] ] +; IS__CGSCC____-NEXT: store i32 0, i32* [[PTR]], align 32 +; IS__CGSCC____-NEXT: ret void ; br i1 %c, label %truebb, label %falsebb truebb: @@ -1098,45 +841,33 @@ ; Don't crash on ptr2int/int2ptr uses. define i64 @ptr2int(i32* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@ptr2int ; IS__TUNIT____-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR8:[0-9]+]] { ; IS__TUNIT____-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64 ; IS__TUNIT____-NEXT: ret i64 [[P2I]] ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ptr2int -; IS__CGSCC_OPM-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR10:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] 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 {{[^@]+}}@ptr2int -; IS__CGSCC_NPM-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64 -; IS__CGSCC_NPM-NEXT: ret i64 [[P2I]] +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@ptr2int +; IS__CGSCC____-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR9:[0-9]+]] { +; IS__CGSCC____-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64 +; IS__CGSCC____-NEXT: ret i64 [[P2I]] ; %p2i = ptrtoint i32* %p to i64 ret i64 %p2i } define i64* @int2ptr(i64 %i) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@int2ptr ; IS__TUNIT____-SAME: (i64 [[I:%.*]]) #[[ATTR8]] { ; IS__TUNIT____-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64* ; IS__TUNIT____-NEXT: ret i64* [[I2P]] ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@int2ptr -; IS__CGSCC_OPM-SAME: (i64 [[I:%.*]]) #[[ATTR10]] { -; IS__CGSCC_OPM-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64* -; IS__CGSCC_OPM-NEXT: ret i64* [[I2P]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@int2ptr -; IS__CGSCC_NPM-SAME: (i64 [[I:%.*]]) #[[ATTR9]] { -; IS__CGSCC_NPM-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64* -; IS__CGSCC_NPM-NEXT: ret i64* [[I2P]] +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@int2ptr +; IS__CGSCC____-SAME: (i64 [[I:%.*]]) #[[ATTR9]] { +; IS__CGSCC____-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64* +; IS__CGSCC____-NEXT: ret i64* [[I2P]] ; %i2p = inttoptr i64 %i to i64* ret i64* %i2p @@ -1144,23 +875,17 @@ ; Use the store alignment only for the pointer operand. define void @aligned_store(i8* %Value, i8** %Ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@aligned_store ; IS__TUNIT____-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR4]] { ; IS__TUNIT____-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32 ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@aligned_store -; IS__CGSCC_OPM-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR6]] { -; IS__CGSCC_OPM-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@aligned_store -; IS__CGSCC_NPM-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR5]] { -; IS__CGSCC_NPM-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32 -; IS__CGSCC_NPM-NEXT: ret void +; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@aligned_store +; IS__CGSCC____-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR5]] { +; IS__CGSCC____-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32 +; IS__CGSCC____-NEXT: ret void ; store i8* %Value, i8** %Ptr, align 32 ret void @@ -1180,26 +905,19 @@ } define void @align_store_after_bc(i32* align 2048 %arg) { ; -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@align_store_after_bc ; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR4]] { ; IS__TUNIT____-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8* ; IS__TUNIT____-NEXT: store i8 0, i8* [[BC]], align 2048 ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@align_store_after_bc -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR6]] { -; IS__CGSCC_OPM-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8* -; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[BC]], align 2048 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@align_store_after_bc -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR5]] { -; IS__CGSCC_NPM-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8* -; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[BC]], align 2048 -; IS__CGSCC_NPM-NEXT: ret void +; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@align_store_after_bc +; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR5]] { +; IS__CGSCC____-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8* +; IS__CGSCC____-NEXT: store i8 0, i8* [[BC]], align 2048 +; IS__CGSCC____-NEXT: ret void ; %bc = bitcast i32* %arg to i8* store i8 0, i8* %bc @@ -1210,60 +928,43 @@ ; we cannot also put on the caller. @cnd = external global i1 define i32 @musttail_callee_1(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@musttail_callee_1 ; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR3]] { ; IS__TUNIT____-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32 ; IS__TUNIT____-NEXT: ret i32 [[V]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@musttail_callee_1 -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR5]] { -; IS__CGSCC_OPM-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32 -; IS__CGSCC_OPM-NEXT: ret i32 [[V]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@musttail_callee_1 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { -; IS__CGSCC_NPM-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32 -; IS__CGSCC_NPM-NEXT: ret i32 [[V]] +; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@musttail_callee_1 +; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; IS__CGSCC____-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32 +; IS__CGSCC____-NEXT: ret i32 [[V]] ; %v = load i32, i32* %p, align 32 ret i32 %v } define i32 @musttail_caller_1(i32* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@musttail_caller_1 ; IS__TUNIT____-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR9:[0-9]+]] { ; IS__TUNIT____-NEXT: [[C:%.*]] = load i1, i1* @cnd, align 1 ; IS__TUNIT____-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]] ; IS__TUNIT____: mt: -; IS__TUNIT____-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree readonly [[P]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree readonly [[P]]) #[[ATTR10:[0-9]+]] ; IS__TUNIT____-NEXT: ret i32 [[V]] ; IS__TUNIT____: exit: ; IS__TUNIT____-NEXT: ret i32 0 ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@musttail_caller_1 -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR11:[0-9]+]] { -; 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]]) #[[ATTR12:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 [[V]] -; IS__CGSCC_OPM: exit: -; IS__CGSCC_OPM-NEXT: ret i32 0 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@musttail_caller_1 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR10:[0-9]+]] { -; 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]]) #[[ATTR11:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 [[V]] -; IS__CGSCC_NPM: exit: -; IS__CGSCC_NPM-NEXT: ret i32 0 +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@musttail_caller_1 +; IS__CGSCC____-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; IS__CGSCC____-NEXT: [[C:%.*]] = load i1, i1* @cnd, align 1 +; IS__CGSCC____-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]] +; IS__CGSCC____: mt: +; IS__CGSCC____-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR11:[0-9]+]] +; IS__CGSCC____-NEXT: ret i32 [[V]] +; IS__CGSCC____: exit: +; IS__CGSCC____-NEXT: ret i32 0 ; %c = load i1, i1* @cnd br i1 %c, label %mt, label %exit @@ -1291,37 +992,21 @@ ; IS__TUNIT____-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) #[[ATTR1]] ; IS__TUNIT____-NEXT: ret i32* [[RETVAL_0]] ; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@checkAndAdvance -; IS__CGSCC_OPM-SAME: (i32* noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 16 -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] -; IS__CGSCC_OPM: if.then: -; IS__CGSCC_OPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 4 -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call nonnull align 16 i32* @checkAndAdvance(i32* nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR3]] -; IS__CGSCC_OPM-NEXT: br label [[RETURN]] -; IS__CGSCC_OPM: return: -; IS__CGSCC_OPM-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ] -; IS__CGSCC_OPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) #[[ATTR3]] -; IS__CGSCC_OPM-NEXT: ret i32* [[RETVAL_0]] -; -; IS__CGSCC_NPM: Function Attrs: nounwind -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@checkAndAdvance -; IS__CGSCC_NPM-SAME: (i32* noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 16 -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] -; IS__CGSCC_NPM: if.then: -; IS__CGSCC_NPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 4 -; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call nonnull align 16 i32* @checkAndAdvance(i32* nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR2]] -; IS__CGSCC_NPM-NEXT: br label [[RETURN]] -; IS__CGSCC_NPM: return: -; IS__CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ] -; IS__CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) #[[ATTR2]] -; IS__CGSCC_NPM-NEXT: ret i32* [[RETVAL_0]] +; IS__CGSCC____: Function Attrs: nounwind +; IS__CGSCC____-LABEL: define {{[^@]+}}@checkAndAdvance +; IS__CGSCC____-SAME: (i32* noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 16 +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0 +; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] +; IS__CGSCC____: if.then: +; IS__CGSCC____-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 4 +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call nonnull align 16 i32* @checkAndAdvance(i32* nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR2]] +; IS__CGSCC____-NEXT: br label [[RETURN]] +; IS__CGSCC____: return: +; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ] +; IS__CGSCC____-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) #[[ATTR2]] +; IS__CGSCC____-NEXT: ret i32* [[RETVAL_0]] ; entry: %0 = load i32, i32* %p, align 4 @@ -1357,41 +1042,28 @@ attributes #1 = { uwtable noinline } attributes #2 = { null_pointer_is_valid } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } ; IS__TUNIT____: attributes #[[ATTR1]] = { nounwind } ; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind } -; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } ; IS__TUNIT____: attributes #[[ATTR5]] = { nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR6]] = { argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR8]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR9]] = { nofree nosync nounwind readonly willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { noinline nounwind uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nofree nosync nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR8]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR12]] = { readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR6]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR10]] = { nofree nosync nounwind readonly willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { noinline nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR6]] = { nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR7]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR11]] = { readonly willreturn } +; IS__CGSCC____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; IS__CGSCC____: attributes #[[ATTR1]] = { noinline nounwind uwtable } +; IS__CGSCC____: attributes #[[ATTR2]] = { nounwind } +; IS__CGSCC____: attributes #[[ATTR3]] = { nofree nosync nounwind } +; IS__CGSCC____: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR6]] = { nounwind willreturn } +; IS__CGSCC____: attributes #[[ATTR7]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes #[[ATTR11]] = { readonly willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/allow_list.ll b/llvm/test/Transforms/Attributor/allow_list.ll --- a/llvm/test/Transforms/Attributor/allow_list.ll +++ b/llvm/test/Transforms/Attributor/allow_list.ll @@ -57,7 +57,7 @@ ; CHECK_DISABLED_FUNCTION-NEXT: [[TMP1:%.*]] = call i32 @range_test(i32 123) ; CHECK_DISABLED_FUNCTION-NEXT: ret i32 [[TMP1]] ; -; CHECK_ENABLED_FUNCTION: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; CHECK_ENABLED_FUNCTION: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn ; CHECK_ENABLED_FUNCTION-LABEL: define {{[^@]+}}@range_use1 ; CHECK_ENABLED_FUNCTION-SAME: () #[[ATTR1:[0-9]+]] { ; CHECK_ENABLED_FUNCTION-NEXT: ret i32 1 @@ -74,9 +74,9 @@ ; CHECK_DISABLED-NEXT: [[TMP1:%.*]] = call i32 @range_test(i32 123) ; CHECK_DISABLED-NEXT: ret i32 [[TMP1]] ; -; CHECK_ENABLED: Function Attrs: noinline nounwind uwtable +; CHECK_ENABLED: Function Attrs: noinline norecurse nounwind uwtable ; CHECK_ENABLED-LABEL: define {{[^@]+}}@range_use2 -; CHECK_ENABLED-SAME: () #[[ATTR0]] { +; CHECK_ENABLED-SAME: () #[[ATTR1:[0-9]+]] { ; CHECK_ENABLED-NEXT: ret i32 1 ; ; CHECK_DISABLED_FUNCTION: Function Attrs: noinline nounwind uwtable @@ -100,10 +100,11 @@ ; CHECK_DISABLED: attributes #[[ATTR0]] = { noinline nounwind uwtable } ;. ; CHECK_ENABLED: attributes #[[ATTR0]] = { noinline nounwind uwtable } +; CHECK_ENABLED: attributes #[[ATTR1]] = { noinline norecurse nounwind uwtable } ;. ; CHECK_DISABLED_FUNCTION: attributes #[[ATTR0]] = { noinline nounwind uwtable } ;. ; CHECK_ENABLED_FUNCTION: attributes #[[ATTR0]] = { noinline nounwind readnone uwtable } -; CHECK_ENABLED_FUNCTION: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; CHECK_ENABLED_FUNCTION: attributes #[[ATTR1]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } ; CHECK_ENABLED_FUNCTION: attributes #[[ATTR2]] = { noinline nounwind uwtable } ;. diff --git a/llvm/test/Transforms/Attributor/alwaysinline.ll b/llvm/test/Transforms/Attributor/alwaysinline.ll --- a/llvm/test/Transforms/Attributor/alwaysinline.ll +++ b/llvm/test/Transforms/Attributor/alwaysinline.ll @@ -10,34 +10,22 @@ ; the function is not exactly defined, and marked alwaysinline and can be inlined, ; so the function can be analyzed define linkonce void @inner1() alwaysinline { -; IS__TUNIT____: Function Attrs: alwaysinline nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@inner1 -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: alwaysinline nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@inner1 -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: alwaysinline nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@inner1 +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret void ; entry: ret void } define void @outer1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@outer1 -; IS__TUNIT____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@outer1 -; IS__CGSCC____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@outer1 +; CHECK-SAME: () #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret void ; entry: call void @inner1() @@ -57,9 +45,11 @@ ; CHECK-NOT: Function Attrs define i32 @outer2() { -; CHECK-LABEL: define {{[^@]+}}@outer2() { +; CHECK: Function Attrs: norecurse +; CHECK-LABEL: define {{[^@]+}}@outer2 +; CHECK-SAME: () #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[R:%.*]] = call i32 @inner2() #[[ATTR2:[0-9]+]] +; CHECK-NEXT: [[R:%.*]] = call i32 @inner2() #[[ATTR3:[0-9]+]] ; CHECK-NEXT: ret i32 [[R]] ; entry: @@ -73,7 +63,7 @@ define linkonce i32 @inner3(i8* %addr) alwaysinline { ; CHECK: Function Attrs: alwaysinline ; CHECK-LABEL: define {{[^@]+}}@inner3 -; CHECK-SAME: (i8* [[ADDR:%.*]]) #[[ATTR2]] { +; CHECK-SAME: (i8* [[ADDR:%.*]]) #[[ATTR3]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: indirectbr i8* [[ADDR]], [label [[ONE:%.*]], label %two] ; CHECK: one: @@ -92,8 +82,9 @@ } define i32 @outer3(i32 %x) { +; CHECK: Function Attrs: norecurse ; CHECK-LABEL: define {{[^@]+}}@outer3 -; CHECK-SAME: (i32 [[X:%.*]]) { +; CHECK-SAME: (i32 [[X:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[X]], 42 ; CHECK-NEXT: [[ADDR:%.*]] = select i1 [[CMP]], i8* blockaddress(@inner3, [[ONE:%.*]]), i8* blockaddress(@inner3, [[TWO:%.*]]) ; CHECK-NEXT: [[CALL:%.*]] = call i32 @inner3(i8* [[ADDR]]) @@ -105,11 +96,8 @@ ret i32 %call } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { alwaysinline nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { alwaysinline } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { alwaysinline nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { alwaysinline } +; CHECK: attributes #[[ATTR0]] = { alwaysinline nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR2]] = { norecurse } +; CHECK: attributes #[[ATTR3]] = { alwaysinline } ;. diff --git a/llvm/test/Transforms/Attributor/cb_liveness_disabled.ll b/llvm/test/Transforms/Attributor/cb_liveness_disabled.ll --- a/llvm/test/Transforms/Attributor/cb_liveness_disabled.ll +++ b/llvm/test/Transforms/Attributor/cb_liveness_disabled.ll @@ -154,7 +154,7 @@ ; IS__TUNIT_____: !0 = !{i32 0, i32 101} ; IS__TUNIT_____: !1 = !{i32 100, i32 201} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone sspstrong uwtable willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone sspstrong uwtable willreturn } ; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone sspstrong uwtable willreturn } diff --git a/llvm/test/Transforms/Attributor/cb_liveness_enabled.ll b/llvm/test/Transforms/Attributor/cb_liveness_enabled.ll --- a/llvm/test/Transforms/Attributor/cb_liveness_enabled.ll +++ b/llvm/test/Transforms/Attributor/cb_liveness_enabled.ll @@ -157,7 +157,7 @@ ; IS__TUNIT_____: !0 = !{i32 0, i32 101} ; IS__TUNIT_____: !1 = !{i32 100, i32 201} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone sspstrong uwtable willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone sspstrong uwtable willreturn } ; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone sspstrong uwtable willreturn } diff --git a/llvm/test/Transforms/Attributor/cb_range_disabled.ll b/llvm/test/Transforms/Attributor/cb_range_disabled.ll --- a/llvm/test/Transforms/Attributor/cb_range_disabled.ll +++ b/llvm/test/Transforms/Attributor/cb_range_disabled.ll @@ -22,17 +22,11 @@ } define i32 @test1(i32 %unknown, i32 %b) { -; IS__TUNIT____-LABEL: define {{[^@]+}}@test1 -; IS__TUNIT____-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR0]], !range [[RNG0:![0-9]+]] -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] -; IS__TUNIT____-NEXT: ret i32 [[TMP2]] -; -; IS__CGSCC____-LABEL: define {{[^@]+}}@test1 -; IS__CGSCC____-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] -; IS__CGSCC____-NEXT: ret i32 [[TMP2]] +; CHECK-LABEL: define {{[^@]+}}@test1 +; CHECK-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] +; CHECK-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] +; CHECK-NEXT: ret i32 [[TMP2]] ; %1 = call i32 @test_range(i32 %unknown) %2 = sub nsw i32 %1, %b @@ -40,17 +34,11 @@ } define i32 @test2(i32 %unknown, i32 %b) { -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT____-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR0]], !range [[RNG0]] -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] -; IS__TUNIT____-NEXT: ret i32 [[TMP2]] -; -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC____-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1]], !range [[RNG0]] -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] -; IS__CGSCC____-NEXT: ret i32 [[TMP2]] +; CHECK-LABEL: define {{[^@]+}}@test2 +; CHECK-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1]], !range [[RNG0]] +; CHECK-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] +; CHECK-NEXT: ret i32 [[TMP2]] ; %1 = call i32 @test_range(i32 %unknown) %2 = add nsw i32 %1, %b @@ -131,12 +119,13 @@ ret i32 %3 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC____: attributes #[[ATTR1]] = { readnone willreturn } ;. -; NOT_CGSCC_NPM: [[META0:![0-9]+]] = !{i32 0, i32 101} +; NOT_CGSCC_NPM: [[RNG0]] = !{i32 0, i32 101} ;. ; IS__CGSCC_NPM: [[RNG0]] = !{i32 0, i32 101} ; IS__CGSCC_NPM: [[RNG1]] = !{i32 -2147483647, i32 -2147483648} diff --git a/llvm/test/Transforms/Attributor/cb_range_enabled.ll b/llvm/test/Transforms/Attributor/cb_range_enabled.ll --- a/llvm/test/Transforms/Attributor/cb_range_enabled.ll +++ b/llvm/test/Transforms/Attributor/cb_range_enabled.ll @@ -22,17 +22,11 @@ } define i32 @test1(i32 %unknown, i32 %b) { -; IS__TUNIT____-LABEL: define {{[^@]+}}@test1 -; IS__TUNIT____-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR0]], !range [[RNG0:![0-9]+]] -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] -; IS__TUNIT____-NEXT: ret i32 [[TMP2]] -; -; IS__CGSCC____-LABEL: define {{[^@]+}}@test1 -; IS__CGSCC____-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] -; IS__CGSCC____-NEXT: ret i32 [[TMP2]] +; CHECK-LABEL: define {{[^@]+}}@test1 +; CHECK-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] +; CHECK-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] +; CHECK-NEXT: ret i32 [[TMP2]] ; %1 = call i32 @test_range(i32 %unknown) %2 = sub nsw i32 %1, %b @@ -40,17 +34,11 @@ } define i32 @test2(i32 %unknown, i32 %b) { -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT____-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR0]], !range [[RNG0]] -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] -; IS__TUNIT____-NEXT: ret i32 [[TMP2]] -; -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC____-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1]], !range [[RNG0]] -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] -; IS__CGSCC____-NEXT: ret i32 [[TMP2]] +; CHECK-LABEL: define {{[^@]+}}@test2 +; CHECK-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1]], !range [[RNG0]] +; CHECK-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] +; CHECK-NEXT: ret i32 [[TMP2]] ; %1 = call i32 @test_range(i32 %unknown) %2 = add nsw i32 %1, %b @@ -88,19 +76,12 @@ ; Negative checks define i32 @test1_ncheck(i32 %unknown) { -; IS__TUNIT____-LABEL: define {{[^@]+}}@test1_ncheck -; IS__TUNIT____-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR0]], !range [[RNG1:![0-9]+]] -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 10 -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 -; IS__TUNIT____-NEXT: ret i32 [[TMP3]] -; -; IS__CGSCC____-LABEL: define {{[^@]+}}@test1_ncheck -; IS__CGSCC____-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR1]], !range [[RNG1:![0-9]+]] -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 10 -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 -; IS__CGSCC____-NEXT: ret i32 [[TMP3]] +; CHECK-LABEL: define {{[^@]+}}@test1_ncheck +; CHECK-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR1]], !range [[RNG1:![0-9]+]] +; CHECK-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 10 +; CHECK-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 +; CHECK-NEXT: ret i32 [[TMP3]] ; %1 = call i32 @test1(i32 %unknown, i32 20) %2 = icmp sle i32 %1, 10 @@ -109,19 +90,12 @@ } define i32 @test2_ncheck(i32 %unknown) { -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2_ncheck -; IS__TUNIT____-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @test2(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR0]], !range [[RNG2:![0-9]+]] -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = icmp sge i32 [[TMP1]], 30 -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 -; IS__TUNIT____-NEXT: ret i32 [[TMP3]] -; -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2_ncheck -; IS__CGSCC____-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @test2(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR1]], !range [[RNG2:![0-9]+]] -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = icmp sge i32 [[TMP1]], 30 -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 -; IS__CGSCC____-NEXT: ret i32 [[TMP3]] +; CHECK-LABEL: define {{[^@]+}}@test2_ncheck +; CHECK-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[TMP1:%.*]] = call i32 @test2(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR1]], !range [[RNG2:![0-9]+]] +; CHECK-NEXT: [[TMP2:%.*]] = icmp sge i32 [[TMP1]], 30 +; CHECK-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 +; CHECK-NEXT: ret i32 [[TMP3]] ; %1 = call i32 @test2(i32 %unknown, i32 20) %2 = icmp sge i32 %1, 30 @@ -129,12 +103,13 @@ ret i32 %3 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC____: attributes #[[ATTR1]] = { readnone willreturn } ;. -; CHECK: [[META0:![0-9]+]] = !{i32 0, i32 101} -; CHECK: [[META1:![0-9]+]] = !{i32 -20, i32 81} -; CHECK: [[META2:![0-9]+]] = !{i32 20, i32 121} +; CHECK: [[RNG0]] = !{i32 0, i32 101} +; CHECK: [[RNG1]] = !{i32 -20, i32 81} +; CHECK: [[RNG2]] = !{i32 20, i32 121} ;. 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 @@ -140,6 +140,12 @@ ; GRAPH-EMPTY: ; 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: [AAFunctionReachability] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state FunctionReachability [1,1] +; GRAPH-EMPTY: +; GRAPH-NEXT: [AACallEdges] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state CallEdges[0,1] +; GRAPH-EMPTY: +; GRAPH-NEXT: [AACallEdges] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state CallEdges[0,1] +; GRAPH-EMPTY: ; GRAPH-NEXT: [AAUndefinedBehavior] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state undefined-behavior ; GRAPH-EMPTY: ; GRAPH-NEXT: [AANoUndef] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs_arg: [@0]} with state may-undef-or-poison diff --git a/llvm/test/Transforms/Attributor/dereferenceable-1.ll b/llvm/test/Transforms/Attributor/dereferenceable-1.ll --- a/llvm/test/Transforms/Attributor/dereferenceable-1.ll +++ b/llvm/test/Transforms/Attributor/dereferenceable-1.ll @@ -11,19 +11,12 @@ ; take mininimum of return values ; define i32* @test1(i32* dereferenceable(4) %0, double* dereferenceable(8) %1, i1 zeroext %2) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test1 -; IS__TUNIT____-SAME: (i32* nofree nonnull readnone dereferenceable(4) "no-capture-maybe-returned" [[TMP0:%.*]], double* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP1:%.*]], i1 zeroext [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* -; IS__TUNIT____-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] -; IS__TUNIT____-NEXT: ret i32* [[TMP5]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test1 -; IS__CGSCC____-SAME: (i32* nofree nonnull readnone dereferenceable(4) "no-capture-maybe-returned" [[TMP0:%.*]], double* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP1:%.*]], i1 zeroext [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* -; IS__CGSCC____-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] -; IS__CGSCC____-NEXT: ret i32* [[TMP5]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test1 +; CHECK-SAME: (i32* nofree nonnull readnone dereferenceable(4) "no-capture-maybe-returned" [[TMP0:%.*]], double* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP1:%.*]], i1 zeroext [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* +; CHECK-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] +; CHECK-NEXT: ret i32* [[TMP5]] ; %4 = bitcast double* %1 to i32* %5 = select i1 %2, i32* %0, i32* %4 @@ -32,19 +25,12 @@ ; TEST 2 define i32* @test2(i32* dereferenceable_or_null(4) %0, double* dereferenceable(8) %1, i1 zeroext %2) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT____-SAME: (i32* nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP0:%.*]], double* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP1:%.*]], i1 zeroext [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* -; IS__TUNIT____-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] -; IS__TUNIT____-NEXT: ret i32* [[TMP5]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC____-SAME: (i32* nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP0:%.*]], double* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP1:%.*]], i1 zeroext [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* -; IS__CGSCC____-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] -; IS__CGSCC____-NEXT: ret i32* [[TMP5]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test2 +; CHECK-SAME: (i32* nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP0:%.*]], double* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP1:%.*]], i1 zeroext [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0]] { +; CHECK-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* +; CHECK-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] +; CHECK-NEXT: ret i32* [[TMP5]] ; %4 = bitcast double* %1 to i32* %5 = select i1 %2, i32* %0, i32* %4 @@ -54,55 +40,35 @@ ; TEST 3 ; GEP inbounds define i32* @test3_1(i32* dereferenceable(8) %0) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test3_1 -; IS__TUNIT____-SAME: (i32* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 -; IS__TUNIT____-NEXT: ret i32* [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test3_1 -; IS__CGSCC____-SAME: (i32* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 -; IS__CGSCC____-NEXT: ret i32* [[RET]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test3_1 +; CHECK-SAME: (i32* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; CHECK-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 +; CHECK-NEXT: ret i32* [[RET]] ; %ret = getelementptr inbounds i32, i32* %0, i64 1 ret i32* %ret } define i32* @test3_2(i32* dereferenceable_or_null(32) %0) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test3_2 -; IS__TUNIT____-SAME: (i32* nofree readnone dereferenceable_or_null(32) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 4 -; IS__TUNIT____-NEXT: ret i32* [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test3_2 -; IS__CGSCC____-SAME: (i32* nofree readnone dereferenceable_or_null(32) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 4 -; IS__CGSCC____-NEXT: ret i32* [[RET]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test3_2 +; CHECK-SAME: (i32* nofree readnone dereferenceable_or_null(32) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; CHECK-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 4 +; CHECK-NEXT: ret i32* [[RET]] ; %ret = getelementptr inbounds i32, i32* %0, i64 4 ret i32* %ret } define i32* @test3_3(i32* dereferenceable(8) %0, i32* dereferenceable(16) %1, i1 %2) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test3_3 -; IS__TUNIT____-SAME: (i32* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree nonnull readnone dereferenceable(16) "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET1:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 -; IS__TUNIT____-NEXT: [[RET2:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 2 -; IS__TUNIT____-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[RET1]], i32* [[RET2]] -; IS__TUNIT____-NEXT: ret i32* [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test3_3 -; IS__CGSCC____-SAME: (i32* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree nonnull readnone dereferenceable(16) "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[RET1:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 -; IS__CGSCC____-NEXT: [[RET2:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 2 -; IS__CGSCC____-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[RET1]], i32* [[RET2]] -; IS__CGSCC____-NEXT: ret i32* [[RET]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test3_3 +; CHECK-SAME: (i32* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree nonnull readnone dereferenceable(16) "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0]] { +; CHECK-NEXT: [[RET1:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 +; CHECK-NEXT: [[RET2:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 2 +; CHECK-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[RET1]], i32* [[RET2]] +; CHECK-NEXT: ret i32* [[RET]] ; %ret1 = getelementptr inbounds i32, i32* %0, i64 1 %ret2 = getelementptr inbounds i32, i32* %1, i64 2 @@ -114,15 +80,10 @@ ; Better than known in IR. define dereferenceable(4) i32* @test4(i32* dereferenceable(8) %0) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test4 -; IS__TUNIT____-SAME: (i32* nofree nonnull readnone returned dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* [[TMP0]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test4 -; IS__CGSCC____-SAME: (i32* nofree nonnull readnone returned dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* [[TMP0]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test4 +; CHECK-SAME: (i32* nofree nonnull readnone returned dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; CHECK-NEXT: ret i32* [[TMP0]] ; ret i32* %0 } @@ -321,19 +282,12 @@ ; FIXME: This should have a return dereferenceable(8) but we need to make sure it will work in loops as well. define i32* @test_for_minus_index(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_for_minus_index -; IS__TUNIT____-SAME: (i32* nofree nonnull writeonly align 4 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 -2 -; IS__TUNIT____-NEXT: store i32 1, i32* [[Q]], align 4 -; IS__TUNIT____-NEXT: ret i32* [[Q]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_for_minus_index -; IS__CGSCC____-SAME: (i32* nofree nonnull writeonly align 4 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 -2 -; IS__CGSCC____-NEXT: store i32 1, i32* [[Q]], align 4 -; IS__CGSCC____-NEXT: ret i32* [[Q]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@test_for_minus_index +; CHECK-SAME: (i32* nofree nonnull writeonly align 4 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 -2 +; CHECK-NEXT: store i32 1, i32* [[Q]], align 4 +; CHECK-NEXT: ret i32* [[Q]] ; %q = getelementptr inbounds i32, i32* %p, i32 -2 store i32 1, i32* %q @@ -341,17 +295,11 @@ } define void @deref_or_null_and_nonnull(i32* dereferenceable_or_null(100) %0) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@deref_or_null_and_nonnull -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(100) [[TMP0:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: store i32 1, i32* [[TMP0]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@deref_or_null_and_nonnull -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(100) [[TMP0:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: store i32 1, i32* [[TMP0]], align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@deref_or_null_and_nonnull +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(100) [[TMP0:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: store i32 1, i32* [[TMP0]], align 4 +; CHECK-NEXT: ret void ; store i32 1, i32* %0 ret void @@ -366,73 +314,39 @@ ; FIXME: %ptr should be dereferenceable(31) define void @test8(i8* %ptr) #0 { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test8 -; IS__TUNIT_OPM-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: br label [[TMP1:%.*]] -; IS__TUNIT_OPM: 1: -; IS__TUNIT_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] -; IS__TUNIT_OPM-NEXT: store i8 32, i8* [[TMP3]], align 1 -; IS__TUNIT_OPM-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 -; IS__TUNIT_OPM-NEXT: br label [[TMP5]] -; IS__TUNIT_OPM: 5: -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] -; IS__TUNIT_OPM: 7: -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test8 -; IS__TUNIT_NPM-SAME: (i8* nocapture nofree nonnull writeonly dereferenceable(21) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: br label [[TMP1:%.*]] -; IS__TUNIT_NPM: 1: -; IS__TUNIT_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] -; IS__TUNIT_NPM-NEXT: store i8 32, i8* [[TMP3]], align 1 -; IS__TUNIT_NPM-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 -; IS__TUNIT_NPM-NEXT: br label [[TMP5]] -; IS__TUNIT_NPM: 5: -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] -; IS__TUNIT_NPM: 7: -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test8 -; IS__CGSCC_OPM-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br label [[TMP1:%.*]] -; IS__CGSCC_OPM: 1: -; IS__CGSCC_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] -; IS__CGSCC_OPM-NEXT: store i8 32, i8* [[TMP3]], align 1 -; IS__CGSCC_OPM-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 -; IS__CGSCC_OPM-NEXT: br label [[TMP5]] -; IS__CGSCC_OPM: 5: -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] -; IS__CGSCC_OPM: 7: -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test8 -; IS__CGSCC_NPM-SAME: (i8* nocapture nofree nonnull writeonly dereferenceable(21) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC_NPM-NEXT: br label [[TMP1:%.*]] -; IS__CGSCC_NPM: 1: -; IS__CGSCC_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] -; IS__CGSCC_NPM-NEXT: store i8 32, i8* [[TMP3]], align 1 -; IS__CGSCC_NPM-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 -; IS__CGSCC_NPM-NEXT: br label [[TMP5]] -; IS__CGSCC_NPM: 5: -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] -; IS__CGSCC_NPM: 7: -; IS__CGSCC_NPM-NEXT: ret void +; IS________OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly +; IS________OPM-LABEL: define {{[^@]+}}@test8 +; IS________OPM-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { +; IS________OPM-NEXT: br label [[TMP1:%.*]] +; IS________OPM: 1: +; IS________OPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] +; IS________OPM-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 +; IS________OPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] +; IS________OPM-NEXT: store i8 32, i8* [[TMP3]], align 1 +; IS________OPM-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 +; IS________OPM-NEXT: br label [[TMP5]] +; IS________OPM: 5: +; IS________OPM-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 +; IS________OPM-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] +; IS________OPM: 7: +; IS________OPM-NEXT: ret void +; +; IS________NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS________NPM-LABEL: define {{[^@]+}}@test8 +; IS________NPM-SAME: (i8* nocapture nofree nonnull writeonly dereferenceable(21) [[PTR:%.*]]) #[[ATTR2]] { +; IS________NPM-NEXT: br label [[TMP1:%.*]] +; IS________NPM: 1: +; IS________NPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] +; IS________NPM-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 +; IS________NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] +; IS________NPM-NEXT: store i8 32, i8* [[TMP3]], align 1 +; IS________NPM-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 +; IS________NPM-NEXT: br label [[TMP5]] +; IS________NPM: 5: +; IS________NPM-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 +; IS________NPM-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] +; IS________NPM: 7: +; IS________NPM-NEXT: ret void ; br label %1 1: ; preds = %5, %0 @@ -452,21 +366,13 @@ ; 8.2 (negative case) define void @test8_neg(i32 %i, i8* %ptr) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test8_neg -; IS__TUNIT____-SAME: (i32 [[I:%.*]], i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = sext i32 [[I]] to i64 -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP1]] -; IS__TUNIT____-NEXT: store i8 65, i8* [[TMP2]], align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test8_neg -; IS__CGSCC____-SAME: (i32 [[I:%.*]], i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = sext i32 [[I]] to i64 -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP1]] -; IS__CGSCC____-NEXT: store i8 65, i8* [[TMP2]], align 1 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@test8_neg +; CHECK-SAME: (i32 [[I:%.*]], i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: [[TMP1:%.*]] = sext i32 [[I]] to i64 +; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP1]] +; CHECK-NEXT: store i8 65, i8* [[TMP2]], align 1 +; CHECK-NEXT: ret void ; %1 = sext i32 %i to i64 %2 = getelementptr inbounds i8, i8* %ptr, i64 %1 @@ -483,73 +389,39 @@ ; NOTE: %p should not be dereferenceable define internal void @fill_range_not_inbounds(i32* %p, i64 %start){ -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__TUNIT_OPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: ret void -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__TUNIT_OPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] -; IS__TUNIT_OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__TUNIT_OPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__TUNIT_NPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: ret void -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__TUNIT_NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] -; IS__TUNIT_NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__TUNIT_NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR3]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__CGSCC_OPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: ret void -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__CGSCC_OPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] -; IS__CGSCC_OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__CGSCC_OPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__CGSCC_NPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: ret void -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__CGSCC_NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] -; IS__CGSCC_NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__CGSCC_NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] +; IS________OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly +; IS________OPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds +; IS________OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR3]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 +; IS________OPM-NEXT: br label [[FOR_BODY:%.*]] +; IS________OPM: for.cond.cleanup: +; IS________OPM-NEXT: ret void +; IS________OPM: for.body: +; IS________OPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] +; IS________OPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 +; IS________OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] +; IS________OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 +; IS________OPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 +; IS________OPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] +; IS________OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] +; +; IS________NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS________NPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds +; IS________NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 +; IS________NPM-NEXT: br label [[FOR_BODY:%.*]] +; IS________NPM: for.cond.cleanup: +; IS________NPM-NEXT: ret void +; IS________NPM: for.body: +; IS________NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] +; IS________NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 +; IS________NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] +; IS________NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 +; IS________NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 +; IS________NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] +; IS________NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; entry: %0 = add nsw i64 %start, 9 @@ -570,73 +442,39 @@ ; FIXME: %p should be dereferenceable(40) define internal void @fill_range_inbounds(i32* %p, i64 %start){ -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fill_range_inbounds -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__TUNIT_OPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: ret void -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__TUNIT_OPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] -; IS__TUNIT_OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__TUNIT_OPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fill_range_inbounds -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__TUNIT_NPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: ret void -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__TUNIT_NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] -; IS__TUNIT_NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__TUNIT_NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fill_range_inbounds -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR3]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__CGSCC_OPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: ret void -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__CGSCC_OPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] -; IS__CGSCC_OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__CGSCC_OPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fill_range_inbounds -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__CGSCC_NPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: ret void -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__CGSCC_NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] -; IS__CGSCC_NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__CGSCC_NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] +; IS________OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly +; IS________OPM-LABEL: define {{[^@]+}}@fill_range_inbounds +; IS________OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR3]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 +; IS________OPM-NEXT: br label [[FOR_BODY:%.*]] +; IS________OPM: for.cond.cleanup: +; IS________OPM-NEXT: ret void +; IS________OPM: for.body: +; IS________OPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] +; IS________OPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 +; IS________OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] +; IS________OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 +; IS________OPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 +; IS________OPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] +; IS________OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] +; +; IS________NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS________NPM-LABEL: define {{[^@]+}}@fill_range_inbounds +; IS________NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 +; IS________NPM-NEXT: br label [[FOR_BODY:%.*]] +; IS________NPM: for.cond.cleanup: +; IS________NPM-NEXT: ret void +; IS________NPM: for.body: +; IS________NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] +; IS________NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 +; IS________NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] +; IS________NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 +; IS________NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 +; IS________NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] +; IS________NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; entry: %0 = add nsw i64 %start, 9 @@ -656,41 +494,23 @@ } define void @call_fill_range(i32* nocapture %p, i64* nocapture readonly %range) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@call_fill_range -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] -; IS__TUNIT_OPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6:[0-9]+]] -; IS__TUNIT_OPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@call_fill_range -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] -; IS__TUNIT_NPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6:[0-9]+]] -; IS__TUNIT_NPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@call_fill_range -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] -; IS__CGSCC_OPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR7:[0-9]+]] -; IS__CGSCC_OPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@call_fill_range -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] -; IS__CGSCC_NPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6:[0-9]+]] -; IS__CGSCC_NPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6]] -; IS__CGSCC_NPM-NEXT: ret void +; IS________OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind +; IS________OPM-LABEL: define {{[^@]+}}@call_fill_range +; IS________OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR4:[0-9]+]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] +; IS________OPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR7:[0-9]+]] +; IS________OPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR7]] +; IS________OPM-NEXT: ret void +; +; IS________NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; IS________NPM-LABEL: define {{[^@]+}}@call_fill_range +; IS________NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR3:[0-9]+]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] +; IS________NPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6:[0-9]+]] +; IS________NPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6]] +; IS________NPM-NEXT: ret void ; entry: %0 = load i64, i64* %range, align 8, !range !0 @@ -792,59 +612,32 @@ ; ; FIXME: %ptr should be dereferenceable(4) define dso_local void @rec-branch-1(i32 %a, i32 %b, i32 %c, i32* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@rec-branch-1 -; IS__TUNIT____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 -; IS__TUNIT____-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[B]], 0 -; IS__TUNIT____-NEXT: br i1 [[TOBOOL1]], label [[IF_ELSE:%.*]], label [[IF_THEN2:%.*]] -; IS__TUNIT____: if.then2: -; IS__TUNIT____-NEXT: store i32 1, i32* [[PTR]], align 4 -; IS__TUNIT____-NEXT: br label [[IF_END8:%.*]] -; IS__TUNIT____: if.else: -; IS__TUNIT____-NEXT: store i32 2, i32* [[PTR]], align 4 -; IS__TUNIT____-NEXT: br label [[IF_END8]] -; IS__TUNIT____: if.else3: -; IS__TUNIT____-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 0 -; IS__TUNIT____-NEXT: br i1 [[TOBOOL4]], label [[IF_ELSE6:%.*]], label [[IF_THEN5:%.*]] -; IS__TUNIT____: if.then5: -; IS__TUNIT____-NEXT: store i32 3, i32* [[PTR]], align 4 -; IS__TUNIT____-NEXT: br label [[IF_END8]] -; IS__TUNIT____: if.else6: -; IS__TUNIT____-NEXT: store i32 4, i32* [[PTR]], align 4 -; IS__TUNIT____-NEXT: br label [[IF_END8]] -; IS__TUNIT____: if.end8: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@rec-branch-1 -; IS__CGSCC____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 -; IS__CGSCC____-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[B]], 0 -; IS__CGSCC____-NEXT: br i1 [[TOBOOL1]], label [[IF_ELSE:%.*]], label [[IF_THEN2:%.*]] -; IS__CGSCC____: if.then2: -; IS__CGSCC____-NEXT: store i32 1, i32* [[PTR]], align 4 -; IS__CGSCC____-NEXT: br label [[IF_END8:%.*]] -; IS__CGSCC____: if.else: -; IS__CGSCC____-NEXT: store i32 2, i32* [[PTR]], align 4 -; IS__CGSCC____-NEXT: br label [[IF_END8]] -; IS__CGSCC____: if.else3: -; IS__CGSCC____-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 0 -; IS__CGSCC____-NEXT: br i1 [[TOBOOL4]], label [[IF_ELSE6:%.*]], label [[IF_THEN5:%.*]] -; IS__CGSCC____: if.then5: -; IS__CGSCC____-NEXT: store i32 3, i32* [[PTR]], align 4 -; IS__CGSCC____-NEXT: br label [[IF_END8]] -; IS__CGSCC____: if.else6: -; IS__CGSCC____-NEXT: store i32 4, i32* [[PTR]], align 4 -; IS__CGSCC____-NEXT: br label [[IF_END8]] -; IS__CGSCC____: if.end8: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@rec-branch-1 +; CHECK-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 +; CHECK-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] +; CHECK: if.then: +; CHECK-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[B]], 0 +; CHECK-NEXT: br i1 [[TOBOOL1]], label [[IF_ELSE:%.*]], label [[IF_THEN2:%.*]] +; CHECK: if.then2: +; CHECK-NEXT: store i32 1, i32* [[PTR]], align 4 +; CHECK-NEXT: br label [[IF_END8:%.*]] +; CHECK: if.else: +; CHECK-NEXT: store i32 2, i32* [[PTR]], align 4 +; CHECK-NEXT: br label [[IF_END8]] +; CHECK: if.else3: +; CHECK-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 0 +; CHECK-NEXT: br i1 [[TOBOOL4]], label [[IF_ELSE6:%.*]], label [[IF_THEN5:%.*]] +; CHECK: if.then5: +; CHECK-NEXT: store i32 3, i32* [[PTR]], align 4 +; CHECK-NEXT: br label [[IF_END8]] +; CHECK: if.else6: +; CHECK-NEXT: store i32 4, i32* [[PTR]], align 4 +; CHECK-NEXT: br label [[IF_END8]] +; CHECK: if.end8: +; CHECK-NEXT: ret void ; entry: %tobool = icmp eq i32 %a, 0 @@ -895,7 +688,7 @@ define dso_local void @rec-branch-2(i32 %a, i32 %b, i32 %c, i32* %ptr) { ; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind writeonly ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@rec-branch-2 -; IS__TUNIT_OPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR3]] { +; IS__TUNIT_OPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR5:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 ; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] @@ -915,7 +708,7 @@ ; IS__TUNIT_OPM-NEXT: store i32 3, i32* [[PTR]], align 4 ; IS__TUNIT_OPM-NEXT: br label [[IF_END8]] ; IS__TUNIT_OPM: if.else6: -; IS__TUNIT_OPM-NEXT: tail call void @rec-branch-2(i32 noundef 1, i32 noundef 1, i32 noundef 1, i32* nocapture nofree writeonly [[PTR]]) #[[ATTR6]] +; IS__TUNIT_OPM-NEXT: tail call void @rec-branch-2(i32 noundef 1, i32 noundef 1, i32 noundef 1, i32* nocapture nofree writeonly [[PTR]]) #[[ATTR7]] ; IS__TUNIT_OPM-NEXT: br label [[IF_END8]] ; IS__TUNIT_OPM: if.end8: ; IS__TUNIT_OPM-NEXT: ret void @@ -1014,17 +807,11 @@ ; ATTRIBUTOR-NEXT: call void @unknown() ; ATTRIBUTOR-NEXT: ret void ; -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@nonnull_assume_pos -; IS__TUNIT_OPM-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(101) [[ARG1:%.*]], i8* nocapture nofree readnone dereferenceable_or_null(31) [[ARG2:%.*]], i8* nocapture nofree nonnull readnone [[ARG3:%.*]], i8* nocapture nofree readnone dereferenceable_or_null(42) [[ARG4:%.*]]) { -; IS__TUNIT_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR7:[0-9]+]] [ "nonnull"(i8* [[ARG3]]), "dereferenceable"(i8* [[ARG1]], i64 1), "dereferenceable"(i8* [[ARG1]], i64 2), "dereferenceable"(i8* [[ARG1]], i64 101), "dereferenceable_or_null"(i8* [[ARG2]], i64 31), "dereferenceable_or_null"(i8* [[ARG4]], i64 42) ] -; IS__TUNIT_OPM-NEXT: call void @unknown() -; IS__TUNIT_OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@nonnull_assume_pos -; IS________NPM-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(101) [[ARG1:%.*]], i8* nocapture nofree readnone dereferenceable_or_null(31) [[ARG2:%.*]], i8* nocapture nofree nonnull readnone [[ARG3:%.*]], i8* nocapture nofree readnone dereferenceable_or_null(42) [[ARG4:%.*]]) { -; IS________NPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR8:[0-9]+]] [ "nonnull"(i8* [[ARG3]]), "dereferenceable"(i8* [[ARG1]], i64 1), "dereferenceable"(i8* [[ARG1]], i64 2), "dereferenceable"(i8* [[ARG1]], i64 101), "dereferenceable_or_null"(i8* [[ARG2]], i64 31), "dereferenceable_or_null"(i8* [[ARG4]], i64 42) ] -; IS________NPM-NEXT: call void @unknown() -; IS________NPM-NEXT: ret void +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_pos +; NOT_CGSCC_OPM-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(101) [[ARG1:%.*]], i8* nocapture nofree readnone dereferenceable_or_null(31) [[ARG2:%.*]], i8* nocapture nofree nonnull readnone [[ARG3:%.*]], i8* nocapture nofree readnone dereferenceable_or_null(42) [[ARG4:%.*]]) { +; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR8:[0-9]+]] [ "nonnull"(i8* [[ARG3]]), "dereferenceable"(i8* [[ARG1]], i64 1), "dereferenceable"(i8* [[ARG1]], i64 2), "dereferenceable"(i8* [[ARG1]], i64 101), "dereferenceable_or_null"(i8* [[ARG2]], i64 31), "dereferenceable_or_null"(i8* [[ARG4]], i64 42) ] +; NOT_CGSCC_OPM-NEXT: call void @unknown() +; NOT_CGSCC_OPM-NEXT: ret void ; ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_pos ; IS__CGSCC_OPM-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(101) [[ARG1:%.*]], i8* nocapture nofree readnone dereferenceable_or_null(31) [[ARG2:%.*]], i8* nocapture nofree nonnull readnone [[ARG3:%.*]], i8* nocapture nofree readnone dereferenceable_or_null(42) [[ARG4:%.*]]) { @@ -1072,41 +859,23 @@ ; ATTRIBUTOR-NEXT: call void @unknown() ; ATTRIBUTOR-NEXT: ret void ; -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@nonnull_assume_call -; IS__TUNIT_OPM-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) { -; IS__TUNIT_OPM-NEXT: call void @unknown() -; IS__TUNIT_OPM-NEXT: [[P:%.*]] = call nonnull dereferenceable(101) i32* @unkown_ptr() #[[ATTR8:[0-9]+]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG3]]), "dereferenceable"(i8* [[ARG1]], i64 1), "dereferenceable"(i8* [[ARG1]], i64 2), "dereferenceable"(i32* [[P]], i64 101), "dereferenceable_or_null"(i8* [[ARG2]], i64 31), "dereferenceable_or_null"(i8* [[ARG4]], i64 42) ] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown() -; IS__TUNIT_OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@nonnull_assume_call -; IS________NPM-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) { -; IS________NPM-NEXT: call void @unknown() -; IS________NPM-NEXT: [[P:%.*]] = call nonnull dereferenceable(101) i32* @unkown_ptr() #[[ATTR9:[0-9]+]] -; IS________NPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG3]]), "dereferenceable"(i8* [[ARG1]], i64 1), "dereferenceable"(i8* [[ARG1]], i64 2), "dereferenceable"(i32* [[P]], i64 101), "dereferenceable_or_null"(i8* [[ARG2]], i64 31), "dereferenceable_or_null"(i8* [[ARG4]], i64 42) ] -; IS________NPM-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown() -; IS________NPM-NEXT: ret void +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_call +; NOT_CGSCC_OPM-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) { +; NOT_CGSCC_OPM-NEXT: call void @unknown() +; NOT_CGSCC_OPM-NEXT: [[P:%.*]] = call nonnull dereferenceable(101) i32* @unkown_ptr() #[[ATTR9:[0-9]+]] +; NOT_CGSCC_OPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) #[[ATTR9]] +; NOT_CGSCC_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) #[[ATTR9]] +; NOT_CGSCC_OPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) #[[ATTR9]] +; NOT_CGSCC_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) #[[ATTR9]] +; NOT_CGSCC_OPM-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) #[[ATTR9]] +; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG3]]), "dereferenceable"(i8* [[ARG1]], i64 1), "dereferenceable"(i8* [[ARG1]], i64 2), "dereferenceable"(i32* [[P]], i64 101), "dereferenceable_or_null"(i8* [[ARG2]], i64 31), "dereferenceable_or_null"(i8* [[ARG4]], i64 42) ] +; NOT_CGSCC_OPM-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) #[[ATTR9]] +; NOT_CGSCC_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) #[[ATTR9]] +; NOT_CGSCC_OPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) #[[ATTR9]] +; NOT_CGSCC_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) #[[ATTR9]] +; NOT_CGSCC_OPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) #[[ATTR9]] +; NOT_CGSCC_OPM-NEXT: call void @unknown() +; NOT_CGSCC_OPM-NEXT: ret void ; ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_call ; IS__CGSCC_OPM-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) { @@ -1149,20 +918,21 @@ !0 = !{i64 10, i64 100} ;. -; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nounwind willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind } -; IS__TUNIT_OPM: attributes #[[ATTR5:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR6]] = { nofree nosync nounwind writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR7]] = { willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR8]] = { nounwind } +; IS__TUNIT_OPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind writeonly } +; IS__TUNIT_OPM: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind } +; IS__TUNIT_OPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind writeonly } +; IS__TUNIT_OPM: attributes #[[ATTR6:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly } +; IS__TUNIT_OPM: attributes #[[ATTR8]] = { willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR9]] = { nounwind } ;. -; IS__TUNIT_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nounwind willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn } ; IS__TUNIT_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind writeonly } ; IS__TUNIT_NPM: attributes #[[ATTR5:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } ; IS__TUNIT_NPM: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn writeonly } diff --git a/llvm/test/Transforms/Attributor/dereferenceable-2-inseltpoison.ll b/llvm/test/Transforms/Attributor/dereferenceable-2-inseltpoison.ll --- a/llvm/test/Transforms/Attributor/dereferenceable-2-inseltpoison.ll +++ b/llvm/test/Transforms/Attributor/dereferenceable-2-inseltpoison.ll @@ -8,39 +8,22 @@ ; https://bugs.llvm.org/show_bug.cgi?id=21780 define <4 x double> @PR21780(double* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@PR21780 -; IS__TUNIT____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 -; IS__TUNIT____-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 -; IS__TUNIT____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 -; IS__TUNIT____-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 -; IS__TUNIT____-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 -; IS__TUNIT____-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 -; IS__TUNIT____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__TUNIT____-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> poison, double [[T0]], i32 0 -; IS__TUNIT____-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 -; IS__TUNIT____-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 -; IS__TUNIT____-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 -; IS__TUNIT____-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> -; IS__TUNIT____-NEXT: ret <4 x double> [[SHUFFLE]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@PR21780 -; IS__CGSCC____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 -; IS__CGSCC____-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 -; IS__CGSCC____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 -; IS__CGSCC____-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 -; IS__CGSCC____-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 -; IS__CGSCC____-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 -; IS__CGSCC____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__CGSCC____-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> poison, double [[T0]], i32 0 -; IS__CGSCC____-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 -; IS__CGSCC____-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 -; IS__CGSCC____-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 -; IS__CGSCC____-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> -; IS__CGSCC____-NEXT: ret <4 x double> [[SHUFFLE]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@PR21780 +; CHECK-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 +; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 +; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; CHECK-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 +; CHECK-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 +; CHECK-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 +; CHECK-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; CHECK-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> poison, double [[T0]], i32 0 +; CHECK-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 +; CHECK-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 +; CHECK-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 +; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> +; CHECK-NEXT: ret <4 x double> [[SHUFFLE]] ; ; GEP of index 0 is simplified away. @@ -63,19 +46,12 @@ define double @PR21780_only_access3_with_inbounds(double* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds -; IS__TUNIT____-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 -; IS__TUNIT____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__TUNIT____-NEXT: ret double [[T3]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds -; IS__CGSCC____-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 -; IS__CGSCC____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__CGSCC____-NEXT: ret double [[T3]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds +; CHECK-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; CHECK-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; CHECK-NEXT: ret double [[T3]] ; %arrayidx3 = getelementptr inbounds double, double* %ptr, i64 3 @@ -84,19 +60,12 @@ } define double @PR21780_only_access3_without_inbounds(double* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds -; IS__TUNIT____-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 -; IS__TUNIT____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__TUNIT____-NEXT: ret double [[T3]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds -; IS__CGSCC____-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 -; IS__CGSCC____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__CGSCC____-NEXT: ret double [[T3]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds +; CHECK-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; CHECK-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; CHECK-NEXT: ret double [[T3]] ; %arrayidx3 = getelementptr double, double* %ptr, i64 3 %t3 = load double, double* %arrayidx3, align 8 @@ -104,19 +73,12 @@ } define double @PR21780_without_inbounds(double* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@PR21780_without_inbounds -; IS__TUNIT____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 -; IS__TUNIT____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__TUNIT____-NEXT: ret double [[T3]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@PR21780_without_inbounds -; IS__CGSCC____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 -; IS__CGSCC____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__CGSCC____-NEXT: ret double [[T3]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@PR21780_without_inbounds +; CHECK-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; CHECK-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; CHECK-NEXT: ret double [[T3]] ; %arrayidx1 = getelementptr double, double* %ptr, i64 1 @@ -134,21 +96,13 @@ ; Unsimplified, but still valid. Also, throw in some bogus arguments. define void @gep0(i8* %unused, i8* %other, i8* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@gep0 -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[OTHER:%.*]], i8* nocapture nofree nonnull readonly dereferenceable(3) [[PTR:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 -; IS__TUNIT____-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 -; IS__TUNIT____-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@gep0 -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[OTHER:%.*]], i8* nocapture nofree nonnull readonly dereferenceable(3) [[PTR:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 -; IS__CGSCC____-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 -; IS__CGSCC____-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@gep0 +; CHECK-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[OTHER:%.*]], i8* nocapture nofree nonnull readonly dereferenceable(3) [[PTR:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 +; CHECK-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 +; CHECK-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 +; CHECK-NEXT: ret void ; %arrayidx0 = getelementptr i8, i8* %ptr, i64 0 %arrayidx1 = getelementptr i8, i8* %ptr, i64 1 @@ -164,15 +118,10 @@ ; Multiple arguments may be dereferenceable. define void @ordering(i8* %ptr1, i32* %ptr2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ordering -; IS__TUNIT____-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ordering -; IS__CGSCC____-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@ordering +; CHECK-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-NEXT: ret void ; %a20 = getelementptr i32, i32* %ptr2, i64 0 %a12 = getelementptr i8, i8* %ptr1, i64 2 @@ -190,21 +139,13 @@ ; Not in entry block. define void @not_entry_but_guaranteed_to_execute(i8* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute -; IS__TUNIT____-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[EXIT:%.*]] -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute -; IS__CGSCC____-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[EXIT:%.*]] -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute +; CHECK-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: br label [[EXIT:%.*]] +; CHECK: exit: +; CHECK-NEXT: ret void ; entry: br label %exit @@ -221,25 +162,15 @@ ; Not in entry block and not guaranteed to execute. define void @not_entry_not_guaranteed_to_execute(i8* %ptr, i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] -; IS__TUNIT____: loads: -; IS__TUNIT____-NEXT: ret void -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] -; IS__CGSCC____: loads: -; IS__CGSCC____-NEXT: ret void -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute +; CHECK-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; CHECK: loads: +; CHECK-NEXT: ret void +; CHECK: exit: +; CHECK-NEXT: ret void ; entry: br i1 %cond, label %loads, label %exit @@ -258,25 +189,15 @@ ; The last load may not execute, so derefenceable bytes only covers the 1st two loads. define void @partial_in_entry(i16* %ptr, i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@partial_in_entry -; IS__TUNIT____-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] -; IS__TUNIT____: loads: -; IS__TUNIT____-NEXT: ret void -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@partial_in_entry -; IS__CGSCC____-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] -; IS__CGSCC____: loads: -; IS__CGSCC____-NEXT: ret void -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@partial_in_entry +; CHECK-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; CHECK: loads: +; CHECK-NEXT: ret void +; CHECK: exit: +; CHECK-NEXT: ret void ; entry: %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 @@ -296,17 +217,11 @@ ; The 2nd and 3rd loads may never execute. define void @volatile_is_not_dereferenceable(i16* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable -; IS__TUNIT____-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable -; IS__CGSCC____-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable +; CHECK-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { +; CHECK-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 +; CHECK-NEXT: ret void ; %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 @@ -320,15 +235,10 @@ ; TODO: We should allow inference for atomic (but not volatile) ops. define void @atomic_is_alright(i16* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomic_is_alright -; IS__TUNIT____-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomic_is_alright -; IS__CGSCC____-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@atomic_is_alright +; CHECK-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 @@ -360,15 +270,10 @@ ; We must have consecutive accesses. define void @variable_gep_index(i8* %unused, i8* %ptr, i64 %variable_index) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@variable_gep_index -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@variable_gep_index -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@variable_gep_index +; CHECK-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx1 = getelementptr i8, i8* %ptr, i64 %variable_index %arrayidx2 = getelementptr i8, i8* %ptr, i64 2 @@ -382,15 +287,10 @@ define void @multi_index_gep(<4 x i8>* %ptr) { ; FIXME: %ptr should be dereferenceable(4) -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@multi_index_gep -; IS__TUNIT____-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@multi_index_gep -; IS__CGSCC____-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@multi_index_gep +; CHECK-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx00 = getelementptr <4 x i8>, <4 x i8>* %ptr, i64 0, i64 0 %t0 = load i8, i8* %arrayidx00 @@ -400,15 +300,10 @@ ; Could round weird bitwidths down? define void @not_byte_multiple(i9* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@not_byte_multiple -; IS__TUNIT____-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@not_byte_multiple -; IS__CGSCC____-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@not_byte_multiple +; CHECK-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx0 = getelementptr i9, i9* %ptr, i64 0 %t0 = load i9, i9* %arrayidx0 @@ -418,15 +313,10 @@ ; Missing direct access from the pointer. define void @no_pointer_deref(i16* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@no_pointer_deref -; IS__TUNIT____-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@no_pointer_deref -; IS__CGSCC____-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@no_pointer_deref +; CHECK-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 %arrayidx2 = getelementptr i16, i16* %ptr, i64 2 @@ -438,15 +328,10 @@ ; Out-of-order is ok, but missing access concludes dereferenceable range. define void @non_consecutive(i32* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@non_consecutive -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_consecutive -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@non_consecutive +; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 %arrayidx0 = getelementptr i32, i32* %ptr, i64 0 @@ -460,15 +345,10 @@ ; Improve on existing dereferenceable attribute. define void @more_bytes(i32* dereferenceable(8) %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@more_bytes -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@more_bytes -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@more_bytes +; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -484,15 +364,10 @@ ; Improve on existing dereferenceable_or_null attribute. define void @more_bytes_and_not_null(i32* dereferenceable_or_null(8) %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@more_bytes_and_not_null -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@more_bytes_and_not_null -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@more_bytes_and_not_null +; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -508,15 +383,10 @@ ; But don't pessimize existing dereferenceable attribute. define void @better_bytes(i32* dereferenceable(100) %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@better_bytes -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@better_bytes -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@better_bytes +; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -530,15 +400,10 @@ } define void @bitcast(i32* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bitcast -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bitcast -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@bitcast +; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -549,15 +414,10 @@ } define void @bitcast_different_sizes(double* %arg1, i8* %arg2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bitcast_different_sizes -; IS__TUNIT____-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bitcast_different_sizes -; IS__CGSCC____-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@bitcast_different_sizes +; CHECK-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %ptr1 = bitcast double* %arg1 to float* %a10 = getelementptr float, float* %ptr1, i64 0 @@ -576,15 +436,10 @@ } define void @negative_offset(i32* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@negative_offset -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@negative_offset -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@negative_offset +; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -595,25 +450,15 @@ } define void @stores(i32* %arg) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@stores -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT____-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* -; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 -; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 -; IS__TUNIT____-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 -; IS__TUNIT____-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@stores -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC____-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* -; IS__CGSCC____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 -; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 -; IS__CGSCC____-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 -; IS__CGSCC____-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@stores +; CHECK-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; CHECK-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; CHECK-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 +; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; CHECK-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 +; CHECK-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; CHECK-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -624,21 +469,13 @@ } define void @load_store(i32* %arg) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@load_store -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* -; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 -; IS__TUNIT____-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@load_store -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* -; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 -; IS__CGSCC____-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@load_store +; CHECK-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CHECK-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; CHECK-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; CHECK-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -649,21 +486,13 @@ } define void @different_size1(i32* %arg) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@different_size1 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* -; IS__TUNIT____-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 -; IS__TUNIT____-NEXT: store i32 0, i32* [[ARG]], align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@different_size1 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* -; IS__CGSCC____-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 -; IS__CGSCC____-NEXT: store i32 0, i32* [[ARG]], align 8 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@different_size1 +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CHECK-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; CHECK-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; CHECK-NEXT: store i32 0, i32* [[ARG]], align 8 +; CHECK-NEXT: ret void ; %arg-cast = bitcast i32* %arg to double* store double 0.000000e+00, double* %arg-cast @@ -672,21 +501,13 @@ } define void @different_size2(i32* %arg) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@different_size2 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: store i32 0, i32* [[ARG]], align 8 -; IS__TUNIT____-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* -; IS__TUNIT____-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@different_size2 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: store i32 0, i32* [[ARG]], align 8 -; IS__CGSCC____-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* -; IS__CGSCC____-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@different_size2 +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CHECK-NEXT: store i32 0, i32* [[ARG]], align 8 +; CHECK-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; CHECK-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; CHECK-NEXT: ret void ; store i32 0, i32* %arg %arg-cast = bitcast i32* %arg to double* @@ -713,111 +534,58 @@ ; ; ATTRIBUTOR_CGSCC_NPM-LABEL: define i32 @require_cfg_analysis(i32 %c, i32* {{.*}} dereferenceable(4) %p) define i32 @require_cfg_analysis(i32 %c, i32* %p) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@require_cfg_analysis -; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR4]] { -; IS__TUNIT_OPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] -; IS__TUNIT_OPM: l1: -; IS__TUNIT_OPM-NEXT: [[TOBOOL2:%.*]] = icmp eq i32 [[C]], 1 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL2]], label [[L3:%.*]], label [[L4:%.*]] -; IS__TUNIT_OPM: l2: -; IS__TUNIT_OPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL3]], label [[L3]], label [[L4]] -; IS__TUNIT_OPM: l3: -; IS__TUNIT_OPM-NEXT: br label [[L5:%.*]] -; IS__TUNIT_OPM: l4: -; IS__TUNIT_OPM-NEXT: br label [[L5]] -; IS__TUNIT_OPM: l5: -; IS__TUNIT_OPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] -; IS__TUNIT_OPM: l6: -; IS__TUNIT_OPM-NEXT: store i32 0, i32* [[P]], align 4 -; IS__TUNIT_OPM-NEXT: br label [[END:%.*]] -; IS__TUNIT_OPM: l7: -; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[P]], align 4 -; IS__TUNIT_OPM-NEXT: br label [[END]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: ret i32 1 -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@require_cfg_analysis -; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] -; IS__TUNIT_NPM: l1: -; IS__TUNIT_NPM-NEXT: br label [[L4:%.*]] -; IS__TUNIT_NPM: l2: -; IS__TUNIT_NPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] -; IS__TUNIT_NPM: l3: -; IS__TUNIT_NPM-NEXT: br label [[L5:%.*]] -; IS__TUNIT_NPM: l4: -; IS__TUNIT_NPM-NEXT: br label [[L5]] -; IS__TUNIT_NPM: l5: -; IS__TUNIT_NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] -; IS__TUNIT_NPM: l6: -; IS__TUNIT_NPM-NEXT: store i32 0, i32* [[P]], align 4 -; IS__TUNIT_NPM-NEXT: br label [[END:%.*]] -; IS__TUNIT_NPM: l7: -; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[P]], align 4 -; IS__TUNIT_NPM-NEXT: br label [[END]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: ret i32 1 -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@require_cfg_analysis -; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] -; IS__CGSCC_OPM: l1: -; IS__CGSCC_OPM-NEXT: [[TOBOOL2:%.*]] = icmp eq i32 [[C]], 1 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL2]], label [[L3:%.*]], label [[L4:%.*]] -; IS__CGSCC_OPM: l2: -; IS__CGSCC_OPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL3]], label [[L3]], label [[L4]] -; IS__CGSCC_OPM: l3: -; IS__CGSCC_OPM-NEXT: br label [[L5:%.*]] -; IS__CGSCC_OPM: l4: -; IS__CGSCC_OPM-NEXT: br label [[L5]] -; IS__CGSCC_OPM: l5: -; IS__CGSCC_OPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] -; IS__CGSCC_OPM: l6: -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[P]], align 4 -; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_OPM: l7: -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[P]], align 4 -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: ret i32 1 -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@require_cfg_analysis -; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { -; IS__CGSCC_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] -; IS__CGSCC_NPM: l1: -; IS__CGSCC_NPM-NEXT: br label [[L4:%.*]] -; IS__CGSCC_NPM: l2: -; IS__CGSCC_NPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] -; IS__CGSCC_NPM: l3: -; IS__CGSCC_NPM-NEXT: br label [[L5:%.*]] -; IS__CGSCC_NPM: l4: -; IS__CGSCC_NPM-NEXT: br label [[L5]] -; IS__CGSCC_NPM: l5: -; IS__CGSCC_NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] -; IS__CGSCC_NPM: l6: -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[P]], align 4 -; IS__CGSCC_NPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_NPM: l7: -; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[P]], align 4 -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret i32 1 +; IS________OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS________OPM-LABEL: define {{[^@]+}}@require_cfg_analysis +; IS________OPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR4]] { +; IS________OPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 +; IS________OPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] +; IS________OPM: l1: +; IS________OPM-NEXT: [[TOBOOL2:%.*]] = icmp eq i32 [[C]], 1 +; IS________OPM-NEXT: br i1 [[TOBOOL2]], label [[L3:%.*]], label [[L4:%.*]] +; IS________OPM: l2: +; IS________OPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 +; IS________OPM-NEXT: br i1 [[TOBOOL3]], label [[L3]], label [[L4]] +; IS________OPM: l3: +; IS________OPM-NEXT: br label [[L5:%.*]] +; IS________OPM: l4: +; IS________OPM-NEXT: br label [[L5]] +; IS________OPM: l5: +; IS________OPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 +; IS________OPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] +; IS________OPM: l6: +; IS________OPM-NEXT: store i32 0, i32* [[P]], align 4 +; IS________OPM-NEXT: br label [[END:%.*]] +; IS________OPM: l7: +; IS________OPM-NEXT: store i32 1, i32* [[P]], align 4 +; IS________OPM-NEXT: br label [[END]] +; IS________OPM: end: +; IS________OPM-NEXT: ret i32 1 +; +; IS________NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS________NPM-LABEL: define {{[^@]+}}@require_cfg_analysis +; IS________NPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; IS________NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 +; IS________NPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] +; IS________NPM: l1: +; IS________NPM-NEXT: br label [[L4:%.*]] +; IS________NPM: l2: +; IS________NPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 +; IS________NPM-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] +; IS________NPM: l3: +; IS________NPM-NEXT: br label [[L5:%.*]] +; IS________NPM: l4: +; IS________NPM-NEXT: br label [[L5]] +; IS________NPM: l5: +; IS________NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 +; IS________NPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] +; IS________NPM: l6: +; IS________NPM-NEXT: store i32 0, i32* [[P]], align 4 +; IS________NPM-NEXT: br label [[END:%.*]] +; IS________NPM: l7: +; IS________NPM-NEXT: store i32 1, i32* [[P]], align 4 +; IS________NPM-NEXT: br label [[END]] +; IS________NPM: end: +; IS________NPM-NEXT: ret i32 1 ; %tobool1 = icmp eq i32 %c, 0 br i1 %tobool1, label %l1, label %l2 @@ -844,15 +612,9 @@ ret i32 1 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn writeonly } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR3]] = { argmemonly nofree norecurse nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; CHECK: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; CHECK: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; CHECK: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR3]] = { argmemonly nofree norecurse nounwind willreturn } +; CHECK: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } ;. diff --git a/llvm/test/Transforms/Attributor/dereferenceable-2.ll b/llvm/test/Transforms/Attributor/dereferenceable-2.ll --- a/llvm/test/Transforms/Attributor/dereferenceable-2.ll +++ b/llvm/test/Transforms/Attributor/dereferenceable-2.ll @@ -8,39 +8,22 @@ ; https://bugs.llvm.org/show_bug.cgi?id=21780 define <4 x double> @PR21780(double* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@PR21780 -; IS__TUNIT____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 -; IS__TUNIT____-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 -; IS__TUNIT____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 -; IS__TUNIT____-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 -; IS__TUNIT____-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 -; IS__TUNIT____-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 -; IS__TUNIT____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__TUNIT____-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> undef, double [[T0]], i32 0 -; IS__TUNIT____-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 -; IS__TUNIT____-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 -; IS__TUNIT____-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 -; IS__TUNIT____-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> -; IS__TUNIT____-NEXT: ret <4 x double> [[SHUFFLE]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@PR21780 -; IS__CGSCC____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 -; IS__CGSCC____-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 -; IS__CGSCC____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 -; IS__CGSCC____-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 -; IS__CGSCC____-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 -; IS__CGSCC____-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 -; IS__CGSCC____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__CGSCC____-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> undef, double [[T0]], i32 0 -; IS__CGSCC____-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 -; IS__CGSCC____-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 -; IS__CGSCC____-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 -; IS__CGSCC____-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> -; IS__CGSCC____-NEXT: ret <4 x double> [[SHUFFLE]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@PR21780 +; CHECK-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 +; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 +; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; CHECK-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 +; CHECK-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 +; CHECK-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 +; CHECK-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; CHECK-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> undef, double [[T0]], i32 0 +; CHECK-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 +; CHECK-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 +; CHECK-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 +; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> +; CHECK-NEXT: ret <4 x double> [[SHUFFLE]] ; ; GEP of index 0 is simplified away. @@ -63,19 +46,12 @@ define double @PR21780_only_access3_with_inbounds(double* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds -; IS__TUNIT____-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 -; IS__TUNIT____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__TUNIT____-NEXT: ret double [[T3]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds -; IS__CGSCC____-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 -; IS__CGSCC____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__CGSCC____-NEXT: ret double [[T3]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds +; CHECK-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; CHECK-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; CHECK-NEXT: ret double [[T3]] ; %arrayidx3 = getelementptr inbounds double, double* %ptr, i64 3 @@ -84,19 +60,12 @@ } define double @PR21780_only_access3_without_inbounds(double* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds -; IS__TUNIT____-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 -; IS__TUNIT____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__TUNIT____-NEXT: ret double [[T3]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds -; IS__CGSCC____-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 -; IS__CGSCC____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__CGSCC____-NEXT: ret double [[T3]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds +; CHECK-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; CHECK-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; CHECK-NEXT: ret double [[T3]] ; %arrayidx3 = getelementptr double, double* %ptr, i64 3 %t3 = load double, double* %arrayidx3, align 8 @@ -104,19 +73,12 @@ } define double @PR21780_without_inbounds(double* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@PR21780_without_inbounds -; IS__TUNIT____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 -; IS__TUNIT____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__TUNIT____-NEXT: ret double [[T3]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@PR21780_without_inbounds -; IS__CGSCC____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 -; IS__CGSCC____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__CGSCC____-NEXT: ret double [[T3]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@PR21780_without_inbounds +; CHECK-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; CHECK-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; CHECK-NEXT: ret double [[T3]] ; %arrayidx1 = getelementptr double, double* %ptr, i64 1 @@ -134,21 +96,13 @@ ; Unsimplified, but still valid. Also, throw in some bogus arguments. define void @gep0(i8* %unused, i8* %other, i8* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@gep0 -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[OTHER:%.*]], i8* nocapture nofree nonnull readonly dereferenceable(3) [[PTR:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 -; IS__TUNIT____-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 -; IS__TUNIT____-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@gep0 -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[OTHER:%.*]], i8* nocapture nofree nonnull readonly dereferenceable(3) [[PTR:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 -; IS__CGSCC____-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 -; IS__CGSCC____-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@gep0 +; CHECK-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[OTHER:%.*]], i8* nocapture nofree nonnull readonly dereferenceable(3) [[PTR:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 +; CHECK-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 +; CHECK-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 +; CHECK-NEXT: ret void ; %arrayidx0 = getelementptr i8, i8* %ptr, i64 0 %arrayidx1 = getelementptr i8, i8* %ptr, i64 1 @@ -164,15 +118,10 @@ ; Multiple arguments may be dereferenceable. define void @ordering(i8* %ptr1, i32* %ptr2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ordering -; IS__TUNIT____-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ordering -; IS__CGSCC____-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@ordering +; CHECK-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-NEXT: ret void ; %a20 = getelementptr i32, i32* %ptr2, i64 0 %a12 = getelementptr i8, i8* %ptr1, i64 2 @@ -190,21 +139,13 @@ ; Not in entry block. define void @not_entry_but_guaranteed_to_execute(i8* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute -; IS__TUNIT____-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[EXIT:%.*]] -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute -; IS__CGSCC____-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[EXIT:%.*]] -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute +; CHECK-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: br label [[EXIT:%.*]] +; CHECK: exit: +; CHECK-NEXT: ret void ; entry: br label %exit @@ -221,25 +162,15 @@ ; Not in entry block and not guaranteed to execute. define void @not_entry_not_guaranteed_to_execute(i8* %ptr, i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] -; IS__TUNIT____: loads: -; IS__TUNIT____-NEXT: ret void -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] -; IS__CGSCC____: loads: -; IS__CGSCC____-NEXT: ret void -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute +; CHECK-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; CHECK: loads: +; CHECK-NEXT: ret void +; CHECK: exit: +; CHECK-NEXT: ret void ; entry: br i1 %cond, label %loads, label %exit @@ -258,25 +189,15 @@ ; The last load may not execute, so derefenceable bytes only covers the 1st two loads. define void @partial_in_entry(i16* %ptr, i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@partial_in_entry -; IS__TUNIT____-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] -; IS__TUNIT____: loads: -; IS__TUNIT____-NEXT: ret void -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@partial_in_entry -; IS__CGSCC____-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] -; IS__CGSCC____: loads: -; IS__CGSCC____-NEXT: ret void -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@partial_in_entry +; CHECK-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; CHECK: loads: +; CHECK-NEXT: ret void +; CHECK: exit: +; CHECK-NEXT: ret void ; entry: %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 @@ -296,17 +217,11 @@ ; The 2nd and 3rd loads may never execute. define void @volatile_is_not_dereferenceable(i16* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable -; IS__TUNIT____-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable -; IS__CGSCC____-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable +; CHECK-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { +; CHECK-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 +; CHECK-NEXT: ret void ; %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 @@ -320,15 +235,10 @@ ; TODO: We should allow inference for atomic (but not volatile) ops. define void @atomic_is_alright(i16* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomic_is_alright -; IS__TUNIT____-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomic_is_alright -; IS__CGSCC____-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@atomic_is_alright +; CHECK-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 @@ -360,15 +270,10 @@ ; We must have consecutive accesses. define void @variable_gep_index(i8* %unused, i8* %ptr, i64 %variable_index) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@variable_gep_index -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@variable_gep_index -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@variable_gep_index +; CHECK-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx1 = getelementptr i8, i8* %ptr, i64 %variable_index %arrayidx2 = getelementptr i8, i8* %ptr, i64 2 @@ -382,15 +287,10 @@ define void @multi_index_gep(<4 x i8>* %ptr) { ; FIXME: %ptr should be dereferenceable(4) -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@multi_index_gep -; IS__TUNIT____-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@multi_index_gep -; IS__CGSCC____-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@multi_index_gep +; CHECK-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx00 = getelementptr <4 x i8>, <4 x i8>* %ptr, i64 0, i64 0 %t0 = load i8, i8* %arrayidx00 @@ -400,15 +300,10 @@ ; Could round weird bitwidths down? define void @not_byte_multiple(i9* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@not_byte_multiple -; IS__TUNIT____-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@not_byte_multiple -; IS__CGSCC____-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@not_byte_multiple +; CHECK-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx0 = getelementptr i9, i9* %ptr, i64 0 %t0 = load i9, i9* %arrayidx0 @@ -418,15 +313,10 @@ ; Missing direct access from the pointer. define void @no_pointer_deref(i16* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@no_pointer_deref -; IS__TUNIT____-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@no_pointer_deref -; IS__CGSCC____-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@no_pointer_deref +; CHECK-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 %arrayidx2 = getelementptr i16, i16* %ptr, i64 2 @@ -438,15 +328,10 @@ ; Out-of-order is ok, but missing access concludes dereferenceable range. define void @non_consecutive(i32* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@non_consecutive -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_consecutive -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@non_consecutive +; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 %arrayidx0 = getelementptr i32, i32* %ptr, i64 0 @@ -460,15 +345,10 @@ ; Improve on existing dereferenceable attribute. define void @more_bytes(i32* dereferenceable(8) %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@more_bytes -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@more_bytes -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@more_bytes +; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -484,15 +364,10 @@ ; Improve on existing dereferenceable_or_null attribute. define void @more_bytes_and_not_null(i32* dereferenceable_or_null(8) %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@more_bytes_and_not_null -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@more_bytes_and_not_null -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@more_bytes_and_not_null +; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -508,15 +383,10 @@ ; But don't pessimize existing dereferenceable attribute. define void @better_bytes(i32* dereferenceable(100) %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@better_bytes -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@better_bytes -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@better_bytes +; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -530,15 +400,10 @@ } define void @bitcast(i32* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bitcast -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bitcast -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@bitcast +; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -549,15 +414,10 @@ } define void @bitcast_different_sizes(double* %arg1, i8* %arg2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bitcast_different_sizes -; IS__TUNIT____-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bitcast_different_sizes -; IS__CGSCC____-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@bitcast_different_sizes +; CHECK-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %ptr1 = bitcast double* %arg1 to float* %a10 = getelementptr float, float* %ptr1, i64 0 @@ -576,15 +436,10 @@ } define void @negative_offset(i32* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@negative_offset -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@negative_offset -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@negative_offset +; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -595,25 +450,15 @@ } define void @stores(i32* %arg) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@stores -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT____-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* -; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 -; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 -; IS__TUNIT____-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 -; IS__TUNIT____-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@stores -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC____-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* -; IS__CGSCC____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 -; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 -; IS__CGSCC____-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 -; IS__CGSCC____-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@stores +; CHECK-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; CHECK-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; CHECK-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 +; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; CHECK-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 +; CHECK-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; CHECK-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -624,21 +469,13 @@ } define void @load_store(i32* %arg) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@load_store -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* -; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 -; IS__TUNIT____-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@load_store -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* -; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 -; IS__CGSCC____-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@load_store +; CHECK-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CHECK-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; CHECK-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; CHECK-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -649,21 +486,13 @@ } define void @different_size1(i32* %arg) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@different_size1 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* -; IS__TUNIT____-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 -; IS__TUNIT____-NEXT: store i32 0, i32* [[ARG]], align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@different_size1 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* -; IS__CGSCC____-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 -; IS__CGSCC____-NEXT: store i32 0, i32* [[ARG]], align 8 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@different_size1 +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CHECK-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; CHECK-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; CHECK-NEXT: store i32 0, i32* [[ARG]], align 8 +; CHECK-NEXT: ret void ; %arg-cast = bitcast i32* %arg to double* store double 0.000000e+00, double* %arg-cast @@ -672,21 +501,13 @@ } define void @different_size2(i32* %arg) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@different_size2 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: store i32 0, i32* [[ARG]], align 8 -; IS__TUNIT____-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* -; IS__TUNIT____-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@different_size2 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: store i32 0, i32* [[ARG]], align 8 -; IS__CGSCC____-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* -; IS__CGSCC____-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@different_size2 +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CHECK-NEXT: store i32 0, i32* [[ARG]], align 8 +; CHECK-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; CHECK-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; CHECK-NEXT: ret void ; store i32 0, i32* %arg %arg-cast = bitcast i32* %arg to double* @@ -713,111 +534,58 @@ ; ; ATTRIBUTOR_CGSCC_NPM-LABEL: define i32 @require_cfg_analysis(i32 %c, i32* {{.*}} dereferenceable(4) %p) define i32 @require_cfg_analysis(i32 %c, i32* %p) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@require_cfg_analysis -; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR4]] { -; IS__TUNIT_OPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] -; IS__TUNIT_OPM: l1: -; IS__TUNIT_OPM-NEXT: [[TOBOOL2:%.*]] = icmp eq i32 [[C]], 1 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL2]], label [[L3:%.*]], label [[L4:%.*]] -; IS__TUNIT_OPM: l2: -; IS__TUNIT_OPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL3]], label [[L3]], label [[L4]] -; IS__TUNIT_OPM: l3: -; IS__TUNIT_OPM-NEXT: br label [[L5:%.*]] -; IS__TUNIT_OPM: l4: -; IS__TUNIT_OPM-NEXT: br label [[L5]] -; IS__TUNIT_OPM: l5: -; IS__TUNIT_OPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] -; IS__TUNIT_OPM: l6: -; IS__TUNIT_OPM-NEXT: store i32 0, i32* [[P]], align 4 -; IS__TUNIT_OPM-NEXT: br label [[END:%.*]] -; IS__TUNIT_OPM: l7: -; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[P]], align 4 -; IS__TUNIT_OPM-NEXT: br label [[END]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: ret i32 1 -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@require_cfg_analysis -; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] -; IS__TUNIT_NPM: l1: -; IS__TUNIT_NPM-NEXT: br label [[L4:%.*]] -; IS__TUNIT_NPM: l2: -; IS__TUNIT_NPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] -; IS__TUNIT_NPM: l3: -; IS__TUNIT_NPM-NEXT: br label [[L5:%.*]] -; IS__TUNIT_NPM: l4: -; IS__TUNIT_NPM-NEXT: br label [[L5]] -; IS__TUNIT_NPM: l5: -; IS__TUNIT_NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] -; IS__TUNIT_NPM: l6: -; IS__TUNIT_NPM-NEXT: store i32 0, i32* [[P]], align 4 -; IS__TUNIT_NPM-NEXT: br label [[END:%.*]] -; IS__TUNIT_NPM: l7: -; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[P]], align 4 -; IS__TUNIT_NPM-NEXT: br label [[END]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: ret i32 1 -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@require_cfg_analysis -; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] -; IS__CGSCC_OPM: l1: -; IS__CGSCC_OPM-NEXT: [[TOBOOL2:%.*]] = icmp eq i32 [[C]], 1 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL2]], label [[L3:%.*]], label [[L4:%.*]] -; IS__CGSCC_OPM: l2: -; IS__CGSCC_OPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL3]], label [[L3]], label [[L4]] -; IS__CGSCC_OPM: l3: -; IS__CGSCC_OPM-NEXT: br label [[L5:%.*]] -; IS__CGSCC_OPM: l4: -; IS__CGSCC_OPM-NEXT: br label [[L5]] -; IS__CGSCC_OPM: l5: -; IS__CGSCC_OPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] -; IS__CGSCC_OPM: l6: -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[P]], align 4 -; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_OPM: l7: -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[P]], align 4 -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: ret i32 1 -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@require_cfg_analysis -; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { -; IS__CGSCC_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] -; IS__CGSCC_NPM: l1: -; IS__CGSCC_NPM-NEXT: br label [[L4:%.*]] -; IS__CGSCC_NPM: l2: -; IS__CGSCC_NPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] -; IS__CGSCC_NPM: l3: -; IS__CGSCC_NPM-NEXT: br label [[L5:%.*]] -; IS__CGSCC_NPM: l4: -; IS__CGSCC_NPM-NEXT: br label [[L5]] -; IS__CGSCC_NPM: l5: -; IS__CGSCC_NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] -; IS__CGSCC_NPM: l6: -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[P]], align 4 -; IS__CGSCC_NPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_NPM: l7: -; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[P]], align 4 -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret i32 1 +; IS________OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS________OPM-LABEL: define {{[^@]+}}@require_cfg_analysis +; IS________OPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR4]] { +; IS________OPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 +; IS________OPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] +; IS________OPM: l1: +; IS________OPM-NEXT: [[TOBOOL2:%.*]] = icmp eq i32 [[C]], 1 +; IS________OPM-NEXT: br i1 [[TOBOOL2]], label [[L3:%.*]], label [[L4:%.*]] +; IS________OPM: l2: +; IS________OPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 +; IS________OPM-NEXT: br i1 [[TOBOOL3]], label [[L3]], label [[L4]] +; IS________OPM: l3: +; IS________OPM-NEXT: br label [[L5:%.*]] +; IS________OPM: l4: +; IS________OPM-NEXT: br label [[L5]] +; IS________OPM: l5: +; IS________OPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 +; IS________OPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] +; IS________OPM: l6: +; IS________OPM-NEXT: store i32 0, i32* [[P]], align 4 +; IS________OPM-NEXT: br label [[END:%.*]] +; IS________OPM: l7: +; IS________OPM-NEXT: store i32 1, i32* [[P]], align 4 +; IS________OPM-NEXT: br label [[END]] +; IS________OPM: end: +; IS________OPM-NEXT: ret i32 1 +; +; IS________NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS________NPM-LABEL: define {{[^@]+}}@require_cfg_analysis +; IS________NPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; IS________NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 +; IS________NPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] +; IS________NPM: l1: +; IS________NPM-NEXT: br label [[L4:%.*]] +; IS________NPM: l2: +; IS________NPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 +; IS________NPM-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] +; IS________NPM: l3: +; IS________NPM-NEXT: br label [[L5:%.*]] +; IS________NPM: l4: +; IS________NPM-NEXT: br label [[L5]] +; IS________NPM: l5: +; IS________NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 +; IS________NPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] +; IS________NPM: l6: +; IS________NPM-NEXT: store i32 0, i32* [[P]], align 4 +; IS________NPM-NEXT: br label [[END:%.*]] +; IS________NPM: l7: +; IS________NPM-NEXT: store i32 1, i32* [[P]], align 4 +; IS________NPM-NEXT: br label [[END]] +; IS________NPM: end: +; IS________NPM-NEXT: ret i32 1 ; %tobool1 = icmp eq i32 %c, 0 br i1 %tobool1, label %l1, label %l2 @@ -844,15 +612,9 @@ ret i32 1 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn writeonly } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR3]] = { argmemonly nofree norecurse nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; CHECK: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; CHECK: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; CHECK: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR3]] = { argmemonly nofree norecurse nounwind willreturn } +; CHECK: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } ;. diff --git a/llvm/test/Transforms/Attributor/heap_to_stack.ll b/llvm/test/Transforms/Attributor/heap_to_stack.ll --- a/llvm/test/Transforms/Attributor/heap_to_stack.ll +++ b/llvm/test/Transforms/Attributor/heap_to_stack.ll @@ -1,5 +1,5 @@ ; 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=3 -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 -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=11 -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/heap_to_stack_gpu.ll b/llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll --- a/llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll +++ b/llvm/test/Transforms/Attributor/heap_to_stack_gpu.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=3 -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=3 -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/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,11 +1,11 @@ ; 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=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-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 define dso_local i32 @visible(i32* noalias %A, i32* noalias %B) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn +; IS__TUNIT____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@visible ; IS__TUNIT____-SAME: (i32* noalias nocapture nofree readonly align 4 [[A:%.*]], i32* noalias nocapture nofree readonly align 4 [[B:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: @@ -31,7 +31,7 @@ } define private i32 @noalias_args(i32* %A, i32* %B) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn +; IS__TUNIT____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@noalias_args ; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { ; IS__TUNIT____-NEXT: entry: @@ -64,23 +64,14 @@ define internal i32 @noalias_args_argmem(i32* %A, i32* %B) #1 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@noalias_args_argmem -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 -; IS__TUNIT____-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] -; IS__TUNIT____-NEXT: ret i32 [[ADD]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@noalias_args_argmem -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 -; IS__CGSCC____-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] -; IS__CGSCC____-NEXT: ret i32 [[ADD]] +; CHECK: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@noalias_args_argmem +; CHECK-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4 +; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 +; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] +; CHECK-NEXT: ret i32 [[ADD]] ; entry: %0 = load i32, i32* %A, align 4 @@ -90,7 +81,7 @@ } define dso_local i32 @visible_local(i32* %A) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn +; IS__TUNIT____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@visible_local ; IS__TUNIT____-SAME: (i32* nocapture nofree readonly [[A:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: @@ -134,7 +125,7 @@ } define i32 @visible_local_2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@visible_local_2 ; IS__TUNIT____-SAME: () #[[ATTR2:[0-9]+]] { ; IS__TUNIT____-NEXT: [[B:%.*]] = alloca i32, align 4 @@ -153,19 +144,12 @@ } define internal i32 @noalias_args_argmem_rn(i32* %A, i32* %B) #1 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@noalias_args_argmem_rn -; IS__TUNIT____-SAME: (i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[T0:%.*]] = load i32, i32* [[B]], align 4 -; IS__TUNIT____-NEXT: store i32 0, i32* [[B]], align 4 -; IS__TUNIT____-NEXT: ret i32 [[T0]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@noalias_args_argmem_rn -; IS__CGSCC____-SAME: (i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[T0:%.*]] = load i32, i32* [[B]], align 4 -; IS__CGSCC____-NEXT: store i32 0, i32* [[B]], align 4 -; IS__CGSCC____-NEXT: ret i32 [[T0]] +; CHECK: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@noalias_args_argmem_rn +; CHECK-SAME: (i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: [[T0:%.*]] = load i32, i32* [[B]], align 4 +; CHECK-NEXT: store i32 0, i32* [[B]], align 4 +; CHECK-NEXT: ret i32 [[T0]] ; %t0 = load i32, i32* %B, align 4 store i32 0, i32* %B @@ -173,7 +157,7 @@ } define i32 @visible_local_3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@visible_local_3 ; IS__TUNIT____-SAME: () #[[ATTR2]] { ; IS__TUNIT____-NEXT: [[B:%.*]] = alloca i32, align 4 @@ -198,9 +182,9 @@ attributes #0 = { noinline nounwind uwtable willreturn } attributes #1 = { argmemonly noinline nounwind uwtable willreturn} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree noinline nosync nounwind readonly uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { argmemonly nofree noinline nosync nounwind uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn } +; IS__TUNIT____: attributes #[[ATTR1]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn } +; IS__TUNIT____: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nosync nounwind readonly } ; IS__TUNIT____: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn } ;. 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 @@ -93,7 +93,9 @@ ; copied one ; define i32 @outer1() { -; CHECK_DISABLED-LABEL: define {{[^@]+}}@outer1() { +; CHECK_DISABLED: Function Attrs: norecurse +; CHECK_DISABLED-LABEL: define {{[^@]+}}@outer1 +; CHECK_DISABLED-SAME: () #[[ATTR0:[0-9]+]] { ; CHECK_DISABLED-NEXT: entry: ; CHECK_DISABLED-NEXT: [[RET1:%.*]] = call i32 @inner1(i32 noundef 1, i32 noundef 2) ; CHECK_DISABLED-NEXT: [[RET2:%.*]] = call i32 @inner2(i32 noundef 1, i32 noundef 2) @@ -101,7 +103,9 @@ ; CHECK_DISABLED-NEXT: [[RET4:%.*]] = call i32 @inner4(i32 [[RET3]], i32 [[RET3]]) ; CHECK_DISABLED-NEXT: ret i32 [[RET4]] ; -; CHECK_ENABLED-LABEL: define {{[^@]+}}@outer1() { +; CHECK_ENABLED: Function Attrs: norecurse +; CHECK_ENABLED-LABEL: define {{[^@]+}}@outer1 +; CHECK_ENABLED-SAME: () #[[ATTR1:[0-9]+]] { ; CHECK_ENABLED-NEXT: entry: ; CHECK_ENABLED-NEXT: [[RET1:%.*]] = call i32 @inner1(i32 noundef 1, i32 noundef 2) ; CHECK_ENABLED-NEXT: [[RET2:%.*]] = call i32 @inner2(i32 noundef 1, i32 noundef 2) @@ -127,11 +131,13 @@ } define void @unused_arg_caller() { -; CHECK_DISABLED-LABEL: define {{[^@]+}}@unused_arg_caller() { +; CHECK_DISABLED: Function Attrs: norecurse +; CHECK_DISABLED-LABEL: define {{[^@]+}}@unused_arg_caller +; CHECK_DISABLED-SAME: () #[[ATTR0]] { ; CHECK_DISABLED-NEXT: call void @unused_arg(i8 noundef 0) ; CHECK_DISABLED-NEXT: ret void ; -; CHECK_ENABLED: Function Attrs: nofree nosync nounwind readnone willreturn +; CHECK_ENABLED: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; CHECK_ENABLED-LABEL: define {{[^@]+}}@unused_arg_caller ; CHECK_ENABLED-SAME: () #[[ATTR0:[0-9]+]] { ; CHECK_ENABLED-NEXT: unreachable @@ -158,6 +164,9 @@ ; IS__CGSCC_____ENABLED: attributes #[[ATTR1:[0-9]+]] = { nofree noreturn nosync nounwind readnone willreturn } ; IS__CGSCC_____ENABLED: attributes #[[ATTR2]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } ;. -; CHECK_ENABLED: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; CHECK_ENABLED: attributes #[[ATTR1:[0-9]+]] = { nounwind readnone } +; CHECK_DISABLED: attributes #[[ATTR0]] = { norecurse } +;. +; CHECK_ENABLED: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK_ENABLED: attributes #[[ATTR1]] = { norecurse } +; CHECK_ENABLED: attributes #[[ATTR2:[0-9]+]] = { nounwind readnone } ;. 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 @@ -179,20 +179,35 @@ ; TEST 3: both cond.true and cond.false are dead, therfore cond.end is dead as well. define i32 @all_dead(i32 %a) #0 { -; CHECK: Function Attrs: noreturn -; CHECK-LABEL: define {{[^@]+}}@all_dead -; CHECK-SAME: (i32 [[A:%.*]]) #[[ATTR4:[0-9]+]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 -; CHECK-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; CHECK: cond.true: -; CHECK-NEXT: call void @no_return_call() #[[ATTR3]] -; CHECK-NEXT: unreachable -; CHECK: cond.false: -; CHECK-NEXT: call void @no_return_call() #[[ATTR3]] -; CHECK-NEXT: unreachable -; CHECK: cond.end: -; CHECK-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: noreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@all_dead +; NOT_CGSCC_NPM-SAME: (i32 [[A:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; NOT_CGSCC_NPM: cond.true: +; NOT_CGSCC_NPM-NEXT: call void @no_return_call() #[[ATTR3]] +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: cond.false: +; NOT_CGSCC_NPM-NEXT: call void @no_return_call() #[[ATTR3]] +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: cond.end: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; IS__CGSCC____: Function Attrs: norecurse noreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@all_dead +; IS__CGSCC____-SAME: (i32 [[A:%.*]]) #[[ATTR9:[0-9]+]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 +; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; IS__CGSCC____: cond.true: +; IS__CGSCC____-NEXT: call void @no_return_call() #[[ATTR3]] +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: cond.false: +; IS__CGSCC____-NEXT: call void @no_return_call() #[[ATTR3]] +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: cond.end: +; IS__CGSCC____-NEXT: unreachable ; entry: %cmp = icmp eq i32 %a, 0 @@ -227,7 +242,7 @@ ; CHECK-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] ; CHECK: cond.true: ; CHECK-NEXT: call void @normal_call() -; CHECK-NEXT: [[CALL:%.*]] = call i32 @foo_noreturn() #[[ATTR4]] +; CHECK-NEXT: [[CALL:%.*]] = call i32 @foo_noreturn() #[[ATTR4:[0-9]+]] ; CHECK-NEXT: unreachable ; CHECK: cond.false: ; CHECK-NEXT: call void @normal_call() @@ -501,13 +516,13 @@ ; FIXME: Should be able to detect undefined behavior. define void @ub(i32* %0) { -; IS________OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; IS________OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS________OPM-LABEL: define {{[^@]+}}@ub ; IS________OPM-SAME: (i32* nocapture nofree writeonly [[TMP0:%.*]]) #[[ATTR7:[0-9]+]] { ; IS________OPM-NEXT: store i32 0, i32* [[TMP0]], align 4 ; IS________OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@ub ; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR7:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: store i32 0, i32* undef, align 4294967296 @@ -515,7 +530,7 @@ ; ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__CGSCC____-LABEL: define {{[^@]+}}@ub -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR9:[0-9]+]] { +; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR10:[0-9]+]] { ; IS__CGSCC____-NEXT: store i32 0, i32* undef, align 4294967296 ; IS__CGSCC____-NEXT: ret void ; @@ -527,7 +542,7 @@ } define void @inf_loop() #0 { -; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone +; NOT_CGSCC_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@inf_loop ; NOT_CGSCC_NPM-SAME: () #[[ATTR8:[0-9]+]] { ; NOT_CGSCC_NPM-NEXT: entry: @@ -537,7 +552,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone ; IS__CGSCC____-LABEL: define {{[^@]+}}@inf_loop -; IS__CGSCC____-SAME: () #[[ATTR10:[0-9]+]] { +; IS__CGSCC____-SAME: () #[[ATTR11:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: br label [[WHILE_BODY:%.*]] ; IS__CGSCC____: while.body: @@ -591,7 +606,7 @@ } define void @rec() #0 { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@rec ; NOT_CGSCC_NPM-SAME: () #[[ATTR9:[0-9]+]] { ; NOT_CGSCC_NPM-NEXT: entry: @@ -798,14 +813,14 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_unreachable ; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13:[0-9]+]] ; NOT_CGSCC_NPM-NEXT: call void @test_unreachable() #[[ATTR0]] ; NOT_CGSCC_NPM-NEXT: unreachable ; ; IS__CGSCC____: Function Attrs: nofree noreturn nosync nounwind ; IS__CGSCC____-LABEL: define {{[^@]+}}@test_unreachable ; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15:[0-9]+]] +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17:[0-9]+]] ; IS__CGSCC____-NEXT: call void @test_unreachable() #[[ATTR0]] ; IS__CGSCC____-NEXT: unreachable ; @@ -886,28 +901,28 @@ ; ; IS__CGSCC____-LABEL: define {{[^@]+}}@middle() { ; IS__CGSCC____-NEXT: bb0: -; IS__CGSCC____-NEXT: call void @non_dead_b0() #[[ATTR15]] -; IS__CGSCC____-NEXT: call void @non_dead_b1() #[[ATTR15]] -; IS__CGSCC____-NEXT: call void @non_dead_b2() #[[ATTR15]] -; IS__CGSCC____-NEXT: call void @non_dead_b3() #[[ATTR15]] +; IS__CGSCC____-NEXT: call void @non_dead_b0() #[[ATTR17]] +; IS__CGSCC____-NEXT: call void @non_dead_b1() #[[ATTR17]] +; IS__CGSCC____-NEXT: call void @non_dead_b2() #[[ATTR17]] +; IS__CGSCC____-NEXT: call void @non_dead_b3() #[[ATTR17]] ; IS__CGSCC____-NEXT: br label [[BB1:%.*]] ; IS__CGSCC____: bb1: -; IS__CGSCC____-NEXT: call void @non_dead_b4() #[[ATTR15]] -; IS__CGSCC____-NEXT: call void @non_dead_b5() #[[ATTR15]] -; IS__CGSCC____-NEXT: call void @non_dead_b6() #[[ATTR15]] -; IS__CGSCC____-NEXT: call void @non_dead_b7() #[[ATTR15]] +; IS__CGSCC____-NEXT: call void @non_dead_b4() #[[ATTR17]] +; IS__CGSCC____-NEXT: call void @non_dead_b5() #[[ATTR17]] +; IS__CGSCC____-NEXT: call void @non_dead_b6() #[[ATTR17]] +; IS__CGSCC____-NEXT: call void @non_dead_b7() #[[ATTR17]] ; IS__CGSCC____-NEXT: br label [[BB2:%.*]] ; IS__CGSCC____: bb2: -; IS__CGSCC____-NEXT: call void @non_dead_b8() #[[ATTR15]] -; IS__CGSCC____-NEXT: call void @non_dead_b9() #[[ATTR15]] -; IS__CGSCC____-NEXT: call void @non_dead_b10() #[[ATTR15]] -; IS__CGSCC____-NEXT: call void @non_dead_b11() #[[ATTR15]] +; IS__CGSCC____-NEXT: call void @non_dead_b8() #[[ATTR17]] +; IS__CGSCC____-NEXT: call void @non_dead_b9() #[[ATTR17]] +; IS__CGSCC____-NEXT: call void @non_dead_b10() #[[ATTR17]] +; IS__CGSCC____-NEXT: call void @non_dead_b11() #[[ATTR17]] ; IS__CGSCC____-NEXT: br label [[BB3:%.*]] ; IS__CGSCC____: bb3: -; IS__CGSCC____-NEXT: call void @non_dead_b12() #[[ATTR15]] -; IS__CGSCC____-NEXT: call void @non_dead_b13() #[[ATTR15]] -; IS__CGSCC____-NEXT: call void @non_dead_b14() #[[ATTR15]] -; IS__CGSCC____-NEXT: call void @non_dead_b15() #[[ATTR15]] +; IS__CGSCC____-NEXT: call void @non_dead_b12() #[[ATTR17]] +; IS__CGSCC____-NEXT: call void @non_dead_b13() #[[ATTR17]] +; IS__CGSCC____-NEXT: call void @non_dead_b14() #[[ATTR17]] +; IS__CGSCC____-NEXT: call void @non_dead_b15() #[[ATTR17]] ; IS__CGSCC____-NEXT: br label [[BB4:%.*]] ; IS__CGSCC____: bb4: ; IS__CGSCC____-NEXT: call void @non_exact2() @@ -1027,13 +1042,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a0 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a0 -; IS__CGSCC____-SAME: () #[[ATTR11:[0-9]+]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12:[0-9]+]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1043,13 +1058,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a1 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a1 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1059,13 +1074,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a2 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a2 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1075,13 +1090,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a3 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a3 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1091,13 +1106,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a4 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a4 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1107,13 +1122,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a5 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a5 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1123,13 +1138,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a6 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a6 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1139,13 +1154,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a7 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a7 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1155,13 +1170,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a8 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a8 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1171,13 +1186,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a9 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a9 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1187,13 +1202,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a10 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a10 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1203,13 +1218,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a11 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a11 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1219,13 +1234,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a12 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a12 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1235,13 +1250,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a13 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a13 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1251,13 +1266,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a14 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a14 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1267,13 +1282,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a15 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a15 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1283,13 +1298,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b0 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b0 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1299,13 +1314,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b1 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b1 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1315,13 +1330,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b2 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b2 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1331,13 +1346,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b3 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b3 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1347,13 +1362,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b4 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b4 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1363,13 +1378,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b5 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b5 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1379,13 +1394,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b6 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b6 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1395,13 +1410,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b7 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b7 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1411,13 +1426,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b8 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b8 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1427,13 +1442,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b9 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b9 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1443,13 +1458,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b10 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b10 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1459,13 +1474,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b11 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b11 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1475,13 +1490,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b12 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b12 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1491,13 +1506,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b13 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b13 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1507,13 +1522,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b14 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b14 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1523,13 +1538,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b15 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b15 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1539,13 +1554,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c0 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c0 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1555,13 +1570,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c1 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c1 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1571,13 +1586,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c2 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c2 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1587,13 +1602,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c3 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c3 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1603,13 +1618,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c4 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c4 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1619,13 +1634,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c5 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c5 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1635,13 +1650,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c6 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c6 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1651,13 +1666,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c7 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c7 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1667,13 +1682,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c8 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c8 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1683,13 +1698,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c9 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c9 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1699,13 +1714,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c10 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c10 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1715,13 +1730,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c11 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c11 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1731,13 +1746,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c12 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c12 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1747,13 +1762,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c13 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c13 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1763,13 +1778,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c14 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c14 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1779,13 +1794,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c15 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c15 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1795,13 +1810,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d0 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d0 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1811,13 +1826,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d1 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d1 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1827,13 +1842,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d2 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d2 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1843,13 +1858,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d3 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d3 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1859,13 +1874,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d4 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d4 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1875,13 +1890,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d5 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d5 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1891,13 +1906,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d6 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d6 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1907,13 +1922,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d7 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d7 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1923,13 +1938,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d8 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d8 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1939,13 +1954,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d9 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d9 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1955,13 +1970,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d10 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d10 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1971,13 +1986,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d11 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d11 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1987,13 +2002,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d12 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d12 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -2003,13 +2018,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d13 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d13 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -2019,13 +2034,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d14 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d14 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -2035,13 +2050,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d15 ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d15 -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -2107,13 +2122,13 @@ ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@useless_arg_sink ; NOT_CGSCC_NPM-SAME: () #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@useless_arg_sink -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -2129,8 +2144,8 @@ ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@useless_arg_almost_sink -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: call void @useless_arg_sink() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: call void @useless_arg_sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret void ; call void @useless_arg_sink(i32* %a) @@ -2180,21 +2195,21 @@ ; NOT_CGSCC_NPM-NEXT: i64 10, label [[RETURN]] ; NOT_CGSCC_NPM-NEXT: ] ; NOT_CGSCC_NPM: sw.default: -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR13]] ; NOT_CGSCC_NPM-NEXT: ret i32 undef ; NOT_CGSCC_NPM: return: ; NOT_CGSCC_NPM-NEXT: unreachable ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@switch_default -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ ; IS__CGSCC____-NEXT: i64 3, label [[RETURN:%.*]] ; IS__CGSCC____-NEXT: i64 10, label [[RETURN]] ; IS__CGSCC____-NEXT: ] ; IS__CGSCC____: sw.default: -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] +; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret i32 undef ; IS__CGSCC____: return: ; IS__CGSCC____-NEXT: unreachable @@ -2222,8 +2237,8 @@ ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@switch_default_caller -; IS__CGSCC____-SAME: () #[[ATTR11]] { -; IS__CGSCC____-NEXT: [[CALL2:%.*]] = tail call i32 @switch_default() #[[ATTR15]] +; IS__CGSCC____-SAME: () #[[ATTR12]] { +; IS__CGSCC____-NEXT: [[CALL2:%.*]] = tail call i32 @switch_default() #[[ATTR17]] ; IS__CGSCC____-NEXT: ret i32 123 ; %call2 = tail call i32 @switch_default(i64 0) @@ -2258,7 +2273,7 @@ } define i32 @switch_default_dead_caller() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@switch_default_dead_caller ; NOT_CGSCC_NPM-SAME: () #[[ATTR9]] { ; NOT_CGSCC_NPM-NEXT: ret i32 123 @@ -2288,8 +2303,9 @@ ; 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 ; +; IS__CGSCC____: Function Attrs: norecurse ; IS__CGSCC____-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_internal_a -; IS__CGSCC____-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull [[FP:%.*]]) { +; IS__CGSCC____-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull [[FP:%.*]]) #[[ATTR13:[0-9]+]] { ; IS__CGSCC____-NEXT: call void [[FP]](i32* [[A]], i32* nonnull align 128 dereferenceable(4) [[B]], i32* [[A]], i64 -1, i32** null) ; IS__CGSCC____-NEXT: ret void ; @@ -2302,8 +2318,9 @@ ; 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 ; +; IS__CGSCC____: Function Attrs: norecurse ; IS__CGSCC____-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_internal_b -; IS__CGSCC____-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull [[FP:%.*]]) { +; IS__CGSCC____-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull [[FP:%.*]]) #[[ATTR13]] { ; IS__CGSCC____-NEXT: call void [[FP]](i32* [[A]], i32* nonnull align 128 dereferenceable(4) [[B]], i32* [[A]], i64 -1, i32** null) ; IS__CGSCC____-NEXT: ret void ; @@ -2323,8 +2340,9 @@ ; 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____: Function Attrs: norecurse ; IS__CGSCC____-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_caller -; IS__CGSCC____-SAME: (i32* [[A:%.*]], i32* [[B:%.*]]) { +; IS__CGSCC____-SAME: (i32* [[A:%.*]], i32* [[B:%.*]]) #[[ATTR13]] { ; IS__CGSCC____-NEXT: [[PTR1:%.*]] = alloca i32, align 128 ; IS__CGSCC____-NEXT: [[PTR2:%.*]] = alloca i32, align 128 ; IS__CGSCC____-NEXT: [[PTR3:%.*]] = alloca i32, align 128 @@ -2408,7 +2426,7 @@ ; ; IS__CGSCC____: Function Attrs: nounwind readonly ; IS__CGSCC____-LABEL: define {{[^@]+}}@dead_with_blockaddress_users -; IS__CGSCC____-SAME: (i32* nocapture [[PC:%.*]]) #[[ATTR12:[0-9]+]] { +; IS__CGSCC____-SAME: (i32* nocapture [[PC:%.*]]) #[[ATTR14:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: br label [[INDIRECTGOTO:%.*]] ; IS__CGSCC____: lab0: @@ -2542,7 +2560,7 @@ declare noalias i8* @malloc(i64) define i32 @h(i32 %i) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@h ; NOT_CGSCC_NPM-SAME: (i32 [[I:%.*]]) #[[ATTR9]] { ; NOT_CGSCC_NPM-NEXT: ret i32 0 @@ -2563,11 +2581,11 @@ define void @bad_gep() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bad_gep -; NOT_CGSCC_NPM-SAME: () #[[ATTR9]] { +; NOT_CGSCC_NPM-SAME: () #[[ATTR11:[0-9]+]] { ; NOT_CGSCC_NPM-NEXT: entry: ; NOT_CGSCC_NPM-NEXT: [[N:%.*]] = alloca i8, align 1 ; NOT_CGSCC_NPM-NEXT: [[M:%.*]] = alloca i8, align 1 -; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR13:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR14:[0-9]+]] ; NOT_CGSCC_NPM-NEXT: br label [[EXIT:%.*]] ; NOT_CGSCC_NPM: while.body: ; NOT_CGSCC_NPM-NEXT: unreachable @@ -2576,16 +2594,16 @@ ; NOT_CGSCC_NPM: if.end: ; NOT_CGSCC_NPM-NEXT: unreachable ; NOT_CGSCC_NPM: exit: -; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR13]] +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@bad_gep -; IS__CGSCC____-SAME: () #[[ATTR13:[0-9]+]] { +; IS__CGSCC____-SAME: () #[[ATTR15:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: [[N:%.*]] = alloca i8, align 1 ; IS__CGSCC____-NEXT: [[M:%.*]] = alloca i8, align 1 -; IS__CGSCC____-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR16:[0-9]+]] +; IS__CGSCC____-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR18:[0-9]+]] ; IS__CGSCC____-NEXT: br label [[EXIT:%.*]] ; IS__CGSCC____: while.body: ; IS__CGSCC____-NEXT: unreachable @@ -2594,7 +2612,7 @@ ; IS__CGSCC____: if.end: ; IS__CGSCC____-NEXT: unreachable ; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR16]] +; IS__CGSCC____-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR18]] ; IS__CGSCC____-NEXT: ret void ; entry: @@ -2623,7 +2641,7 @@ } define i8 @edge_vs_block_liveness() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@edge_vs_block_liveness ; NOT_CGSCC_NPM-SAME: () #[[ATTR9]] { ; NOT_CGSCC_NPM-NEXT: entry: @@ -2667,13 +2685,14 @@ ; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { noreturn } ; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { nosync readnone } ; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nounwind uwtable willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR7:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { nofree noreturn nosync nounwind readnone } -; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR7:[0-9]+]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { nofree norecurse noreturn nosync nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind readnone willreturn } ; NOT_CGSCC_NPM: attributes #[[ATTR10]] = { nofree nosync nounwind willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR11:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR12]] = { nounwind willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR13]] = { willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR11]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR12:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR13]] = { nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR14]] = { willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind } ; IS__CGSCC____: attributes #[[ATTR1:[0-9]+]] = { readnone } @@ -2684,12 +2703,14 @@ ; IS__CGSCC____: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC____: attributes #[[ATTR7]] = { argmemonly nofree norecurse nounwind uwtable willreturn } ; IS__CGSCC____: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR9]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR10]] = { nofree norecurse noreturn nosync nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR11]] = { nofree nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR12]] = { nounwind readonly } -; IS__CGSCC____: attributes #[[ATTR13]] = { nofree nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR14:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR15]] = { nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR16]] = { willreturn } +; IS__CGSCC____: attributes #[[ATTR9]] = { norecurse noreturn } +; IS__CGSCC____: attributes #[[ATTR10]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR11]] = { nofree norecurse noreturn nosync nounwind readnone } +; IS__CGSCC____: attributes #[[ATTR12]] = { nofree nosync nounwind willreturn } +; IS__CGSCC____: attributes #[[ATTR13]] = { norecurse } +; IS__CGSCC____: attributes #[[ATTR14]] = { nounwind readonly } +; IS__CGSCC____: attributes #[[ATTR15]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR16:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; IS__CGSCC____: attributes #[[ATTR17]] = { nounwind willreturn } +; IS__CGSCC____: attributes #[[ATTR18]] = { willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/liveness_chains.ll b/llvm/test/Transforms/Attributor/liveness_chains.ll --- a/llvm/test/Transforms/Attributor/liveness_chains.ll +++ b/llvm/test/Transforms/Attributor/liveness_chains.ll @@ -9,15 +9,10 @@ declare i32 @source() nounwind readonly define i32 @chain_dead(i32 %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@chain_dead -; IS__TUNIT____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@chain_dead -; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@chain_dead +; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: ret i32 0 ; %init = call i32 @source() %v0 = add i32 %arg, %init @@ -64,9 +59,6 @@ ret i32 %v9 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nounwind readonly } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nounwind readonly } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nounwind readonly } +; CHECK: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll b/llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll --- a/llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll +++ b/llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll @@ -5,67 +5,36 @@ ; 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 define i8 @test1(i32 %a, i32 %length) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test1 -; IS__TUNIT_OPM-SAME: (i32 [[A:%.*]], i32 [[LENGTH:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_OPM: loop: -; IS__TUNIT_OPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[CND:%.*]] = icmp sge i32 [[IV]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[CND]], label [[BACKEDGE]], label [[EXIT:%.*]] -; IS__TUNIT_OPM: backedge: -; IS__TUNIT_OPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__TUNIT_OPM-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__TUNIT_OPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] -; IS__TUNIT_OPM: exit: -; IS__TUNIT_OPM-NEXT: ret i8 0 -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test1 -; IS__TUNIT_NPM-SAME: (i32 [[A:%.*]], i32 [[LENGTH:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_NPM: loop: -; IS__TUNIT_NPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__TUNIT_NPM-NEXT: br label [[BACKEDGE]] -; IS__TUNIT_NPM: backedge: -; IS__TUNIT_NPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__TUNIT_NPM-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__TUNIT_NPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT:%.*]] -; IS__TUNIT_NPM: exit: -; IS__TUNIT_NPM-NEXT: ret i8 0 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test1 -; IS__CGSCC_OPM-SAME: (i32 [[A:%.*]], i32 [[LENGTH:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_OPM: loop: -; IS__CGSCC_OPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[CND:%.*]] = icmp sge i32 [[IV]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CND]], label [[BACKEDGE]], label [[EXIT:%.*]] -; IS__CGSCC_OPM: backedge: -; IS__CGSCC_OPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__CGSCC_OPM-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__CGSCC_OPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] -; IS__CGSCC_OPM: exit: -; IS__CGSCC_OPM-NEXT: ret i8 0 +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone +; IS________OPM-LABEL: define {{[^@]+}}@test1 +; IS________OPM-SAME: (i32 [[A:%.*]], i32 [[LENGTH:%.*]]) #[[ATTR0:[0-9]+]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: br label [[LOOP:%.*]] +; IS________OPM: loop: +; IS________OPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] +; IS________OPM-NEXT: [[CND:%.*]] = icmp sge i32 [[IV]], 0 +; IS________OPM-NEXT: br i1 [[CND]], label [[BACKEDGE]], label [[EXIT:%.*]] +; IS________OPM: backedge: +; IS________OPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 +; IS________OPM-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400 +; IS________OPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] +; IS________OPM: exit: +; IS________OPM-NEXT: ret i8 0 ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test1 -; IS__CGSCC_NPM-SAME: (i32 [[A:%.*]], i32 [[LENGTH:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_NPM: loop: -; IS__CGSCC_NPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__CGSCC_NPM-NEXT: br label [[BACKEDGE]] -; IS__CGSCC_NPM: backedge: -; IS__CGSCC_NPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__CGSCC_NPM-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__CGSCC_NPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT:%.*]] -; IS__CGSCC_NPM: exit: -; IS__CGSCC_NPM-NEXT: ret i8 0 +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@test1 +; IS________NPM-SAME: (i32 [[A:%.*]], i32 [[LENGTH:%.*]]) #[[ATTR0:[0-9]+]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: br label [[LOOP:%.*]] +; IS________NPM: loop: +; IS________NPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] +; IS________NPM-NEXT: br label [[BACKEDGE]] +; IS________NPM: backedge: +; IS________NPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 +; IS________NPM-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400 +; IS________NPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT:%.*]] +; IS________NPM: exit: +; IS________NPM-NEXT: ret i8 0 ; entry: br label %loop @@ -85,89 +54,47 @@ } define i8 @test2(i32 %n) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_OPM: loop: -; IS__TUNIT_OPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[IV2:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[IV2_NEXT:%.*]], [[BACKEDGE]] ] -; IS__TUNIT_OPM-NEXT: [[CND1:%.*]] = icmp sge i32 [[IV]], 0 -; IS__TUNIT_OPM-NEXT: [[CND2:%.*]] = icmp sgt i32 [[IV2]], 0 -; IS__TUNIT_OPM-NEXT: [[CND:%.*]] = and i1 [[CND1]], [[CND2]] -; IS__TUNIT_OPM-NEXT: br i1 [[CND]], label [[BACKEDGE]], label [[EXIT:%.*]] -; IS__TUNIT_OPM: backedge: -; IS__TUNIT_OPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__TUNIT_OPM-NEXT: [[IV2_NEXT]] = sub nsw i32 [[IV2]], 1 -; IS__TUNIT_OPM-NEXT: [[CONT1:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__TUNIT_OPM-NEXT: [[CONT2:%.*]] = icmp sgt i32 [[IV2_NEXT]], 0 -; IS__TUNIT_OPM-NEXT: [[CONT:%.*]] = and i1 [[CONT1]], [[CONT2]] -; IS__TUNIT_OPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] -; IS__TUNIT_OPM: exit: -; IS__TUNIT_OPM-NEXT: ret i8 0 -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_NPM: loop: -; IS__TUNIT_NPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[IV2:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[IV2_NEXT:%.*]], [[BACKEDGE]] ] -; IS__TUNIT_NPM-NEXT: [[CND2:%.*]] = icmp sgt i32 [[IV2]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[CND2]], label [[BACKEDGE]], label [[EXIT:%.*]] -; IS__TUNIT_NPM: backedge: -; IS__TUNIT_NPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__TUNIT_NPM-NEXT: [[IV2_NEXT]] = sub nsw i32 [[IV2]], 1 -; IS__TUNIT_NPM-NEXT: [[CONT1:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__TUNIT_NPM-NEXT: [[CONT2:%.*]] = icmp sgt i32 [[IV2_NEXT]], 0 -; IS__TUNIT_NPM-NEXT: [[CONT:%.*]] = and i1 [[CONT1]], [[CONT2]] -; IS__TUNIT_NPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] -; IS__TUNIT_NPM: exit: -; IS__TUNIT_NPM-NEXT: ret i8 0 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_OPM: loop: -; IS__CGSCC_OPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[IV2:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[IV2_NEXT:%.*]], [[BACKEDGE]] ] -; IS__CGSCC_OPM-NEXT: [[CND1:%.*]] = icmp sge i32 [[IV]], 0 -; IS__CGSCC_OPM-NEXT: [[CND2:%.*]] = icmp sgt i32 [[IV2]], 0 -; IS__CGSCC_OPM-NEXT: [[CND:%.*]] = and i1 [[CND1]], [[CND2]] -; IS__CGSCC_OPM-NEXT: br i1 [[CND]], label [[BACKEDGE]], label [[EXIT:%.*]] -; IS__CGSCC_OPM: backedge: -; IS__CGSCC_OPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__CGSCC_OPM-NEXT: [[IV2_NEXT]] = sub nsw i32 [[IV2]], 1 -; IS__CGSCC_OPM-NEXT: [[CONT1:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__CGSCC_OPM-NEXT: [[CONT2:%.*]] = icmp sgt i32 [[IV2_NEXT]], 0 -; IS__CGSCC_OPM-NEXT: [[CONT:%.*]] = and i1 [[CONT1]], [[CONT2]] -; IS__CGSCC_OPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] -; IS__CGSCC_OPM: exit: -; IS__CGSCC_OPM-NEXT: ret i8 0 +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone +; IS________OPM-LABEL: define {{[^@]+}}@test2 +; IS________OPM-SAME: (i32 [[N:%.*]]) #[[ATTR0]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: br label [[LOOP:%.*]] +; IS________OPM: loop: +; IS________OPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] +; IS________OPM-NEXT: [[IV2:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[IV2_NEXT:%.*]], [[BACKEDGE]] ] +; IS________OPM-NEXT: [[CND1:%.*]] = icmp sge i32 [[IV]], 0 +; IS________OPM-NEXT: [[CND2:%.*]] = icmp sgt i32 [[IV2]], 0 +; IS________OPM-NEXT: [[CND:%.*]] = and i1 [[CND1]], [[CND2]] +; IS________OPM-NEXT: br i1 [[CND]], label [[BACKEDGE]], label [[EXIT:%.*]] +; IS________OPM: backedge: +; IS________OPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 +; IS________OPM-NEXT: [[IV2_NEXT]] = sub nsw i32 [[IV2]], 1 +; IS________OPM-NEXT: [[CONT1:%.*]] = icmp slt i32 [[IV_NEXT]], 400 +; IS________OPM-NEXT: [[CONT2:%.*]] = icmp sgt i32 [[IV2_NEXT]], 0 +; IS________OPM-NEXT: [[CONT:%.*]] = and i1 [[CONT1]], [[CONT2]] +; IS________OPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] +; IS________OPM: exit: +; IS________OPM-NEXT: ret i8 0 ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_NPM: loop: -; IS__CGSCC_NPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[IV2:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[IV2_NEXT:%.*]], [[BACKEDGE]] ] -; IS__CGSCC_NPM-NEXT: [[CND2:%.*]] = icmp sgt i32 [[IV2]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[CND2]], label [[BACKEDGE]], label [[EXIT:%.*]] -; IS__CGSCC_NPM: backedge: -; IS__CGSCC_NPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__CGSCC_NPM-NEXT: [[IV2_NEXT]] = sub nsw i32 [[IV2]], 1 -; IS__CGSCC_NPM-NEXT: [[CONT1:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__CGSCC_NPM-NEXT: [[CONT2:%.*]] = icmp sgt i32 [[IV2_NEXT]], 0 -; IS__CGSCC_NPM-NEXT: [[CONT:%.*]] = and i1 [[CONT1]], [[CONT2]] -; IS__CGSCC_NPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] -; IS__CGSCC_NPM: exit: -; IS__CGSCC_NPM-NEXT: ret i8 0 +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@test2 +; IS________NPM-SAME: (i32 [[N:%.*]]) #[[ATTR0]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: br label [[LOOP:%.*]] +; IS________NPM: loop: +; IS________NPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] +; IS________NPM-NEXT: [[IV2:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[IV2_NEXT:%.*]], [[BACKEDGE]] ] +; IS________NPM-NEXT: [[CND2:%.*]] = icmp sgt i32 [[IV2]], 0 +; IS________NPM-NEXT: br i1 [[CND2]], label [[BACKEDGE]], label [[EXIT:%.*]] +; IS________NPM: backedge: +; IS________NPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 +; IS________NPM-NEXT: [[IV2_NEXT]] = sub nsw i32 [[IV2]], 1 +; IS________NPM-NEXT: [[CONT1:%.*]] = icmp slt i32 [[IV_NEXT]], 400 +; IS________NPM-NEXT: [[CONT2:%.*]] = icmp sgt i32 [[IV2_NEXT]], 0 +; IS________NPM-NEXT: [[CONT:%.*]] = and i1 [[CONT1]], [[CONT2]] +; IS________NPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] +; IS________NPM: exit: +; IS________NPM-NEXT: ret i8 0 ; entry: br label %loop @@ -315,23 +242,13 @@ declare void @dummy(i1) nounwind declare void @llvm.experimental.guard(i1, ...) ;. -; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone } -; IS__TUNIT_OPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nounwind } -; IS__TUNIT_OPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync willreturn } -;. -; IS__TUNIT_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR2]] = { nounwind } -; IS__TUNIT_NPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC_OPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync willreturn } +; IS________OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone } +; IS________OPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; IS________OPM: attributes #[[ATTR2]] = { nounwind } +; IS________OPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync willreturn } +; IS________NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS________NPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; IS________NPM: attributes #[[ATTR2]] = { nounwind } +; IS________NPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/lvi-for-ashr.ll b/llvm/test/Transforms/Attributor/lvi-for-ashr.ll --- a/llvm/test/Transforms/Attributor/lvi-for-ashr.ll +++ b/llvm/test/Transforms/Attributor/lvi-for-ashr.ll @@ -7,87 +7,46 @@ ; FIXME: DOT should be replaced with 3 define i32 @test-ashr(i32 %c) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test-ashr -; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: chk65: -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] -; IS__TUNIT_OPM: chk0: -; IS__TUNIT_OPM-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] -; IS__TUNIT_OPM: bb_if: -; IS__TUNIT_OPM-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 -; IS__TUNIT_OPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] -; IS__TUNIT_OPM: bb_then: -; IS__TUNIT_OPM-NEXT: [[CMP3:%.*]] = icmp eq i32 [[ASHR_VAL]], 16 -; IS__TUNIT_OPM-NEXT: [[DOT:%.*]] = select i1 [[CMP3]], i32 3, i32 2 -; IS__TUNIT_OPM-NEXT: br label [[RETURN]] -; IS__TUNIT_OPM: return: -; IS__TUNIT_OPM-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[RETVAL]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________OPM-LABEL: define {{[^@]+}}@test-ashr +; IS________OPM-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; IS________OPM-NEXT: chk65: +; IS________OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 +; IS________OPM-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] +; IS________OPM: chk0: +; IS________OPM-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 +; IS________OPM-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] +; IS________OPM: bb_if: +; IS________OPM-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 +; IS________OPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 +; IS________OPM-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] +; IS________OPM: bb_then: +; IS________OPM-NEXT: [[CMP3:%.*]] = icmp eq i32 [[ASHR_VAL]], 16 +; IS________OPM-NEXT: [[DOT:%.*]] = select i1 [[CMP3]], i32 3, i32 2 +; IS________OPM-NEXT: br label [[RETURN]] +; IS________OPM: return: +; IS________OPM-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] +; IS________OPM-NEXT: ret i32 [[RETVAL]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test-ashr -; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: chk65: -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] -; IS__TUNIT_NPM: chk0: -; IS__TUNIT_NPM-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] -; IS__TUNIT_NPM: bb_if: -; IS__TUNIT_NPM-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 -; IS__TUNIT_NPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] -; IS__TUNIT_NPM: bb_then: -; IS__TUNIT_NPM-NEXT: [[DOT:%.*]] = select i1 true, i32 3, i32 2 -; IS__TUNIT_NPM-NEXT: br label [[RETURN]] -; IS__TUNIT_NPM: return: -; IS__TUNIT_NPM-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[RETVAL]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test-ashr -; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: chk65: -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] -; IS__CGSCC_OPM: chk0: -; IS__CGSCC_OPM-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] -; IS__CGSCC_OPM: bb_if: -; IS__CGSCC_OPM-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 -; IS__CGSCC_OPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] -; IS__CGSCC_OPM: bb_then: -; IS__CGSCC_OPM-NEXT: [[CMP3:%.*]] = icmp eq i32 [[ASHR_VAL]], 16 -; IS__CGSCC_OPM-NEXT: [[DOT:%.*]] = select i1 [[CMP3]], i32 3, i32 2 -; IS__CGSCC_OPM-NEXT: br label [[RETURN]] -; IS__CGSCC_OPM: return: -; IS__CGSCC_OPM-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[RETVAL]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test-ashr -; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: chk65: -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] -; IS__CGSCC_NPM: chk0: -; IS__CGSCC_NPM-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] -; IS__CGSCC_NPM: bb_if: -; IS__CGSCC_NPM-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 -; IS__CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] -; IS__CGSCC_NPM: bb_then: -; IS__CGSCC_NPM-NEXT: [[DOT:%.*]] = select i1 true, i32 3, i32 2 -; IS__CGSCC_NPM-NEXT: br label [[RETURN]] -; IS__CGSCC_NPM: return: -; IS__CGSCC_NPM-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[RETVAL]] +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@test-ashr +; IS________NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; IS________NPM-NEXT: chk65: +; IS________NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 +; IS________NPM-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] +; IS________NPM: chk0: +; IS________NPM-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 +; IS________NPM-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] +; IS________NPM: bb_if: +; IS________NPM-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 +; IS________NPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 +; IS________NPM-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] +; IS________NPM: bb_then: +; IS________NPM-NEXT: [[DOT:%.*]] = select i1 true, i32 3, i32 2 +; IS________NPM-NEXT: br label [[RETURN]] +; IS________NPM: return: +; IS________NPM-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] +; IS________NPM-NEXT: ret i32 [[RETVAL]] ; chk65: %cmp = icmp sgt i32 %c, 65 @@ -112,7 +71,5 @@ ret i32 %retval } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } ;. 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 @@ -442,15 +442,10 @@ } define void @callerE(i8* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@callerE -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@callerE -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@callerE +; CHECK-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { +; CHECK-NEXT: ret void ; call void @llvm.lifetime.start.p0i8(i64 4, i8* %arg) ret void @@ -458,81 +453,63 @@ define void @write_global() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@write_global -; IS__TUNIT____-SAME: () #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: store i32 0, i32* @G, align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_global -; IS__CGSCC____-SAME: () #[[ATTR6:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 0, i32* @G, align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@write_global +; CHECK-SAME: () #[[ATTR6:[0-9]+]] { +; CHECK-NEXT: store i32 0, i32* @G, align 4 +; CHECK-NEXT: ret void ; store i32 0, i32* @G, align 4 ret void } define void @write_global_via_arg(i32* %GPtr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@write_global_via_arg -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[GPTR:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__TUNIT____-NEXT: store i32 0, i32* [[GPTR]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_global_via_arg -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[GPTR:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 0, i32* [[GPTR]], align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@write_global_via_arg +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[GPTR:%.*]]) #[[ATTR7:[0-9]+]] { +; CHECK-NEXT: store i32 0, i32* [[GPTR]], align 4 +; CHECK-NEXT: ret void ; store i32 0, i32* %GPtr, align 4 ret void } define internal void @write_global_via_arg_internal(i32* %GPtr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@write_global_via_arg_internal -; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: store i32 0, i32* @G, align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_global_via_arg_internal -; IS__CGSCC____-SAME: () #[[ATTR6]] { -; IS__CGSCC____-NEXT: store i32 0, i32* @G, align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@write_global_via_arg_internal +; CHECK-SAME: () #[[ATTR6]] { +; CHECK-NEXT: store i32 0, i32* @G, align 4 +; CHECK-NEXT: ret void ; store i32 0, i32* %GPtr, align 4 ret void } define void @writeonly_global() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@writeonly_global ; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: call void @write_global() #[[ATTR6]] +; IS__TUNIT____-NEXT: call void @write_global() #[[ATTR10:[0-9]+]] ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__CGSCC____-LABEL: define {{[^@]+}}@writeonly_global ; IS__CGSCC____-SAME: () #[[ATTR6]] { -; IS__CGSCC____-NEXT: call void @write_global() #[[ATTR11:[0-9]+]] +; IS__CGSCC____-NEXT: call void @write_global() #[[ATTR9:[0-9]+]] ; IS__CGSCC____-NEXT: ret void ; call void @write_global() ret void } define void @writeonly_global_via_arg() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@writeonly_global_via_arg ; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: call void @write_global_via_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR6]] +; IS__TUNIT____-NEXT: call void @write_global_via_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR10]] ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__CGSCC____-LABEL: define {{[^@]+}}@writeonly_global_via_arg ; IS__CGSCC____-SAME: () #[[ATTR6]] { -; IS__CGSCC____-NEXT: call void @write_global_via_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR11]] +; IS__CGSCC____-NEXT: call void @write_global_via_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR9]] ; IS__CGSCC____-NEXT: ret void ; call void @write_global_via_arg(i32* @G) @@ -541,16 +518,16 @@ define void @writeonly_global_via_arg_internal() { ; -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@writeonly_global_via_arg_internal ; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: call void @write_global_via_arg_internal() #[[ATTR6]] +; IS__TUNIT____-NEXT: call void @write_global_via_arg_internal() #[[ATTR10]] ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__CGSCC____-LABEL: define {{[^@]+}}@writeonly_global_via_arg_internal ; IS__CGSCC____-SAME: () #[[ATTR6]] { -; IS__CGSCC____-NEXT: call void @write_global_via_arg_internal() #[[ATTR11]] +; IS__CGSCC____-NEXT: call void @write_global_via_arg_internal() #[[ATTR9]] ; IS__CGSCC____-NEXT: ret void ; call void @write_global_via_arg_internal(i32* @G) @@ -564,7 +541,7 @@ ; IS__TUNIT____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR10:[0-9]+]] +; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11:[0-9]+]] ; IS__TUNIT____-NEXT: ret i8 1 ; IS__TUNIT____: f: ; IS__TUNIT____-NEXT: store i8 1, i8* [[PTR]], align 1 @@ -576,7 +553,7 @@ ; IS__CGSCC____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR12:[0-9]+]] +; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR10:[0-9]+]] ; IS__CGSCC____-NEXT: ret i8 1 ; IS__CGSCC____: f: ; IS__CGSCC____-NEXT: store i8 1, i8* [[PTR]], align 1 @@ -600,18 +577,18 @@ ; IS__TUNIT____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]], !range [[RNG0:![0-9]+]] ; IS__TUNIT____-NEXT: ret i8 1 ; IS__TUNIT____: f: ; IS__TUNIT____-NEXT: ret i8 0 ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_not_readnone_internal -; IS__CGSCC____-SAME: (i8* noalias nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { +; IS__CGSCC____-SAME: (i8* noalias nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR5]] { ; IS__CGSCC____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 noundef false) #[[ATTR10:[0-9]+]], !range [[RNG0:![0-9]+]] +; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 noundef false) #[[ATTR11:[0-9]+]], !range [[RNG0:![0-9]+]] ; IS__CGSCC____-NEXT: ret i8 1 ; IS__CGSCC____: f: ; IS__CGSCC____-NEXT: ret i8 0 @@ -628,17 +605,17 @@ } define i8 @readnone_caller(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@readnone_caller ; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { ; IS__TUNIT____-NEXT: [[A:%.*]] = alloca i8, align 1 -; IS__TUNIT____-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 [[C]]) #[[ATTR10]], !range [[RNG0:![0-9]+]] +; IS__TUNIT____-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 [[C]]) #[[ATTR11]], !range [[RNG0]] ; IS__TUNIT____-NEXT: ret i8 [[R]] ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@readnone_caller -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR10]] { -; IS__CGSCC____-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 [[C]]) #[[ATTR13:[0-9]+]], !range [[RNG0]] +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR5]] { +; IS__CGSCC____-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 [[C]]) #[[ATTR12:[0-9]+]], !range [[RNG0]] ; IS__CGSCC____-NEXT: ret i8 [[R]] ; %a = alloca i8 @@ -653,18 +630,18 @@ ; IS__TUNIT____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]], !range [[RNG0]] ; IS__TUNIT____-NEXT: ret i8 1 ; IS__TUNIT____: f: ; IS__TUNIT____-NEXT: ret i8 0 ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_readnone_internal2 -; IS__CGSCC____-SAME: (i8* noalias nocapture nofree nonnull readnone [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR9]] { +; IS__CGSCC____-SAME: (i8* noalias nocapture nofree nonnull readnone [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR5]] { ; IS__CGSCC____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 noundef false) #[[ATTR10]], !range [[RNG0]] +; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 noundef false) #[[ATTR11]], !range [[RNG0]] ; IS__CGSCC____-NEXT: ret i8 1 ; IS__CGSCC____: f: ; IS__CGSCC____-NEXT: ret i8 0 @@ -681,16 +658,16 @@ } define i8 @readnone_caller2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@readnone_caller2 ; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { -; IS__TUNIT____-NEXT: [[R:%.*]] = call noundef i8 @recursive_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR10]], !range [[RNG0]] +; IS__TUNIT____-NEXT: [[R:%.*]] = call i8 @recursive_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR11]], !range [[RNG0]] ; IS__TUNIT____-NEXT: ret i8 [[R]] ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@readnone_caller2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR10]] { -; IS__CGSCC____-NEXT: [[R:%.*]] = call noundef i8 @recursive_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR13]], !range [[RNG0]] +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR5]] { +; IS__CGSCC____-NEXT: [[R:%.*]] = call noundef i8 @recursive_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR12]], !range [[RNG0]] ; IS__CGSCC____-NEXT: ret i8 [[R]] ; %r = call i8 @recursive_readnone_internal2(i8* undef, i1 %c) @@ -704,18 +681,18 @@ ; IS__TUNIT____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]], !range [[RNG0]] ; IS__TUNIT____-NEXT: ret i8 1 ; IS__TUNIT____: f: ; IS__TUNIT____-NEXT: ret i8 0 ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_not_readnone_internal3 -; IS__CGSCC____-SAME: (i8* noalias nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR9]] { +; IS__CGSCC____-SAME: (i8* noalias nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR5]] { ; IS__CGSCC____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 noundef false) #[[ATTR10]], !range [[RNG0]] +; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 noundef false) #[[ATTR11]], !range [[RNG0]] ; IS__CGSCC____-NEXT: ret i8 1 ; IS__CGSCC____: f: ; IS__CGSCC____-NEXT: ret i8 0 @@ -732,17 +709,17 @@ } define i8 @readnone_caller3(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@readnone_caller3 ; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { ; IS__TUNIT____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 -; IS__TUNIT____-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 [[C]]) #[[ATTR10]], !range [[RNG0]] +; IS__TUNIT____-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 [[C]]) #[[ATTR11]], !range [[RNG0]] ; IS__TUNIT____-NEXT: ret i8 [[R]] ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@readnone_caller3 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR10]] { -; IS__CGSCC____-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 [[C]]) #[[ATTR13]], !range [[RNG0]] +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR5]] { +; IS__CGSCC____-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 [[C]]) #[[ATTR12]], !range [[RNG0]] ; IS__CGSCC____-NEXT: ret i8 [[R]] ; %alloc = alloca i8 @@ -751,12 +728,6 @@ } define internal void @argmemonly_before_ipconstprop(i32* %p) argmemonly { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@argmemonly_before_ipconstprop -; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: store i32 0, i32* @G, align 4 -; IS__TUNIT____-NEXT: ret void -; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__CGSCC____-LABEL: define {{[^@]+}}@argmemonly_before_ipconstprop ; IS__CGSCC____-SAME: () #[[ATTR6]] { @@ -768,17 +739,10 @@ } define void @argmemonky_caller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@argmemonky_caller -; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: call void @argmemonly_before_ipconstprop() #[[ATTR6]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@argmemonky_caller -; IS__CGSCC____-SAME: () #[[ATTR6]] { -; IS__CGSCC____-NEXT: call void @argmemonly_before_ipconstprop() #[[ATTR11]] -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@argmemonky_caller +; CHECK-SAME: () #[[ATTR5]] { +; CHECK-NEXT: ret void ; call void @argmemonly_before_ipconstprop(i32* @G) ret void @@ -789,12 +753,13 @@ ; IS__TUNIT____: attributes #[[ATTR2]] = { readnone } ; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly } ; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR5]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR7]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR7]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } ; IS__TUNIT____: attributes #[[ATTR8]] = { argmemonly nofree nosync nounwind writeonly } -; IS__TUNIT____: attributes #[[ATTR9]] = { nofree nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR10]] = { nofree nosync nounwind writeonly } +; IS__TUNIT____: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind readnone } +; IS__TUNIT____: attributes #[[ATTR10]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR11]] = { nofree nosync nounwind writeonly } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { inaccessiblememonly } ; IS__CGSCC____: attributes #[[ATTR1]] = { inaccessiblemem_or_argmemonly } @@ -805,11 +770,10 @@ ; IS__CGSCC____: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind willreturn writeonly } ; IS__CGSCC____: attributes #[[ATTR7]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } ; IS__CGSCC____: attributes #[[ATTR8]] = { argmemonly nofree nosync nounwind writeonly } -; IS__CGSCC____: attributes #[[ATTR9]] = { nofree nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR10]] = { nofree nosync nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR11]] = { nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR12]] = { nofree nosync nounwind writeonly } -; IS__CGSCC____: attributes #[[ATTR13]] = { nounwind readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR9]] = { nounwind willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR10]] = { nofree nosync nounwind writeonly } +; IS__CGSCC____: attributes #[[ATTR11]] = { nofree nosync nounwind readnone } +; IS__CGSCC____: attributes #[[ATTR12]] = { norecurse nounwind readnone willreturn } ;. ; CHECK: [[META0:![0-9]+]] = !{i8 0, i8 2} ;. diff --git a/llvm/test/Transforms/Attributor/misc.ll b/llvm/test/Transforms/Attributor/misc.ll --- a/llvm/test/Transforms/Attributor/misc.ll +++ b/llvm/test/Transforms/Attributor/misc.ll @@ -95,19 +95,12 @@ define internal void @foo(i32* %a) { ; -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@foo +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: store i32 0, i32* [[A]], align 4 +; CHECK-NEXT: ret void ; entry: store i32 0, i32* %a @@ -117,7 +110,7 @@ declare void @callback1(void (i32*)*) declare void @callback2(void (i8*)*) ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } ; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn writeonly } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } diff --git a/llvm/test/Transforms/Attributor/misc_crash.ll b/llvm/test/Transforms/Attributor/misc_crash.ll --- a/llvm/test/Transforms/Attributor/misc_crash.ll +++ b/llvm/test/Transforms/Attributor/misc_crash.ll @@ -10,7 +10,7 @@ ; CHECK: @[[VAR2:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 0 ;. define i32 addrspace(1)* @foo(i32 addrspace(4)* %arg) { -; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; CHECK-LABEL: define {{[^@]+}}@foo ; CHECK-SAME: (i32 addrspace(4)* nofree readnone [[ARG:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: @@ -23,7 +23,7 @@ } define i32* @func1() { -; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; CHECK-LABEL: define {{[^@]+}}@func1 ; CHECK-SAME: () #[[ATTR0]] { ; CHECK-NEXT: ret i32* getelementptr inbounds ([1 x i32], [1 x i32]* @var1, i32 0, i32 0) @@ -38,7 +38,7 @@ } define internal void @func2a(i32* %0) { -; CHECK: Function Attrs: nofree nosync nounwind willreturn writeonly +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; CHECK-LABEL: define {{[^@]+}}@func2a ; CHECK-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: store i32 0, i32* @var2, align 4 @@ -49,7 +49,9 @@ } define i32 @func2() { -; CHECK-LABEL: define {{[^@]+}}@func2() { +; CHECK: Function Attrs: norecurse +; CHECK-LABEL: define {{[^@]+}}@func2 +; CHECK-SAME: () #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: [[TMP1:%.*]] = tail call i32 (i32*, ...) bitcast (void (i32*)* @func2a to i32 (i32*, ...)*)(i32* nonnull align 4 dereferenceable(4) @var2) ; CHECK-NEXT: [[TMP2:%.*]] = load i32, i32* @var2, align 4 ; CHECK-NEXT: ret i32 [[TMP2]] @@ -60,8 +62,9 @@ } define i32 @func3(i1 %false) { +; CHECK: Function Attrs: norecurse ; CHECK-LABEL: define {{[^@]+}}@func3 -; CHECK-SAME: (i1 [[FALSE:%.*]]) { +; CHECK-SAME: (i1 [[FALSE:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: [[TMP1:%.*]] = tail call i32 (i32*, ...) bitcast (void (i32*)* @func2a to i32 (i32*, ...)*)(i32* nonnull align 4 dereferenceable(4) @var2) ; CHECK-NEXT: br i1 [[FALSE]], label [[USE_BB:%.*]], label [[RET_BB:%.*]] ; CHECK: use_bb: @@ -106,7 +109,9 @@ } define i16 @foo3() { -; CHECK-LABEL: define {{[^@]+}}@foo3() { +; CHECK: Function Attrs: norecurse +; CHECK-LABEL: define {{[^@]+}}@foo3 +; CHECK-SAME: () #[[ATTR2]] { ; CHECK-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16*, i16)* @bar3 to i16 ()*)() ; CHECK-NEXT: ret i16 [[CALL]] ; @@ -114,7 +119,7 @@ ret i16 %call } define internal i16 @bar3(i16* %p1, i16 %p2) { -; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; CHECK-LABEL: define {{[^@]+}}@bar3 ; CHECK-SAME: (i16* nocapture nofree readnone [[P1:%.*]], i16 returned [[P2:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: ret i16 [[P2]] @@ -126,6 +131,7 @@ ; CHECK-SAME: (i8*) declare void @func6(i8*) ;. -; CHECK: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; CHECK: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn writeonly } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind willreturn writeonly } +; CHECK: attributes #[[ATTR2]] = { norecurse } ;. diff --git a/llvm/test/Transforms/Attributor/noalias.ll b/llvm/test/Transforms/Attributor/noalias.ll --- a/llvm/test/Transforms/Attributor/noalias.ll +++ b/llvm/test/Transforms/Attributor/noalias.ll @@ -46,15 +46,10 @@ } define void @nocapture(i8* %a){ -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nocapture -; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree readnone [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nocapture -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@nocapture +; CHECK-SAME: (i8* nocapture nofree readnone [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: ret void ; ret void } @@ -149,30 +144,20 @@ ; Returning global pointer. Should not be noalias. define i8** @getter() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@getter -; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { -; NOT_CGSCC_NPM-NEXT: ret i8** @G -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@getter -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i8** @G +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@getter +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i8** @G ; ret i8** @G } ; Returning global pointer. Should not be noalias. define i8** @calle1(){ -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@calle1 -; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { -; NOT_CGSCC_NPM-NEXT: ret i8** @G -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@calle1 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i8** @G +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@calle1 +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i8** @G ; %1 = call i8** @getter() ret i8** %1 @@ -517,30 +502,24 @@ ; TEST 14 i2p casts define internal i32 @p2i(i32* %arg) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@p2i -; NOT_CGSCC_NPM-SAME: (i32* noalias nofree readnone [[ARG:%.*]]) #[[ATTR0]] { -; NOT_CGSCC_NPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[ARG]] to i32 -; NOT_CGSCC_NPM-NEXT: ret i32 [[P2I]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@p2i -; IS__CGSCC____-SAME: (i32* noalias nofree readnone [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[P2I:%.*]] = ptrtoint i32* [[ARG]] to i32 -; IS__CGSCC____-NEXT: ret i32 [[P2I]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@p2i +; CHECK-SAME: (i32* noalias nofree readnone [[ARG:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[P2I:%.*]] = ptrtoint i32* [[ARG]] to i32 +; CHECK-NEXT: ret i32 [[P2I]] ; %p2i = ptrtoint i32* %arg to i32 ret i32 %p2i } define i32 @i2p(i32* %arg) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@i2p ; NOT_CGSCC_NPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @p2i(i32* noalias nofree readnone [[ARG]]) #[[ATTR0]] +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @p2i(i32* noalias nofree readnone [[ARG]]) #[[ATTR9:[0-9]+]] ; NOT_CGSCC_NPM-NEXT: [[I2P:%.*]] = inttoptr i32 [[C]] to i8* ; NOT_CGSCC_NPM-NEXT: [[BC:%.*]] = bitcast i8* [[I2P]] to i32* -; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32 @ret(i32* nocapture nofree readonly align 4 [[BC]]) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32 @ret(i32* nocapture nofree readonly align 4 [[BC]]) #[[ATTR10:[0-9]+]] ; NOT_CGSCC_NPM-NEXT: ret i32 [[CALL]] ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn @@ -559,17 +538,11 @@ ret i32 %call } define internal i32 @ret(i32* %arg) { -; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ret -; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[ARG]], align 4 -; NOT_CGSCC_NPM-NEXT: ret i32 [[L]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* [[ARG]], align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@ret +; CHECK-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { +; CHECK-NEXT: [[L:%.*]] = load i32, i32* [[ARG]], align 4 +; CHECK-NEXT: ret i32 [[L]] ; %l = load i32, i32* %arg ret i32 %l @@ -585,29 +558,17 @@ ; Function Attrs: nounwind optsize define internal fastcc double @strtox(i8* %s, i8** %p, i32 %prec) unnamed_addr { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@strtox -; NOT_CGSCC_NPM-SAME: (i8* [[S:%.*]]) unnamed_addr { -; NOT_CGSCC_NPM-NEXT: entry: -; NOT_CGSCC_NPM-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8 -; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = bitcast %struct._IO_FILE* [[F]] to i8* -; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) #[[ATTR9:[0-9]+]] -; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32 bitcast (i32 (...)* @sh_fromstring to i32 (%struct._IO_FILE*, i8*)*)(%struct._IO_FILE* nonnull align 8 dereferenceable(240) [[F]], i8* [[S]]) -; NOT_CGSCC_NPM-NEXT: call void @__shlim(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0) -; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call double @__floatscan(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1) -; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) -; NOT_CGSCC_NPM-NEXT: ret double [[CALL1]] -; -; IS__CGSCC____-LABEL: define {{[^@]+}}@strtox -; IS__CGSCC____-SAME: (i8* [[S:%.*]]) unnamed_addr { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8 -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = bitcast %struct._IO_FILE* [[F]] to i8* -; IS__CGSCC____-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) #[[ATTR11:[0-9]+]] -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32 bitcast (i32 (...)* @sh_fromstring to i32 (%struct._IO_FILE*, i8*)*)(%struct._IO_FILE* nonnull align 8 dereferenceable(240) [[F]], i8* [[S]]) -; IS__CGSCC____-NEXT: call void @__shlim(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0) -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call double @__floatscan(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1) -; IS__CGSCC____-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) -; IS__CGSCC____-NEXT: ret double [[CALL1]] +; CHECK-LABEL: define {{[^@]+}}@strtox +; CHECK-SAME: (i8* [[S:%.*]]) unnamed_addr { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8 +; CHECK-NEXT: [[TMP0:%.*]] = bitcast %struct._IO_FILE* [[F]] to i8* +; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) #[[ATTR11:[0-9]+]] +; CHECK-NEXT: [[CALL:%.*]] = call i32 bitcast (i32 (...)* @sh_fromstring to i32 (%struct._IO_FILE*, i8*)*)(%struct._IO_FILE* nonnull align 8 dereferenceable(240) [[F]], i8* [[S]]) +; CHECK-NEXT: call void @__shlim(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0) +; CHECK-NEXT: [[CALL1:%.*]] = call double @__floatscan(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1) +; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) +; CHECK-NEXT: ret double [[CALL1]] ; entry: %f = alloca %struct._IO_FILE, align 8 @@ -655,50 +616,38 @@ @alias_of_p = external global i32* define void @make_alias(i32* %p) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@make_alias -; NOT_CGSCC_NPM-SAME: (i32* nofree writeonly [[P:%.*]]) #[[ATTR7:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: store i32* [[P]], i32** @alias_of_p, align 8 -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@make_alias -; IS__CGSCC____-SAME: (i32* nofree writeonly [[P:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32* [[P]], i32** @alias_of_p, align 8 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@make_alias +; CHECK-SAME: (i32* nofree writeonly [[P:%.*]]) #[[ATTR7:[0-9]+]] { +; CHECK-NEXT: store i32* [[P]], i32** @alias_of_p, align 8 +; CHECK-NEXT: ret void ; store i32* %p, i32** @alias_of_p ret void } define void @only_store(i32* %p) { -; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@only_store -; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[P]], align 4 -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@only_store -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 0, i32* [[P]], align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@only_store +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; CHECK-NEXT: store i32 0, i32* [[P]], align 4 +; CHECK-NEXT: ret void ; store i32 0, i32* %p ret void } define void @test15_caller(i32* noalias %p, i32 %c) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test15_caller ; NOT_CGSCC_NPM-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { ; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 ; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] ; NOT_CGSCC_NPM: if.then: -; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR12:[0-9]+]] ; NOT_CGSCC_NPM-NEXT: br label [[IF_END]] ; NOT_CGSCC_NPM: if.end: -; NOT_CGSCC_NPM-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR12]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly @@ -746,20 +695,20 @@ ; Therefore, only one of the two conditions of if statementes will be fulfilled. define internal void @test16_sub(i32* noalias %p, i32 %c1, i32 %c2) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test16_sub ; NOT_CGSCC_NPM-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C1:%.*]], i32 [[C2:%.*]]) #[[ATTR7]] { ; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C1]], 0 ; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] ; NOT_CGSCC_NPM: if.then: -; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR7]] -; NOT_CGSCC_NPM-NEXT: tail call void @make_alias(i32* nofree writeonly align 4 [[P]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: tail call void @make_alias(i32* nofree writeonly align 4 [[P]]) #[[ATTR12]] ; NOT_CGSCC_NPM-NEXT: br label [[IF_END]] ; NOT_CGSCC_NPM: if.end: ; NOT_CGSCC_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C2]], 0 ; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] ; NOT_CGSCC_NPM: if.then2: -; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR12]] ; NOT_CGSCC_NPM-NEXT: br label [[IF_END3]] ; NOT_CGSCC_NPM: if.end3: ; NOT_CGSCC_NPM-NEXT: ret void @@ -803,17 +752,11 @@ } define void @test16_caller(i32* %p, i32 %c) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test16_caller -; NOT_CGSCC_NPM-SAME: (i32* nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { -; NOT_CGSCC_NPM-NEXT: tail call void @test16_sub(i32* noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR7]] -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test16_caller -; IS__CGSCC____-SAME: (i32* nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { -; IS__CGSCC____-NEXT: tail call void @test16_sub(i32* noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR12]] -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@test16_caller +; CHECK-SAME: (i32* nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; CHECK-NEXT: tail call void @test16_sub(i32* noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR12:[0-9]+]] +; CHECK-NEXT: ret void ; tail call void @test16_sub(i32* %p, i32 %c, i32 %c) ret void @@ -839,17 +782,17 @@ ; } define void @test17_caller(i32* noalias %p, i32 %c) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test17_caller ; NOT_CGSCC_NPM-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { ; NOT_CGSCC_NPM-NEXT: entry: ; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 ; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]] ; NOT_CGSCC_NPM: l1: -; NOT_CGSCC_NPM-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR12]] ; NOT_CGSCC_NPM-NEXT: br label [[L3:%.*]] ; NOT_CGSCC_NPM: l2: -; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR12]] ; NOT_CGSCC_NPM-NEXT: br label [[L3]] ; NOT_CGSCC_NPM: l3: ; NOT_CGSCC_NPM-NEXT: ret void @@ -897,32 +840,27 @@ ; } define void @noreturn() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@noreturn -; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@noreturn -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@noreturn +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret void ; call void @noreturn() ret void } define void @test18_caller(i32* noalias %p, i32 %c) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test18_caller ; NOT_CGSCC_NPM-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { ; NOT_CGSCC_NPM-NEXT: entry: ; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 ; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]] ; NOT_CGSCC_NPM: l1: -; NOT_CGSCC_NPM-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR12]] ; NOT_CGSCC_NPM-NEXT: br label [[L2]] ; NOT_CGSCC_NPM: l2: -; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR12]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly @@ -952,16 +890,19 @@ ret void } ;. -; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nounwind uwtable } ; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nounwind } ; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { nounwind ssp uwtable } -; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } ; NOT_CGSCC_NPM: attributes #[[ATTR6:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn writeonly } -; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR10]] = { nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR11]] = { willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR12]] = { nofree nosync nounwind willreturn writeonly } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC____: attributes #[[ATTR1]] = { nounwind uwtable } @@ -972,7 +913,7 @@ ; IS__CGSCC____: attributes #[[ATTR6:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } ; IS__CGSCC____: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind willreturn writeonly } ; IS__CGSCC____: attributes #[[ATTR8]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR9]] = { readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR9]] = { nounwind readnone willreturn } ; IS__CGSCC____: attributes #[[ATTR10]] = { readonly willreturn } ; IS__CGSCC____: attributes #[[ATTR11]] = { willreturn } ; IS__CGSCC____: attributes #[[ATTR12]] = { nounwind willreturn writeonly } diff --git a/llvm/test/Transforms/Attributor/nocapture-1.ll b/llvm/test/Transforms/Attributor/nocapture-1.ll --- a/llvm/test/Transforms/Attributor/nocapture-1.ll +++ b/llvm/test/Transforms/Attributor/nocapture-1.ll @@ -13,42 +13,31 @@ ; CHECK: @[[G3:[a-zA-Z0-9_$"\\.-]+]] = global i8* null ;. define i32* @c1(i32* %q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@c1 -; IS__TUNIT____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[Q:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32* [[Q]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@c1 -; IS__CGSCC____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[Q:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32* [[Q]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@c1 +; CHECK-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[Q:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: ret i32* [[Q]] ; ret i32* %q } ; It would also be acceptable to mark %q as readnone. Update @c3 too. define void @c2(i32* %q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@c2 -; IS__TUNIT____-SAME: (i32* nofree writeonly [[Q:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: store i32* [[Q]], i32** @g, align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@c2 -; IS__CGSCC____-SAME: (i32* nofree writeonly [[Q:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32* [[Q]], i32** @g, align 8 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@c2 +; CHECK-SAME: (i32* nofree writeonly [[Q:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: store i32* [[Q]], i32** @g, align 8 +; CHECK-NEXT: ret void ; store i32* %q, i32** @g ret void } define void @c3(i32* %q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@c3 ; IS__TUNIT____-SAME: (i32* nofree writeonly [[Q:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: call void @c2(i32* nofree writeonly [[Q]]) #[[ATTR1]] +; IS__TUNIT____-NEXT: call void @c2(i32* nofree writeonly [[Q]]) #[[ATTR12:[0-9]+]] ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly @@ -62,29 +51,17 @@ } define i1 @c4(i32* %q, i32 %bitno) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@c4 -; IS__TUNIT____-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] -; IS__TUNIT____-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 -; IS__TUNIT____-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] -; IS__TUNIT____: l0: -; IS__TUNIT____-NEXT: ret i1 false -; IS__TUNIT____: l1: -; IS__TUNIT____-NEXT: ret i1 true -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@c4 -; IS__CGSCC____-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] -; IS__CGSCC____-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 -; IS__CGSCC____-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] -; IS__CGSCC____: l0: -; IS__CGSCC____-NEXT: ret i1 false -; IS__CGSCC____: l1: -; IS__CGSCC____-NEXT: ret i1 true +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@c4 +; CHECK-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; CHECK-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; CHECK-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 +; CHECK-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] +; CHECK: l0: +; CHECK-NEXT: ret i1 false +; CHECK: l1: +; CHECK-NEXT: ret i1 true ; %tmp = ptrtoint i32* %q to i32 %tmp2 = lshr i32 %tmp, %bitno @@ -98,29 +75,17 @@ ; c4b is c4 but without the escaping part define i1 @c4b(i32* %q, i32 %bitno) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@c4b -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] -; IS__TUNIT____-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 -; IS__TUNIT____-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] -; IS__TUNIT____: l0: -; IS__TUNIT____-NEXT: ret i1 false -; IS__TUNIT____: l1: -; IS__TUNIT____-NEXT: ret i1 false -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@c4b -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] -; IS__CGSCC____-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 -; IS__CGSCC____-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] -; IS__CGSCC____: l0: -; IS__CGSCC____-NEXT: ret i1 false -; IS__CGSCC____: l1: -; IS__CGSCC____-NEXT: ret i1 false +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@c4b +; CHECK-SAME: (i32* nocapture nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; CHECK-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; CHECK-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 +; CHECK-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] +; CHECK: l0: +; CHECK-NEXT: ret i1 false +; CHECK: l1: +; CHECK-NEXT: ret i1 false ; %tmp = ptrtoint i32* %q to i32 %tmp2 = lshr i32 %tmp, %bitno @@ -135,25 +100,15 @@ @lookup_table = global [2 x i1] [ i1 0, i1 1 ] define i1 @c5(i32* %q, i32 %bitno) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@c5 -; IS__TUNIT____-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] -; IS__TUNIT____-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 -; IS__TUNIT____-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] -; IS__TUNIT____-NEXT: [[VAL:%.*]] = load i1, i1* [[LOOKUP]], align 1 -; IS__TUNIT____-NEXT: ret i1 [[VAL]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@c5 -; IS__CGSCC____-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] -; IS__CGSCC____-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 -; IS__CGSCC____-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] -; IS__CGSCC____-NEXT: [[VAL:%.*]] = load i1, i1* [[LOOKUP]], align 1 -; IS__CGSCC____-NEXT: ret i1 [[VAL]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@c5 +; CHECK-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; CHECK-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; CHECK-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 +; CHECK-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] +; CHECK-NEXT: [[VAL:%.*]] = load i1, i1* [[LOOKUP]], align 1 +; CHECK-NEXT: ret i1 [[VAL]] ; %tmp = ptrtoint i32* %q to i32 %tmp2 = lshr i32 %tmp, %bitno @@ -192,23 +147,14 @@ declare i32 @__gxx_personality_v0(...) define i1* @lookup_bit(i32* %q, i32 %bitno) readnone nounwind { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@lookup_bit -; IS__TUNIT____-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] -; IS__TUNIT____-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 -; IS__TUNIT____-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] -; IS__TUNIT____-NEXT: ret i1* [[LOOKUP]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@lookup_bit -; IS__CGSCC____-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] -; IS__CGSCC____-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 -; IS__CGSCC____-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] -; IS__CGSCC____-NEXT: ret i1* [[LOOKUP]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@lookup_bit +; CHECK-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; CHECK-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; CHECK-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 +; CHECK-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] +; CHECK-NEXT: ret i1* [[LOOKUP]] ; %tmp = ptrtoint i32* %q to i32 %tmp2 = lshr i32 %tmp, %bitno @@ -218,10 +164,10 @@ } define i1 @c7(i32* %q, i32 %bitno) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@c7 ; IS__TUNIT____-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: [[PTR:%.*]] = call i1* @lookup_bit(i32* noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR16:[0-9]+]] +; IS__TUNIT____-NEXT: [[PTR:%.*]] = call i1* @lookup_bit(i32* noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR18:[0-9]+]] ; IS__TUNIT____-NEXT: [[VAL:%.*]] = load i1, i1* [[PTR]], align 1 ; IS__TUNIT____-NEXT: ret i1 [[VAL]] ; @@ -239,7 +185,7 @@ define i32 @nc1(i32* %q, i32* %p, i1 %b) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@nc1 ; IS__TUNIT____-SAME: (i32* nofree [[Q:%.*]], i32* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5:[0-9]+]] { ; IS__TUNIT____-NEXT: e: @@ -279,35 +225,20 @@ } define i32 @nc1_addrspace(i32* %q, i32 addrspace(1)* %p, i1 %b) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@nc1_addrspace -; IS__TUNIT____-SAME: (i32* nofree [[Q:%.*]], i32 addrspace(1)* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5]] { -; IS__TUNIT____-NEXT: e: -; IS__TUNIT____-NEXT: br label [[L:%.*]] -; IS__TUNIT____: l: -; IS__TUNIT____-NEXT: [[X:%.*]] = phi i32 addrspace(1)* [ [[P]], [[E:%.*]] ] -; IS__TUNIT____-NEXT: [[Y:%.*]] = phi i32* [ [[Q]], [[E]] ] -; IS__TUNIT____-NEXT: [[TMP:%.*]] = addrspacecast i32 addrspace(1)* [[X]] to i32* -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = select i1 [[B]], i32* [[TMP]], i32* [[Y]] -; IS__TUNIT____-NEXT: [[VAL:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS__TUNIT____-NEXT: store i32 0, i32* [[TMP]], align 4 -; IS__TUNIT____-NEXT: store i32* [[Y]], i32** @g, align 8 -; IS__TUNIT____-NEXT: ret i32 [[VAL]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nc1_addrspace -; IS__CGSCC____-SAME: (i32* nofree [[Q:%.*]], i32 addrspace(1)* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5]] { -; IS__CGSCC____-NEXT: e: -; IS__CGSCC____-NEXT: br label [[L:%.*]] -; IS__CGSCC____: l: -; IS__CGSCC____-NEXT: [[X:%.*]] = phi i32 addrspace(1)* [ [[P]], [[E:%.*]] ] -; IS__CGSCC____-NEXT: [[Y:%.*]] = phi i32* [ [[Q]], [[E]] ] -; IS__CGSCC____-NEXT: [[TMP:%.*]] = addrspacecast i32 addrspace(1)* [[X]] to i32* -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = select i1 [[B]], i32* [[TMP]], i32* [[Y]] -; IS__CGSCC____-NEXT: [[VAL:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS__CGSCC____-NEXT: store i32 0, i32* [[TMP]], align 4 -; IS__CGSCC____-NEXT: store i32* [[Y]], i32** @g, align 8 -; IS__CGSCC____-NEXT: ret i32 [[VAL]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@nc1_addrspace +; CHECK-SAME: (i32* nofree [[Q:%.*]], i32 addrspace(1)* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5:[0-9]+]] { +; CHECK-NEXT: e: +; CHECK-NEXT: br label [[L:%.*]] +; CHECK: l: +; CHECK-NEXT: [[X:%.*]] = phi i32 addrspace(1)* [ [[P]], [[E:%.*]] ] +; CHECK-NEXT: [[Y:%.*]] = phi i32* [ [[Q]], [[E]] ] +; CHECK-NEXT: [[TMP:%.*]] = addrspacecast i32 addrspace(1)* [[X]] to i32* +; CHECK-NEXT: [[TMP2:%.*]] = select i1 [[B]], i32* [[TMP]], i32* [[Y]] +; CHECK-NEXT: [[VAL:%.*]] = load i32, i32* [[TMP2]], align 4 +; CHECK-NEXT: store i32 0, i32* [[TMP]], align 4 +; CHECK-NEXT: store i32* [[Y]], i32** @g, align 8 +; CHECK-NEXT: ret i32 [[VAL]] ; e: br label %l @@ -323,10 +254,10 @@ } define void @nc2(i32* %p, i32* %q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@nc2 ; IS__TUNIT____-SAME: (i32* nocapture nofree [[P:%.*]], i32* nofree [[Q:%.*]]) #[[ATTR5]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @nc1(i32* nofree [[Q]], i32* nocapture nofree [[P]], i1 noundef false) #[[ATTR5]] +; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @nc1(i32* nofree [[Q]], i32* nocapture nofree [[P]], i1 noundef false) #[[ATTR10:[0-9]+]] ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn @@ -357,7 +288,7 @@ ; IS__TUNIT____: Function Attrs: argmemonly nounwind ; IS__TUNIT____-LABEL: define {{[^@]+}}@nc4 ; IS__TUNIT____-SAME: (i8* [[P:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: call void @external(i8* readonly [[P]]) #[[ATTR17:[0-9]+]] +; IS__TUNIT____-NEXT: call void @external(i8* readonly [[P]]) #[[ATTR19:[0-9]+]] ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: argmemonly nounwind @@ -527,72 +458,46 @@ } define void @test_cmpxchg(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_cmpxchg -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = cmpxchg i32* [[P]], i32 0, i32 1 acquire monotonic, align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_cmpxchg -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = cmpxchg i32* [[P]], i32 0, i32 1 acquire monotonic, align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@test_cmpxchg +; CHECK-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg i32* [[P]], i32 0, i32 1 acquire monotonic, align 4 +; CHECK-NEXT: ret void ; cmpxchg i32* %p, i32 0, i32 1 acquire monotonic ret void } define void @test_cmpxchg_ptr(i32** %p, i32* %q) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_cmpxchg_ptr -; IS__TUNIT____-SAME: (i32** nocapture nofree noundef nonnull dereferenceable(8) [[P:%.*]], i32* nofree [[Q:%.*]]) #[[ATTR8]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = cmpxchg i32** [[P]], i32* null, i32* [[Q]] acquire monotonic, align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_cmpxchg_ptr -; IS__CGSCC____-SAME: (i32** nocapture nofree noundef nonnull dereferenceable(8) [[P:%.*]], i32* nofree [[Q:%.*]]) #[[ATTR8]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = cmpxchg i32** [[P]], i32* null, i32* [[Q]] acquire monotonic, align 8 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@test_cmpxchg_ptr +; CHECK-SAME: (i32** nocapture nofree noundef nonnull dereferenceable(8) [[P:%.*]], i32* nofree [[Q:%.*]]) #[[ATTR8]] { +; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg i32** [[P]], i32* null, i32* [[Q]] acquire monotonic, align 8 +; CHECK-NEXT: ret void ; cmpxchg i32** %p, i32* null, i32* %q acquire monotonic ret void } define void @test_atomicrmw(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_atomicrmw -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR8]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = atomicrmw add i32* [[P]], i32 1 seq_cst, align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_atomicrmw -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR8]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = atomicrmw add i32* [[P]], i32 1 seq_cst, align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@test_atomicrmw +; CHECK-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR8]] { +; CHECK-NEXT: [[TMP1:%.*]] = atomicrmw add i32* [[P]], i32 1 seq_cst, align 4 +; CHECK-NEXT: ret void ; atomicrmw add i32* %p, i32 1 seq_cst ret void } define void @test_volatile(i32* %x) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_volatile -; IS__TUNIT____-SAME: (i32* nofree align 4 [[X:%.*]]) #[[ATTR8]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[GEP:%.*]] = getelementptr i32, i32* [[X]], i64 1 -; IS__TUNIT____-NEXT: store volatile i32 0, i32* [[GEP]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_volatile -; IS__CGSCC____-SAME: (i32* nofree align 4 [[X:%.*]]) #[[ATTR8]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[GEP:%.*]] = getelementptr i32, i32* [[X]], i64 1 -; IS__CGSCC____-NEXT: store volatile i32 0, i32* [[GEP]], align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@test_volatile +; CHECK-SAME: (i32* nofree align 4 [[X:%.*]]) #[[ATTR8]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[GEP:%.*]] = getelementptr i32, i32* [[X]], i64 1 +; CHECK-NEXT: store volatile i32 0, i32* [[GEP]], align 4 +; CHECK-NEXT: ret void ; entry: %gep = getelementptr i32, i32* %x, i64 1 @@ -605,7 +510,7 @@ ; IS__TUNIT____-LABEL: define {{[^@]+}}@nocaptureLaunder ; IS__TUNIT____-SAME: (i8* nocapture nofree [[P:%.*]]) #[[ATTR9:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[B:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nofree [[P]]) #[[ATTR18:[0-9]+]] +; IS__TUNIT____-NEXT: [[B:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nofree [[P]]) #[[ATTR20:[0-9]+]] ; IS__TUNIT____-NEXT: store i8 42, i8* [[B]], align 1 ; IS__TUNIT____-NEXT: ret void ; @@ -627,8 +532,8 @@ define void @captureLaunder(i8* %p) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@captureLaunder -; IS__TUNIT____-SAME: (i8* nofree [[P:%.*]]) #[[ATTR5]] { -; IS__TUNIT____-NEXT: [[B:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nofree [[P]]) #[[ATTR18]] +; IS__TUNIT____-SAME: (i8* nofree [[P:%.*]]) #[[ATTR10]] { +; IS__TUNIT____-NEXT: [[B:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nofree [[P]]) #[[ATTR20]] ; IS__TUNIT____-NEXT: store i8* [[B]], i8** @g2, align 8 ; IS__TUNIT____-NEXT: ret void ; @@ -647,9 +552,9 @@ define void @nocaptureStrip(i8* %p) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@nocaptureStrip -; IS__TUNIT____-SAME: (i8* nocapture nofree writeonly [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; IS__TUNIT____-SAME: (i8* nocapture nofree writeonly [[P:%.*]]) #[[ATTR11:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[B:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* noalias nofree readnone [[P]]) #[[ATTR19:[0-9]+]] +; IS__TUNIT____-NEXT: [[B:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* noalias nofree readnone [[P]]) #[[ATTR21:[0-9]+]] ; IS__TUNIT____-NEXT: store i8 42, i8* [[B]], align 1 ; IS__TUNIT____-NEXT: ret void ; @@ -671,8 +576,8 @@ define void @captureStrip(i8* %p) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@captureStrip -; IS__TUNIT____-SAME: (i8* nofree writeonly [[P:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[B:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* noalias nofree readnone [[P]]) #[[ATTR19]] +; IS__TUNIT____-SAME: (i8* nofree writeonly [[P:%.*]]) #[[ATTR12]] { +; IS__TUNIT____-NEXT: [[B:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* noalias nofree readnone [[P]]) #[[ATTR21]] ; IS__TUNIT____-NEXT: store i8* [[B]], i8** @g3, align 8 ; IS__TUNIT____-NEXT: ret void ; @@ -689,49 +594,32 @@ } define i1 @captureICmp(i32* %x) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@captureICmp -; IS__TUNIT____-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = icmp eq i32* [[X]], null -; IS__TUNIT____-NEXT: ret i1 [[TMP1]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@captureICmp -; IS__CGSCC____-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = icmp eq i32* [[X]], null -; IS__CGSCC____-NEXT: ret i1 [[TMP1]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@captureICmp +; CHECK-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32* [[X]], null +; CHECK-NEXT: ret i1 [[TMP1]] ; %1 = icmp eq i32* %x, null ret i1 %1 } define i1 @captureICmpRev(i32* %x) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@captureICmpRev -; IS__TUNIT____-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = icmp eq i32* null, [[X]] -; IS__TUNIT____-NEXT: ret i1 [[TMP1]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@captureICmpRev -; IS__CGSCC____-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = icmp eq i32* null, [[X]] -; IS__CGSCC____-NEXT: ret i1 [[TMP1]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@captureICmpRev +; CHECK-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32* null, [[X]] +; CHECK-NEXT: ret i1 [[TMP1]] ; %1 = icmp eq i32* null, %x ret i1 %1 } define i1 @nocaptureInboundsGEPICmp(i32* %x) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmp -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i1 false -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmp -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 false +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmp +; CHECK-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: ret i1 false ; %1 = getelementptr inbounds i32, i32* %x, i32 5 %2 = bitcast i32* %1 to i8* @@ -740,15 +628,10 @@ } define i1 @nocaptureInboundsGEPICmpRev(i32* %x) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmpRev -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i1 true -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmpRev -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 true +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmpRev +; CHECK-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: ret i1 true ; %1 = getelementptr inbounds i32, i32* %x, i32 5 %2 = bitcast i32* %1 to i8* @@ -757,19 +640,12 @@ } define i1 @nocaptureDereferenceableOrNullICmp(i32* dereferenceable_or_null(4) %x) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@nocaptureDereferenceableOrNullICmp -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null -; IS__TUNIT____-NEXT: ret i1 [[TMP2]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nocaptureDereferenceableOrNullICmp -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null -; IS__CGSCC____-NEXT: ret i1 [[TMP2]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@nocaptureDereferenceableOrNullICmp +; CHECK-SAME: (i32* nocapture nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* +; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null +; CHECK-NEXT: ret i1 [[TMP2]] ; %1 = bitcast i32* %x to i8* %2 = icmp eq i8* %1, null @@ -777,19 +653,12 @@ } define i1 @captureDereferenceableOrNullICmp(i32* dereferenceable_or_null(4) %x) null_pointer_is_valid { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind null_pointer_is_valid readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@captureDereferenceableOrNullICmp -; IS__TUNIT____-SAME: (i32* nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR11:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null -; IS__TUNIT____-NEXT: ret i1 [[TMP2]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@captureDereferenceableOrNullICmp -; IS__CGSCC____-SAME: (i32* nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR13:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null -; IS__CGSCC____-NEXT: ret i1 [[TMP2]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@captureDereferenceableOrNullICmp +; CHECK-SAME: (i32* nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR13:[0-9]+]] { +; CHECK-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* +; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null +; CHECK-NEXT: ret i1 [[TMP2]] ; %1 = bitcast i32* %x to i8* %2 = icmp eq i8* %1, null @@ -842,17 +711,11 @@ ; FIXME: Both pointers should be nocapture define void @ptr_uses(i8* %ptr, i8* %wptr) { -; IS__TUNIT____: Function Attrs: nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ptr_uses -; IS__TUNIT____-SAME: (i8* [[PTR:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[WPTR:%.*]]) #[[ATTR13:[0-9]+]] { -; IS__TUNIT____-NEXT: store i8 0, i8* [[WPTR]], align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ptr_uses -; IS__CGSCC____-SAME: (i8* [[PTR:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[WPTR:%.*]]) #[[ATTR15]] { -; IS__CGSCC____-NEXT: store i8 0, i8* [[WPTR]], align 1 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@ptr_uses +; CHECK-SAME: (i8* [[PTR:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[WPTR:%.*]]) #[[ATTR15:[0-9]+]] { +; CHECK-NEXT: store i8 0, i8* [[WPTR]], align 1 +; CHECK-NEXT: ret void ; %call_ptr = call i8* @maybe_returned_ptr(i8* %ptr) %call_val = call i8 @maybe_returned_val(i8* %call_ptr) @@ -864,26 +727,28 @@ declare i8* @llvm.launder.invariant.group.p0i8(i8*) declare i8* @llvm.strip.invariant.group.p0i8(i8*) ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readonly willreturn } ; IS__TUNIT____: attributes #[[ATTR3]] = { readonly } ; IS__TUNIT____: attributes #[[ATTR4]] = { nounwind readonly } -; IS__TUNIT____: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn } ; IS__TUNIT____: attributes #[[ATTR6]] = { argmemonly nounwind } ; IS__TUNIT____: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly } -; IS__TUNIT____: attributes #[[ATTR8]] = { argmemonly nofree nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR8]] = { argmemonly nofree norecurse nounwind willreturn } ; IS__TUNIT____: attributes #[[ATTR9]] = { inaccessiblemem_or_argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR10]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR11]] = { nofree nosync nounwind null_pointer_is_valid readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR12:[0-9]+]] = { nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR13]] = { nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR14:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind speculatable willreturn } -; IS__TUNIT____: attributes #[[ATTR15:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__TUNIT____: attributes #[[ATTR16]] = { nofree nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR17]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR18]] = { willreturn } -; IS__TUNIT____: attributes #[[ATTR19]] = { readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR10]] = { nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR11]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR12]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR13]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR14:[0-9]+]] = { nounwind readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR15]] = { nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR16:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind speculatable willreturn } +; IS__TUNIT____: attributes #[[ATTR17:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; IS__TUNIT____: attributes #[[ATTR18]] = { nofree nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR19]] = { nounwind } +; IS__TUNIT____: attributes #[[ATTR20]] = { willreturn } +; IS__TUNIT____: attributes #[[ATTR21]] = { readnone willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind willreturn writeonly } diff --git a/llvm/test/Transforms/Attributor/nocapture-2.ll b/llvm/test/Transforms/Attributor/nocapture-2.ll --- a/llvm/test/Transforms/Attributor/nocapture-2.ll +++ b/llvm/test/Transforms/Attributor/nocapture-2.ll @@ -18,21 +18,13 @@ ; ; no-capture is missing on %p because it is not dereferenceable define i32 @is_null_return(i32* %p) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@is_null_return -; IS__TUNIT____-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null -; IS__TUNIT____-NEXT: [[CONV:%.*]] = zext i1 [[CMP]] to i32 -; IS__TUNIT____-NEXT: ret i32 [[CONV]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@is_null_return -; IS__CGSCC____-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null -; IS__CGSCC____-NEXT: [[CONV:%.*]] = zext i1 [[CMP]] to i32 -; IS__CGSCC____-NEXT: ret i32 [[CONV]] +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@is_null_return +; CHECK-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null +; CHECK-NEXT: [[CONV:%.*]] = zext i1 [[CMP]] to i32 +; CHECK-NEXT: ret i32 [[CONV]] ; entry: %cmp = icmp eq i32* %p, null @@ -52,51 +44,28 @@ ; ; no-capture is missing on %p because it is not dereferenceable define i32 @is_null_control(i32* %p) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@is_null_control -; IS__TUNIT____-SAME: (i32* nofree [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: store i32 1, i32* [[RETVAL]], align 4 -; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: [[CMP1:%.*]] = icmp eq i32* null, [[P]] -; IS__TUNIT____-NEXT: br i1 [[CMP1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] -; IS__TUNIT____: if.then2: -; IS__TUNIT____-NEXT: store i32 1, i32* [[RETVAL]], align 4 -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: if.end3: -; IS__TUNIT____-NEXT: store i32 0, i32* [[RETVAL]], align 4 -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* [[RETVAL]], align 4 -; IS__TUNIT____-NEXT: ret i32 [[TMP0]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@is_null_control -; IS__CGSCC____-SAME: (i32* nofree [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: store i32 1, i32* [[RETVAL]], align 4 -; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[CMP1:%.*]] = icmp eq i32* null, [[P]] -; IS__CGSCC____-NEXT: br i1 [[CMP1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] -; IS__CGSCC____: if.then2: -; IS__CGSCC____-NEXT: store i32 1, i32* [[RETVAL]], align 4 -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: if.end3: -; IS__CGSCC____-NEXT: store i32 0, i32* [[RETVAL]], align 4 -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* [[RETVAL]], align 4 -; IS__CGSCC____-NEXT: ret i32 [[TMP0]] +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@is_null_control +; CHECK-SAME: (i32* nofree [[P:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 +; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null +; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; CHECK: if.then: +; CHECK-NEXT: store i32 1, i32* [[RETVAL]], align 4 +; CHECK-NEXT: br label [[RETURN:%.*]] +; CHECK: if.end: +; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32* null, [[P]] +; CHECK-NEXT: br i1 [[CMP1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] +; CHECK: if.then2: +; CHECK-NEXT: store i32 1, i32* [[RETVAL]], align 4 +; CHECK-NEXT: br label [[RETURN]] +; CHECK: if.end3: +; CHECK-NEXT: store i32 0, i32* [[RETVAL]], align 4 +; CHECK-NEXT: br label [[RETURN]] +; CHECK: return: +; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[RETVAL]], align 4 +; CHECK-NEXT: ret i32 [[TMP0]] ; entry: %retval = alloca i32, align 4 @@ -132,17 +101,11 @@ ; } ; define double* @srec0(double* %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@srec0 -; IS__TUNIT____-SAME: (double* nocapture nofree readnone [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret double* null -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@srec0 -; IS__CGSCC____-SAME: (double* nocapture nofree readnone [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret double* null +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@srec0 +; CHECK-SAME: (double* nocapture nofree readnone [[A:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret double* null ; entry: %call = call double* @srec0(double* %a) @@ -163,17 +126,11 @@ ; Other arguments are possible here due to the no-return behavior. ; define i32* @srec16(i32* %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@srec16 -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32* undef -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@srec16 -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32* undef +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@srec16 +; CHECK-SAME: (i32* nocapture nofree readnone [[A:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32* undef ; entry: %call = call i32* @srec16(i32* %a) @@ -405,19 +362,12 @@ ; ; There should *not* be a no-capture attribute on %a define i64* @not_captured_but_returned_0(i64* %a) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@not_captured_but_returned_0 -; IS__TUNIT____-SAME: (i64* nofree noundef nonnull returned writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: store i64 0, i64* [[A]], align 8 -; IS__TUNIT____-NEXT: ret i64* [[A]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@not_captured_but_returned_0 -; IS__CGSCC____-SAME: (i64* nofree noundef nonnull returned writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: store i64 0, i64* [[A]], align 8 -; IS__CGSCC____-NEXT: ret i64* [[A]] +; CHECK: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@not_captured_but_returned_0 +; CHECK-SAME: (i64* nofree noundef nonnull returned writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: store i64 0, i64* [[A]], align 8 +; CHECK-NEXT: ret i64* [[A]] ; entry: store i64 0, i64* %a, align 8 @@ -433,21 +383,13 @@ ; ; There should *not* be a no-capture attribute on %a define i64* @not_captured_but_returned_1(i64* %a) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@not_captured_but_returned_1 -; IS__TUNIT____-SAME: (i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i64, i64* [[A]], i64 1 -; IS__TUNIT____-NEXT: store i64 1, i64* [[ADD_PTR]], align 8 -; IS__TUNIT____-NEXT: ret i64* [[ADD_PTR]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@not_captured_but_returned_1 -; IS__CGSCC____-SAME: (i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i64, i64* [[A]], i64 1 -; IS__CGSCC____-NEXT: store i64 1, i64* [[ADD_PTR]], align 8 -; IS__CGSCC____-NEXT: ret i64* [[ADD_PTR]] +; CHECK: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@not_captured_but_returned_1 +; CHECK-SAME: (i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i64, i64* [[A]], i64 1 +; CHECK-NEXT: store i64 1, i64* [[ADD_PTR]], align 8 +; CHECK-NEXT: ret i64* [[ADD_PTR]] ; entry: %add.ptr = getelementptr inbounds i64, i64* %a, i64 1 @@ -463,7 +405,7 @@ ; } ; define void @test_not_captured_but_returned_calls(i64* %a) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; IS__TUNIT____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_not_captured_but_returned_calls ; IS__TUNIT____-SAME: (i64* nocapture nofree writeonly align 8 [[A:%.*]]) #[[ATTR3]] { ; IS__TUNIT____-NEXT: entry: @@ -493,7 +435,7 @@ ; ; There should *not* be a no-capture attribute on %a define i64* @negative_test_not_captured_but_returned_call_0a(i64* %a) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; IS__TUNIT____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0a ; IS__TUNIT____-SAME: (i64* nofree returned writeonly align 8 "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3]] { ; IS__TUNIT____-NEXT: entry: @@ -520,7 +462,7 @@ ; ; There should *not* be a no-capture attribute on %a define void @negative_test_not_captured_but_returned_call_0b(i64* %a) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; IS__TUNIT____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0b ; IS__TUNIT____-SAME: (i64* nofree writeonly align 8 [[A:%.*]]) #[[ATTR3]] { ; IS__TUNIT____-NEXT: entry: @@ -553,7 +495,7 @@ ; ; There should *not* be a no-capture attribute on %a define i64* @negative_test_not_captured_but_returned_call_1a(i64* %a) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; IS__TUNIT____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1a ; IS__TUNIT____-SAME: (i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3]] { ; IS__TUNIT____-NEXT: entry: @@ -580,7 +522,7 @@ ; ; There should *not* be a no-capture attribute on %a define void @negative_test_not_captured_but_returned_call_1b(i64* %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind uwtable willreturn writeonly +; IS__TUNIT____: Function Attrs: nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1b ; IS__TUNIT____-SAME: (i64* nofree writeonly align 8 [[A:%.*]]) #[[ATTR4:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: @@ -783,11 +725,11 @@ attributes #0 = { noinline nounwind uwtable } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } ; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone } ; IS__TUNIT____: attributes #[[ATTR2]] = { noinline nounwind uwtable } -; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR4]] = { nofree noinline nosync nounwind uwtable willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR4]] = { nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } ; IS__TUNIT____: attributes #[[ATTR5]] = { readonly } ; IS__TUNIT____: attributes #[[ATTR6]] = { noinline nounwind readonly uwtable } ; IS__TUNIT____: attributes #[[ATTR7]] = { nounwind readonly } 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 @@ -8,7 +8,7 @@ %"b" = type { i8 } define hidden i64 @f1() align 2 { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@f1 ; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] align 2 { ; IS__TUNIT____-NEXT: entry: @@ -32,6 +32,8 @@ ; IS__CGSCC____-LABEL: define {{[^@]+}}@f2 ; IS__CGSCC____-SAME: () #[[ATTR0]] align 2 { ; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[THIS_ADDR:%.*]] = alloca %a*, align 8 +; IS__CGSCC____-NEXT: [[THIS1:%.*]] = load %a*, %a** [[THIS_ADDR]], align 8 ; IS__CGSCC____-NEXT: ret i64 undef ; entry: @@ -92,7 +94,5 @@ ret %"a"* %0 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/nofree.ll b/llvm/test/Transforms/Attributor/nofree.ll --- a/llvm/test/Transforms/Attributor/nofree.ll +++ b/llvm/test/Transforms/Attributor/nofree.ll @@ -17,15 +17,10 @@ ; TEST 1 (positive case) define void @only_return() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@only_return -; IS__TUNIT____-SAME: () #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@only_return -; IS__CGSCC____-SAME: () #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@only_return +; CHECK-SAME: () #[[ATTR3:[0-9]+]] { +; CHECK-NEXT: ret void ; ret void } @@ -111,40 +106,20 @@ define void @mutual_recursion1() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__TUNIT____-SAME: () #[[ATTR3]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__CGSCC_OPM-SAME: () #[[ATTR4:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__CGSCC_NPM-SAME: () #[[ATTR3]] { -; IS__CGSCC_NPM-NEXT: ret void +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@mutual_recursion1 +; CHECK-SAME: () #[[ATTR3]] { +; CHECK-NEXT: ret void ; call void @mutual_recursion2() ret void } define void @mutual_recursion2() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__TUNIT____-SAME: () #[[ATTR3]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__CGSCC_OPM-SAME: () #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__CGSCC_NPM-SAME: () #[[ATTR3]] { -; IS__CGSCC_NPM-NEXT: ret void +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@mutual_recursion2 +; CHECK-SAME: () #[[ATTR3]] { +; CHECK-NEXT: ret void ; call void @mutual_recursion1() ret void @@ -204,15 +179,10 @@ declare void @nofree_function() nofree readnone #0 define void @call_nofree_function() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@call_nofree_function -; IS__TUNIT____-SAME: () #[[ATTR3]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_nofree_function -; IS__CGSCC____-SAME: () #[[ATTR3]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@call_nofree_function +; CHECK-SAME: () #[[ATTR3]] { +; CHECK-NEXT: ret void ; tail call void @nofree_function() ret void @@ -262,38 +232,21 @@ declare float @llvm.floor.f32(float) define void @call_floor(float %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@call_floor -; IS__TUNIT____-SAME: (float [[A:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_floor -; IS__CGSCC____-SAME: (float [[A:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@call_floor +; CHECK-SAME: (float [[A:%.*]]) #[[ATTR3]] { +; CHECK-NEXT: ret void ; tail call float @llvm.floor.f32(float %a) ret void } define float @call_floor2(float %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@call_floor2 -; IS__TUNIT____-SAME: (float [[A:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR10:[0-9]+]] -; IS__TUNIT____-NEXT: ret float [[C]] -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@call_floor2 -; IS__CGSCC_OPM-SAME: (float [[A:%.*]]) #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR11:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret float [[C]] -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@call_floor2 -; IS__CGSCC_NPM-SAME: (float [[A:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR11:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret float [[C]] +; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@call_floor2 +; CHECK-SAME: (float [[A:%.*]]) #[[ATTR6:[0-9]+]] { +; CHECK-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR11:[0-9]+]] +; CHECK-NEXT: ret float [[C]] ; %c = tail call float @llvm.floor.f32(float %a) ret float %c @@ -303,30 +256,20 @@ ; Check propagation. define void @f1() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@f1 -; IS__TUNIT____-SAME: () #[[ATTR3]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC____-SAME: () #[[ATTR3]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@f1 +; CHECK-SAME: () #[[ATTR3]] { +; CHECK-NEXT: ret void ; tail call void @nofree_function() ret void } define void @f2() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@f2 -; IS__TUNIT____-SAME: () #[[ATTR3]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@f2 -; IS__CGSCC____-SAME: () #[[ATTR3]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@f2 +; CHECK-SAME: () #[[ATTR3]] { +; CHECK-NEXT: ret void ; tail call void @f1() ret void @@ -334,21 +277,13 @@ ; TEST 12 NoFree argument - positive. define double @test12(double* nocapture readonly %a) { -; IS__TUNIT____: Function Attrs: nofree nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@test12 -; IS__TUNIT____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load double, double* [[A]], align 8 -; IS__TUNIT____-NEXT: [[CALL:%.*]] = tail call double @cos(double [[TMP0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: ret double [[CALL]] -; -; IS__CGSCC____: Function Attrs: nofree nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@test12 -; IS__CGSCC____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load double, double* [[A]], align 8 -; IS__CGSCC____-NEXT: [[CALL:%.*]] = tail call double @cos(double [[TMP0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: ret double [[CALL]] +; CHECK: Function Attrs: nofree nounwind +; CHECK-LABEL: define {{[^@]+}}@test12 +; CHECK-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR7:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[TMP0:%.*]] = load double, double* [[A]], align 8 +; CHECK-NEXT: [[CALL:%.*]] = tail call double @cos(double [[TMP0]]) #[[ATTR2]] +; CHECK-NEXT: ret double [[CALL]] ; entry: %0 = load double, double* %a, align 8 @@ -397,17 +332,11 @@ ; ATTRIBUTOR-NEXT: call void @unknown(i8* nofree [[ARG1]], i8* [[ARG2]], i8* nofree [[ARG3]], i8* [[ARG4]]) ; ATTRIBUTOR-NEXT: ret void ; -; IS__TUNIT____-LABEL: define {{[^@]+}}@nonnull_assume_pos -; IS__TUNIT____-SAME: (i8* nofree [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* nofree [[ARG3:%.*]], i8* [[ARG4:%.*]]) { -; IS__TUNIT____-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11:[0-9]+]] [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ] -; IS__TUNIT____-NEXT: call void @unknown(i8* nofree [[ARG1]], i8* [[ARG2]], i8* nofree [[ARG3]], i8* [[ARG4]]) -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____-LABEL: define {{[^@]+}}@nonnull_assume_pos -; IS__CGSCC____-SAME: (i8* nofree [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* nofree [[ARG3:%.*]], i8* [[ARG4:%.*]]) { -; IS__CGSCC____-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12:[0-9]+]] [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ] -; IS__CGSCC____-NEXT: call void @unknown(i8* nofree [[ARG1]], i8* [[ARG2]], i8* nofree [[ARG3]], i8* [[ARG4]]) -; IS__CGSCC____-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_pos +; CHECK-SAME: (i8* nofree [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* nofree [[ARG3:%.*]], i8* [[ARG4:%.*]]) { +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12:[0-9]+]] [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ] +; CHECK-NEXT: call void @unknown(i8* nofree [[ARG1]], i8* [[ARG2]], i8* nofree [[ARG3]], i8* [[ARG4]]) +; CHECK-NEXT: ret void ; call void @llvm.assume(i1 true) ["nofree"(i8* %arg1), "nofree"(i8* %arg3)] call void @unknown(i8* %arg1, i8* %arg2, i8* %arg3, i8* %arg4) @@ -485,44 +414,17 @@ attributes #1 = { nounwind } attributes #2 = { nobuiltin nounwind } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR1]] = { noinline nounwind uwtable } -; IS__TUNIT____: attributes #[[ATTR2]] = { nobuiltin nounwind } -; IS__TUNIT____: attributes #[[ATTR3]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { nofree noinline nounwind readnone uwtable } -; IS__TUNIT____: attributes #[[ATTR5:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__TUNIT____: attributes #[[ATTR6]] = { nofree nounwind } -; IS__TUNIT____: attributes #[[ATTR7:[0-9]+]] = { nobuiltin nofree nounwind } -; IS__TUNIT____: attributes #[[ATTR8:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR9:[0-9]+]] = { nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR10]] = { readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR11]] = { willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { noinline nounwind uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nobuiltin nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR5:[0-9]+]] = { nofree noinline nounwind readnone uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR6:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nofree nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR8:[0-9]+]] = { nobuiltin nofree nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR9:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR10:[0-9]+]] = { nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR11]] = { readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR12]] = { willreturn } -;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { noinline nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nobuiltin nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR4:[0-9]+]] = { nofree noinline nounwind readnone uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR5:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR6]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR8:[0-9]+]] = { nobuiltin nofree nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR9:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR10:[0-9]+]] = { nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR11]] = { readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR12]] = { willreturn } +; CHECK: attributes #[[ATTR0]] = { nounwind } +; CHECK: attributes #[[ATTR1]] = { noinline nounwind uwtable } +; CHECK: attributes #[[ATTR2]] = { nobuiltin nounwind } +; CHECK: attributes #[[ATTR3]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; CHECK: attributes #[[ATTR4:[0-9]+]] = { nofree noinline nounwind readnone uwtable } +; CHECK: attributes #[[ATTR5:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; CHECK: attributes #[[ATTR6]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; CHECK: attributes #[[ATTR7]] = { nofree nounwind } +; CHECK: attributes #[[ATTR8:[0-9]+]] = { nobuiltin nofree nounwind } +; CHECK: attributes #[[ATTR9:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; CHECK: attributes #[[ATTR10:[0-9]+]] = { nounwind willreturn } +; CHECK: attributes #[[ATTR11]] = { readnone willreturn } +; CHECK: attributes #[[ATTR12]] = { willreturn } ;. 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 @@ -22,41 +22,25 @@ ; Return a pointer trivially nonnull (argument attribute) define i8* @test2(i8* nonnull %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT____-SAME: (i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i8* [[P]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC____-SAME: (i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i8* [[P]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test2 +; CHECK-SAME: (i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: ret i8* [[P]] ; ret i8* %p } define i8* @test2A(i1 %c, i8* %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]+]] { -; NOT_CGSCC_OPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] -; NOT_CGSCC_OPM: A: -; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11:[0-9]+]] [ "nonnull"(i8* [[RET]]) ] -; NOT_CGSCC_OPM-NEXT: ret i8* [[RET]] -; NOT_CGSCC_OPM: B: -; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "nonnull"(i8* [[RET]]) ] -; NOT_CGSCC_OPM-NEXT: ret i8* [[RET]] -; -; IS__CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test2A -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] -; IS__CGSCC_OPM: A: -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12:[0-9]+]] [ "nonnull"(i8* [[RET]]) ] -; IS__CGSCC_OPM-NEXT: ret i8* [[RET]] -; IS__CGSCC_OPM: B: -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "nonnull"(i8* [[RET]]) ] -; IS__CGSCC_OPM-NEXT: ret i8* [[RET]] +; CHECK: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@test2A +; CHECK-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] +; CHECK: A: +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11:[0-9]+]] [ "nonnull"(i8* [[RET]]) ] +; CHECK-NEXT: ret i8* [[RET]] +; CHECK: B: +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "nonnull"(i8* [[RET]]) ] +; CHECK-NEXT: ret i8* [[RET]] ; br i1 %c, label %A, label %B A: @@ -68,27 +52,16 @@ } define i8* @test2B(i1 %c, i8* %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]] { -; NOT_CGSCC_OPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] -; NOT_CGSCC_OPM: A: -; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "dereferenceable"(i8* [[RET]], i32 4) ] -; NOT_CGSCC_OPM-NEXT: ret i8* [[RET]] -; NOT_CGSCC_OPM: B: -; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "dereferenceable"(i8* [[RET]], i32 4) ] -; NOT_CGSCC_OPM-NEXT: ret i8* [[RET]] -; -; IS__CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test2B -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] -; IS__CGSCC_OPM: A: -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "dereferenceable"(i8* [[RET]], i32 4) ] -; IS__CGSCC_OPM-NEXT: ret i8* [[RET]] -; IS__CGSCC_OPM: B: -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "dereferenceable"(i8* [[RET]], i32 4) ] -; IS__CGSCC_OPM-NEXT: ret i8* [[RET]] +; CHECK: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@test2B +; CHECK-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] +; CHECK: A: +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "dereferenceable"(i8* [[RET]], i32 4) ] +; CHECK-NEXT: ret i8* [[RET]] +; CHECK: B: +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "dereferenceable"(i8* [[RET]], i32 4) ] +; CHECK-NEXT: ret i8* [[RET]] ; br i1 %c, label %A, label %B A: @@ -144,40 +117,20 @@ ; nonnull if neither can ever return null. (In this case, they ; just never return period.) define i8* @test4_helper() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test4_helper -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8* undef -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test4_helper -; IS__CGSCC_OPM-SAME: () #[[ATTR2:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: ret i8* undef -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test4_helper -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i8* undef +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test4_helper +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i8* undef ; %ret = call i8* @test4() ret i8* %ret } define i8* @test4() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test4 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8* undef -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test4 -; IS__CGSCC_OPM-SAME: () #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: ret i8* undef -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test4 -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i8* undef +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test4 +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i8* undef ; %ret = call i8* @test4_helper() ret i8* %ret @@ -186,32 +139,14 @@ ; Given a mutual recursive set of functions which *can* return null ; make sure we haven't marked them as nonnull. define i8* @test5_helper(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test5_helper -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__TUNIT____: rec: -; IS__TUNIT____-NEXT: br label [[END]] -; IS__TUNIT____: end: -; IS__TUNIT____-NEXT: ret i8* null -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test5_helper -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__CGSCC_OPM: rec: -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: ret i8* null -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test5_helper -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__CGSCC_NPM: rec: -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret i8* null +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test5_helper +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] +; CHECK: rec: +; CHECK-NEXT: br label [[END]] +; CHECK: end: +; CHECK-NEXT: ret i8* null ; br i1 %c, label %rec, label %end rec: @@ -222,20 +157,10 @@ } define i8* @test5(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test5 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8* null -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test5 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: ret i8* null -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test5 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i8* null +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test5 +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret i8* null ; %ret = call i8* @test5_helper(i1 %c) ret i8* %ret @@ -244,27 +169,16 @@ ; 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: () #[[ATTR2:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: entry: -; NOT_CGSCC_OPM-NEXT: [[RET:%.*]] = call i8* @ret_nonnull() -; NOT_CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; NOT_CGSCC_OPM: loop: -; NOT_CGSCC_OPM-NEXT: unreachable -; NOT_CGSCC_OPM: exit: -; NOT_CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_OPM: Function Attrs: noreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test6a -; IS__CGSCC_OPM-SAME: () #[[ATTR3:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = call i8* @ret_nonnull() -; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_OPM: loop: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: exit: -; IS__CGSCC_OPM-NEXT: unreachable +; CHECK: Function Attrs: noreturn +; CHECK-LABEL: define {{[^@]+}}@test6a +; CHECK-SAME: () #[[ATTR2:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[RET:%.*]] = call i8* @ret_nonnull() +; CHECK-NEXT: br label [[LOOP:%.*]] +; CHECK: loop: +; CHECK-NEXT: unreachable +; CHECK: exit: +; CHECK-NEXT: unreachable ; entry: %ret = call i8* @ret_nonnull() @@ -299,49 +213,32 @@ } define i8* @test7(i8* %a) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test7 -; IS__TUNIT____-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8* [[A]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test7 -; IS__CGSCC____-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8* [[A]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test7 +; CHECK-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret i8* [[A]] ; %b = getelementptr inbounds i8, i8* %a, i64 0 ret i8* %b } define i8* @test8(i8* %a) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test8 -; IS__TUNIT____-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 1 -; IS__TUNIT____-NEXT: ret i8* [[B]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test8 -; IS__CGSCC____-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 1 -; IS__CGSCC____-NEXT: ret i8* [[B]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test8 +; CHECK-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 1 +; CHECK-NEXT: ret i8* [[B]] ; %b = getelementptr inbounds i8, i8* %a, i64 1 ret i8* %b } define i8* @test9(i8* %a, i64 %n) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test9 -; IS__TUNIT____-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] -; IS__TUNIT____-NEXT: ret i8* [[B]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test9 -; IS__CGSCC____-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] -; IS__CGSCC____-NEXT: ret i8* [[B]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test9 +; CHECK-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] +; CHECK-NEXT: ret i8* [[B]] ; %b = getelementptr inbounds i8, i8* %a, i64 %n ret i8* %b @@ -350,19 +247,12 @@ ; ATTRIBUTOR_OPM: define i8* @test10 ; ATTRIBUTOR_NPM: define nonnull i8* @test10 define i8* @test10(i8* %a, i64 %n) { -; NOT_CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test10 -; NOT_CGSCC_OPM-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0]] { -; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] -; NOT_CGSCC_OPM-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] -; NOT_CGSCC_OPM-NEXT: ret i8* [[B]] -; -; IS__CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test10 -; IS__CGSCC_OPM-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] -; IS__CGSCC_OPM-NEXT: ret i8* [[B]] +; CHECK: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@test10 +; CHECK-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] +; CHECK-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] +; CHECK-NEXT: ret i8* [[B]] ; %cmp = icmp ne i64 %n, 0 call void @llvm.assume(i1 %cmp) @@ -416,19 +306,12 @@ ; Simple Argument Tests declare i8* @unknown() define void @test13_helper() { -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test13_helper() { -; NOT_CGSCC_OPM-NEXT: [[NONNULLPTR:%.*]] = tail call nonnull i8* @ret_nonnull() -; NOT_CGSCC_OPM-NEXT: [[MAYBENULLPTR:%.*]] = tail call i8* @unknown() -; NOT_CGSCC_OPM-NEXT: tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]]) #[[ATTR3:[0-9]+]] -; NOT_CGSCC_OPM-NEXT: tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13_helper() { -; IS__CGSCC_OPM-NEXT: [[NONNULLPTR:%.*]] = tail call nonnull i8* @ret_nonnull() -; IS__CGSCC_OPM-NEXT: [[MAYBENULLPTR:%.*]] = tail call i8* @unknown() -; IS__CGSCC_OPM-NEXT: tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]]) #[[ATTR4:[0-9]+]] -; IS__CGSCC_OPM-NEXT: tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@test13_helper() { +; CHECK-NEXT: [[NONNULLPTR:%.*]] = tail call nonnull i8* @ret_nonnull() +; CHECK-NEXT: [[MAYBENULLPTR:%.*]] = tail call i8* @unknown() +; CHECK-NEXT: tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]]) #[[ATTR3:[0-9]+]] +; CHECK-NEXT: tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]]) #[[ATTR3]] +; CHECK-NEXT: ret void ; %nonnullptr = tail call i8* @ret_nonnull() %maybenullptr = tail call i8* @unknown() @@ -438,21 +321,13 @@ } 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:%.*]]) #[[ATTR3]] { -; NOT_CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[B]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[C]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13 -; IS__CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone [[A:%.*]], i8* noalias nocapture nofree readnone [[B:%.*]], i8* noalias nocapture nofree readnone [[C:%.*]]) #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[B]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[C]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: nounwind +; CHECK-LABEL: define {{[^@]+}}@test13 +; CHECK-SAME: (i8* noalias nocapture nofree nonnull readnone [[A:%.*]], i8* noalias nocapture nofree readnone [[B:%.*]], i8* noalias nocapture nofree readnone [[C:%.*]]) #[[ATTR3]] { +; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR3]] +; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[B]]) #[[ATTR3]] +; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[C]]) #[[ATTR3]] +; CHECK-NEXT: ret void ; call void @use_i8_ptr(i8* %a) call void @use_i8_ptr(i8* %b) @@ -476,49 +351,27 @@ define internal i32* @f1(i32* %arg) { ; FIXME: missing nonnull It should be nonnull @f1(i32* nonnull readonly %arg) -; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f1 -; NOT_CGSCC_OPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: bb: -; NOT_CGSCC_OPM-NEXT: [[TMP:%.*]] = icmp eq i32* [[ARG]], null -; NOT_CGSCC_OPM-NEXT: br i1 [[TMP]], label [[BB9:%.*]], label [[BB1:%.*]] -; NOT_CGSCC_OPM: bb1: -; NOT_CGSCC_OPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARG]], align 4 -; NOT_CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP2]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[BB6:%.*]], label [[BB4:%.*]] -; NOT_CGSCC_OPM: bb4: -; NOT_CGSCC_OPM-NEXT: [[TMP5:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 1 -; NOT_CGSCC_OPM-NEXT: [[TMP5B:%.*]] = tail call i32* @f3(i32* nofree nonnull readonly [[TMP5]]) #[[ATTR12:[0-9]+]] -; NOT_CGSCC_OPM-NEXT: [[TMP5C:%.*]] = getelementptr inbounds i32, i32* [[TMP5B]], i64 -1 -; NOT_CGSCC_OPM-NEXT: br label [[BB9]] -; NOT_CGSCC_OPM: bb6: -; NOT_CGSCC_OPM-NEXT: [[TMP7:%.*]] = tail call i32* @f2(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR12]] -; NOT_CGSCC_OPM-NEXT: ret i32* [[TMP7]] -; NOT_CGSCC_OPM: bb9: -; NOT_CGSCC_OPM-NEXT: [[TMP10:%.*]] = phi i32* [ [[TMP5C]], [[BB4]] ], [ inttoptr (i64 4 to i32*), [[BB:%.*]] ] -; NOT_CGSCC_OPM-NEXT: ret i32* [[TMP10]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC_OPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = icmp eq i32* [[ARG]], null -; IS__CGSCC_OPM-NEXT: br i1 [[TMP]], label [[BB9:%.*]], label [[BB1:%.*]] -; IS__CGSCC_OPM: bb1: -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARG]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP2]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[BB6:%.*]], label [[BB4:%.*]] -; IS__CGSCC_OPM: bb4: -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 1 -; IS__CGSCC_OPM-NEXT: [[TMP5B:%.*]] = tail call i32* @f3(i32* nofree nonnull readonly [[TMP5]]) #[[ATTR13:[0-9]+]] -; IS__CGSCC_OPM-NEXT: [[TMP5C:%.*]] = getelementptr inbounds i32, i32* [[TMP5B]], i64 -1 -; IS__CGSCC_OPM-NEXT: br label [[BB9]] -; IS__CGSCC_OPM: bb6: -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = tail call i32* @f2(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR13]] -; IS__CGSCC_OPM-NEXT: ret i32* [[TMP7]] -; IS__CGSCC_OPM: bb9: -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = phi i32* [ [[TMP5C]], [[BB4]] ], [ inttoptr (i64 4 to i32*), [[BB:%.*]] ] -; IS__CGSCC_OPM-NEXT: ret i32* [[TMP10]] +; CHECK: Function Attrs: argmemonly nofree nosync nounwind readonly +; CHECK-LABEL: define {{[^@]+}}@f1 +; CHECK-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; CHECK-NEXT: bb: +; CHECK-NEXT: [[TMP:%.*]] = icmp eq i32* [[ARG]], null +; CHECK-NEXT: br i1 [[TMP]], label [[BB9:%.*]], label [[BB1:%.*]] +; CHECK: bb1: +; CHECK-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARG]], align 4 +; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP2]], 0 +; CHECK-NEXT: br i1 [[TMP3]], label [[BB6:%.*]], label [[BB4:%.*]] +; CHECK: bb4: +; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 1 +; CHECK-NEXT: [[TMP5B:%.*]] = tail call i32* @f3(i32* nofree nonnull readonly [[TMP5]]) #[[ATTR12:[0-9]+]] +; CHECK-NEXT: [[TMP5C:%.*]] = getelementptr inbounds i32, i32* [[TMP5B]], i64 -1 +; CHECK-NEXT: br label [[BB9]] +; CHECK: bb6: +; CHECK-NEXT: [[TMP7:%.*]] = tail call i32* @f2(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR12]] +; CHECK-NEXT: ret i32* [[TMP7]] +; CHECK: bb9: +; CHECK-NEXT: [[TMP10:%.*]] = phi i32* [ [[TMP5C]], [[BB4]] ], [ inttoptr (i64 4 to i32*), [[BB:%.*]] ] +; CHECK-NEXT: ret i32* [[TMP10]] ; bb: @@ -546,19 +399,12 @@ } define internal i32* @f2(i32* %arg) { -; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f2 -; NOT_CGSCC_OPM-SAME: (i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR4]] { -; NOT_CGSCC_OPM-NEXT: bb: -; NOT_CGSCC_OPM-NEXT: [[TMP:%.*]] = tail call i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR12]] -; NOT_CGSCC_OPM-NEXT: ret i32* [[TMP]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f2 -; IS__CGSCC_OPM-SAME: (i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = tail call i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR13]] -; IS__CGSCC_OPM-NEXT: ret i32* [[TMP]] +; CHECK: Function Attrs: argmemonly nofree nosync nounwind readonly +; CHECK-LABEL: define {{[^@]+}}@f2 +; CHECK-SAME: (i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR4]] { +; CHECK-NEXT: bb: +; CHECK-NEXT: [[TMP:%.*]] = tail call i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR12]] +; CHECK-NEXT: ret i32* [[TMP]] ; bb: %tmp = tail call i32* @f1(i32* %arg) @@ -567,19 +413,12 @@ define dso_local noalias i32* @f3(i32* %arg) { ; FIXME: missing nonnull. It should be nonnull @f3(i32* nonnull readonly %arg) -; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f3 -; NOT_CGSCC_OPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4]] { -; NOT_CGSCC_OPM-NEXT: bb: -; NOT_CGSCC_OPM-NEXT: [[TMP:%.*]] = call i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR12]] -; NOT_CGSCC_OPM-NEXT: ret i32* [[TMP]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f3 -; IS__CGSCC_OPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR5]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = call i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR13]] -; IS__CGSCC_OPM-NEXT: ret i32* [[TMP]] +; CHECK: Function Attrs: argmemonly nofree nosync nounwind readonly +; CHECK-LABEL: define {{[^@]+}}@f3 +; CHECK-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4]] { +; CHECK-NEXT: bb: +; CHECK-NEXT: [[TMP:%.*]] = call i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR12]] +; CHECK-NEXT: ret i32* [[TMP]] ; bb: ; FIXME: missing nonnull. It should be @f1(i32* nonnull readonly %arg) @@ -610,29 +449,17 @@ ; fun2(nonnull %a, %b) ; We can say that %a is nonnull but %b is not. define void @f16(i8* %a, i8 * %b, i8 %c) { -; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f16 -; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR5:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; NOT_CGSCC_OPM: if.then: -; NOT_CGSCC_OPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* nonnull [[B]]) #[[ATTR5]] -; NOT_CGSCC_OPM-NEXT: ret void -; NOT_CGSCC_OPM: if.else: -; NOT_CGSCC_OPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) #[[ATTR5]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f16 -; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__CGSCC_OPM: if.then: -; IS__CGSCC_OPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* nonnull [[B]]) #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: ret void -; IS__CGSCC_OPM: if.else: -; IS__CGSCC_OPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@f16 +; CHECK-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR5:[0-9]+]] { +; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 +; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; CHECK: if.then: +; CHECK-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* nonnull [[B]]) #[[ATTR5]] +; CHECK-NEXT: ret void +; CHECK: if.else: +; CHECK-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) #[[ATTR5]] +; CHECK-NEXT: ret void ; %cmp = icmp eq i8 %c, 0 br i1 %cmp, label %if.then, label %if.else @@ -652,35 +479,20 @@ ; 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:%.*]]) #[[ATTR5]] { -; NOT_CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; NOT_CGSCC_OPM: if.then: -; NOT_CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR5]] -; NOT_CGSCC_OPM-NEXT: br label [[CONT:%.*]] -; NOT_CGSCC_OPM: if.else: -; NOT_CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR5]] -; NOT_CGSCC_OPM-NEXT: br label [[CONT]] -; NOT_CGSCC_OPM: cont: -; NOT_CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR5]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f17 -; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR6]] { -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__CGSCC_OPM: if.then: -; IS__CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: br label [[CONT:%.*]] -; IS__CGSCC_OPM: if.else: -; IS__CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: br label [[CONT]] -; IS__CGSCC_OPM: cont: -; IS__CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@f17 +; CHECK-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR5]] { +; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 +; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; CHECK: if.then: +; CHECK-NEXT: tail call void @fun0() #[[ATTR5]] +; CHECK-NEXT: br label [[CONT:%.*]] +; CHECK: if.else: +; CHECK-NEXT: tail call void @fun0() #[[ATTR5]] +; CHECK-NEXT: br label [[CONT]] +; CHECK: cont: +; CHECK-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR5]] +; CHECK-NEXT: ret void ; %cmp = icmp eq i8 %c, 0 br i1 %cmp, label %if.then, label %if.else @@ -706,53 +518,29 @@ ; fun1(nonnull %a) define void @f18(i8* %a, i8* %b, i8 %c) { -; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f18 -; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR5]] { -; NOT_CGSCC_OPM-NEXT: [[CMP1:%.*]] = icmp eq i8 [[C]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[CMP1]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; NOT_CGSCC_OPM: if.then: -; NOT_CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR5]] -; NOT_CGSCC_OPM-NEXT: br label [[CONT:%.*]] -; NOT_CGSCC_OPM: if.else: -; NOT_CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR5]] -; NOT_CGSCC_OPM-NEXT: br label [[CONT]] -; NOT_CGSCC_OPM: cont: -; NOT_CGSCC_OPM-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 1 -; NOT_CGSCC_OPM-NEXT: br i1 [[CMP2]], label [[CONT_THEN:%.*]], label [[CONT_ELSE:%.*]] -; NOT_CGSCC_OPM: cont.then: -; NOT_CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR5]] -; NOT_CGSCC_OPM-NEXT: br label [[CONT2:%.*]] -; NOT_CGSCC_OPM: cont.else: -; NOT_CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR5]] -; NOT_CGSCC_OPM-NEXT: br label [[CONT2]] -; NOT_CGSCC_OPM: cont2: -; NOT_CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR5]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f18 -; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR6]] { -; IS__CGSCC_OPM-NEXT: [[CMP1:%.*]] = icmp eq i8 [[C]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP1]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__CGSCC_OPM: if.then: -; IS__CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: br label [[CONT:%.*]] -; IS__CGSCC_OPM: if.else: -; IS__CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: br label [[CONT]] -; IS__CGSCC_OPM: cont: -; IS__CGSCC_OPM-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 1 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP2]], label [[CONT_THEN:%.*]], label [[CONT_ELSE:%.*]] -; IS__CGSCC_OPM: cont.then: -; IS__CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: br label [[CONT2:%.*]] -; IS__CGSCC_OPM: cont.else: -; IS__CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: br label [[CONT2]] -; IS__CGSCC_OPM: cont2: -; IS__CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@f18 +; CHECK-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR5]] { +; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 [[C]], 0 +; CHECK-NEXT: br i1 [[CMP1]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; CHECK: if.then: +; CHECK-NEXT: tail call void @fun0() #[[ATTR5]] +; CHECK-NEXT: br label [[CONT:%.*]] +; CHECK: if.else: +; CHECK-NEXT: tail call void @fun0() #[[ATTR5]] +; CHECK-NEXT: br label [[CONT]] +; CHECK: cont: +; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 1 +; CHECK-NEXT: br i1 [[CMP2]], label [[CONT_THEN:%.*]], label [[CONT_ELSE:%.*]] +; CHECK: cont.then: +; CHECK-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR5]] +; CHECK-NEXT: br label [[CONT2:%.*]] +; CHECK: cont.else: +; CHECK-NEXT: tail call void @fun0() #[[ATTR5]] +; CHECK-NEXT: br label [[CONT2]] +; CHECK: cont2: +; CHECK-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR5]] +; CHECK-NEXT: ret void ; %cmp1 = icmp eq i8 %c, 0 br i1 %cmp1, label %if.then, label %if.else @@ -779,35 +567,20 @@ ; TEST 19: Loop define void @f19(i8* %a, i8* %b, i8 %c) { -; NOT_CGSCC_OPM: Function Attrs: nounwind -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f19 -; NOT_CGSCC_OPM-SAME: (i8* [[A:%.*]], i8* nonnull [[B:%.*]], i8 [[C:%.*]]) #[[ATTR3]] { -; NOT_CGSCC_OPM-NEXT: br label [[LOOP_HEADER:%.*]] -; NOT_CGSCC_OPM: loop.header: -; NOT_CGSCC_OPM-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[CMP2]], label [[LOOP_BODY:%.*]], label [[LOOP_EXIT:%.*]] -; NOT_CGSCC_OPM: loop.body: -; NOT_CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: br label [[LOOP_HEADER]] -; NOT_CGSCC_OPM: loop.exit: -; NOT_CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f19 -; IS__CGSCC_OPM-SAME: (i8* [[A:%.*]], i8* nonnull [[B:%.*]], i8 [[C:%.*]]) #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: br label [[LOOP_HEADER:%.*]] -; IS__CGSCC_OPM: loop.header: -; IS__CGSCC_OPM-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP2]], label [[LOOP_BODY:%.*]], label [[LOOP_EXIT:%.*]] -; IS__CGSCC_OPM: loop.body: -; IS__CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: br label [[LOOP_HEADER]] -; IS__CGSCC_OPM: loop.exit: -; IS__CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: nounwind +; CHECK-LABEL: define {{[^@]+}}@f19 +; CHECK-SAME: (i8* [[A:%.*]], i8* nonnull [[B:%.*]], i8 [[C:%.*]]) #[[ATTR3]] { +; CHECK-NEXT: br label [[LOOP_HEADER:%.*]] +; CHECK: loop.header: +; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 0 +; CHECK-NEXT: br i1 [[CMP2]], label [[LOOP_BODY:%.*]], label [[LOOP_EXIT:%.*]] +; CHECK: loop.body: +; CHECK-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR3]] +; CHECK-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR3]] +; CHECK-NEXT: br label [[LOOP_HEADER]] +; CHECK: loop.exit: +; CHECK-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR3]] +; CHECK-NEXT: ret void ; br label %loop.header loop.header: @@ -940,17 +713,11 @@ ; The nonnull callsite is guaranteed to execute, so the argument must be nonnull throughout the parent. define i8 @parent7(i8* %a) { -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@parent7 -; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]]) { -; NOT_CGSCC_OPM-NEXT: [[RET:%.*]] = call i8 @use1safecall(i8* nonnull readonly [[A]]) #[[ATTR13:[0-9]+]] -; NOT_CGSCC_OPM-NEXT: call void @use1nonnull(i8* nonnull [[A]]) -; NOT_CGSCC_OPM-NEXT: ret i8 [[RET]] -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@parent7 -; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]]) { -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = call i8 @use1safecall(i8* nonnull readonly [[A]]) #[[ATTR14:[0-9]+]] -; IS__CGSCC_OPM-NEXT: call void @use1nonnull(i8* nonnull [[A]]) -; IS__CGSCC_OPM-NEXT: ret i8 [[RET]] +; CHECK-LABEL: define {{[^@]+}}@parent7 +; CHECK-SAME: (i8* nonnull [[A:%.*]]) { +; CHECK-NEXT: [[RET:%.*]] = call i8 @use1safecall(i8* nonnull readonly [[A]]) #[[ATTR13:[0-9]+]] +; CHECK-NEXT: call void @use1nonnull(i8* nonnull [[A]]) +; CHECK-NEXT: ret i8 [[RET]] ; @@ -964,31 +731,18 @@ declare i32 @esfp(...) define i1 @parent8(i8* %a, i8* %bogus1, i8* %b) personality i8* bitcast (i32 (...)* @esfp to i8*){ -; NOT_CGSCC_OPM: Function Attrs: nounwind -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@parent8 -; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* nocapture nofree readnone [[BOGUS1:%.*]], i8* nonnull [[B:%.*]]) #[[ATTR3]] personality i8* bitcast (i32 (...)* @esfp to i8*) { -; NOT_CGSCC_OPM-NEXT: entry: -; NOT_CGSCC_OPM-NEXT: invoke void @use2nonnull(i8* nonnull [[A]], i8* nonnull [[B]]) -; NOT_CGSCC_OPM-NEXT: to label [[CONT:%.*]] unwind label [[EXC:%.*]] -; NOT_CGSCC_OPM: cont: -; NOT_CGSCC_OPM-NEXT: ret i1 false -; NOT_CGSCC_OPM: exc: -; NOT_CGSCC_OPM-NEXT: [[LP:%.*]] = landingpad { i8*, i32 } -; NOT_CGSCC_OPM-NEXT: filter [0 x i8*] zeroinitializer -; NOT_CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@parent8 -; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* nocapture nofree readnone [[BOGUS1:%.*]], i8* nonnull [[B:%.*]]) #[[ATTR4]] personality i8* bitcast (i32 (...)* @esfp to i8*) { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: invoke void @use2nonnull(i8* nonnull [[A]], i8* nonnull [[B]]) -; IS__CGSCC_OPM-NEXT: to label [[CONT:%.*]] unwind label [[EXC:%.*]] -; IS__CGSCC_OPM: cont: -; IS__CGSCC_OPM-NEXT: ret i1 false -; IS__CGSCC_OPM: exc: -; IS__CGSCC_OPM-NEXT: [[LP:%.*]] = landingpad { i8*, i32 } -; IS__CGSCC_OPM-NEXT: filter [0 x i8*] zeroinitializer -; IS__CGSCC_OPM-NEXT: unreachable +; CHECK: Function Attrs: nounwind +; CHECK-LABEL: define {{[^@]+}}@parent8 +; CHECK-SAME: (i8* nonnull [[A:%.*]], i8* nocapture nofree readnone [[BOGUS1:%.*]], i8* nonnull [[B:%.*]]) #[[ATTR3]] personality i8* bitcast (i32 (...)* @esfp to i8*) { +; CHECK-NEXT: entry: +; CHECK-NEXT: invoke void @use2nonnull(i8* nonnull [[A]], i8* nonnull [[B]]) +; CHECK-NEXT: to label [[CONT:%.*]] unwind label [[EXC:%.*]] +; CHECK: cont: +; CHECK-NEXT: ret i1 false +; CHECK: exc: +; CHECK-NEXT: [[LP:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: filter [0 x i8*] zeroinitializer +; CHECK-NEXT: unreachable ; entry: @@ -1006,17 +760,11 @@ } define i32* @gep1(i32* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@gep1 -; IS__TUNIT____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 -; IS__TUNIT____-NEXT: ret i32* [[Q]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@gep1 -; IS__CGSCC____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 -; IS__CGSCC____-NEXT: ret i32* [[Q]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@gep1 +; CHECK-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 +; CHECK-NEXT: ret i32* [[Q]] ; %q = getelementptr inbounds i32, i32* %p, i32 1 ret i32* %q @@ -1024,40 +772,22 @@ define i32* @gep1_no_null_opt(i32* %p) #0 { ; Should't be able to derive nonnull based on gep. -; IS__TUNIT____: Function Attrs: nofree nosync nounwind null_pointer_is_valid readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@gep1_no_null_opt -; IS__TUNIT____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__TUNIT____-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 -; IS__TUNIT____-NEXT: ret i32* [[Q]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@gep1_no_null_opt -; IS__CGSCC_OPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 -; IS__CGSCC_OPM-NEXT: ret i32* [[Q]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@gep1_no_null_opt -; IS__CGSCC_NPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 -; IS__CGSCC_NPM-NEXT: ret i32* [[Q]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@gep1_no_null_opt +; CHECK-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR7:[0-9]+]] { +; CHECK-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 +; CHECK-NEXT: ret i32* [[Q]] ; %q = getelementptr inbounds i32, i32* %p, i32 1 ret i32* %q } define i32 addrspace(3)* @gep2(i32 addrspace(3)* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@gep2 -; IS__TUNIT____-SAME: (i32 addrspace(3)* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32 addrspace(3)* [[P]], i32 1 -; IS__TUNIT____-NEXT: ret i32 addrspace(3)* [[Q]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@gep2 -; IS__CGSCC____-SAME: (i32 addrspace(3)* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32 addrspace(3)* [[P]], i32 1 -; IS__CGSCC____-NEXT: ret i32 addrspace(3)* [[Q]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@gep2 +; CHECK-SAME: (i32 addrspace(3)* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32 addrspace(3)* [[P]], i32 1 +; CHECK-NEXT: ret i32 addrspace(3)* [[Q]] ; %q = getelementptr inbounds i32, i32 addrspace(3)* %p, i32 1 ret i32 addrspace(3)* %q @@ -1065,15 +795,10 @@ ; FIXME: We should propagate dereferenceable here but *not* nonnull define i32 addrspace(3)* @as(i32 addrspace(3)* dereferenceable(4) %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@as -; IS__TUNIT____-SAME: (i32 addrspace(3)* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32 addrspace(3)* [[P]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@as -; IS__CGSCC____-SAME: (i32 addrspace(3)* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 addrspace(3)* [[P]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@as +; CHECK-SAME: (i32 addrspace(3)* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret i32 addrspace(3)* [[P]] ; ret i32 addrspace(3)* %p } @@ -1089,15 +814,10 @@ } define i32* @g1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@g1 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32* inttoptr (i64 4 to i32*) -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@g1 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32* inttoptr (i64 4 to i32*) +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@g1 +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i32* inttoptr (i64 4 to i32*) ; %c = call i32* @g2() ret i32* %c @@ -1105,17 +825,11 @@ declare void @use_i32_ptr(i32* readnone nocapture) nounwind define internal void @called_by_weak(i32* %a) { -; NOT_CGSCC_OPM: Function Attrs: nounwind -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@called_by_weak -; NOT_CGSCC_OPM-SAME: (i32* noalias nocapture nonnull readnone [[A:%.*]]) #[[ATTR3]] { -; NOT_CGSCC_OPM-NEXT: call void @use_i32_ptr(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@called_by_weak -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nonnull readnone [[A:%.*]]) #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: call void @use_i32_ptr(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: nounwind +; CHECK-LABEL: define {{[^@]+}}@called_by_weak +; CHECK-SAME: (i32* noalias nocapture nonnull readnone [[A:%.*]]) #[[ATTR3]] { +; CHECK-NEXT: call void @use_i32_ptr(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR3]] +; CHECK-NEXT: ret void ; call void @use_i32_ptr(i32* %a) ret void @@ -1124,15 +838,10 @@ ; 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]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@weak_caller -; IS__CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]]) { -; IS__CGSCC_OPM-NEXT: call void @called_by_weak(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@weak_caller +; CHECK-SAME: (i32* nonnull [[A:%.*]]) { +; CHECK-NEXT: call void @called_by_weak(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR3]] +; CHECK-NEXT: ret void ; call void @called_by_weak(i32* %a) ret void @@ -1140,34 +849,22 @@ ; Expect nonnull define internal void @control(i32* dereferenceable(4) %a) { -; NOT_CGSCC_OPM: Function Attrs: nounwind -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@control -; NOT_CGSCC_OPM-SAME: (i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR3]] { -; NOT_CGSCC_OPM-NEXT: call void @use_i32_ptr(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@control -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: call void @use_i32_ptr(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: nounwind +; CHECK-LABEL: define {{[^@]+}}@control +; CHECK-SAME: (i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR3]] { +; CHECK-NEXT: call void @use_i32_ptr(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR3]] +; CHECK-NEXT: ret void ; call void @use_i32_ptr(i32* %a) ret void } ; Avoid nonnull as we do not touch naked functions define internal void @naked(i32* dereferenceable(4) %a) naked { -; NOT_CGSCC_OPM: Function Attrs: naked -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@naked -; NOT_CGSCC_OPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR8:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: call void @use_i32_ptr(i32* [[A]]) -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: naked -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@naked -; IS__CGSCC_OPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @use_i32_ptr(i32* [[A]]) -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: naked +; CHECK-LABEL: define {{[^@]+}}@naked +; CHECK-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR8:[0-9]+]] { +; CHECK-NEXT: call void @use_i32_ptr(i32* [[A]]) +; CHECK-NEXT: ret void ; call void @use_i32_ptr(i32* %a) ret void @@ -1175,35 +872,22 @@ ; 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:%.*]]) #[[ATTR9:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: call void @use_i32_ptr(i32* [[A]]) -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: noinline optnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@optnone -; IS__CGSCC_OPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR10:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @use_i32_ptr(i32* [[A]]) -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: noinline optnone +; CHECK-LABEL: define {{[^@]+}}@optnone +; CHECK-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR9:[0-9]+]] { +; CHECK-NEXT: call void @use_i32_ptr(i32* [[A]]) +; CHECK-NEXT: ret void ; call void @use_i32_ptr(i32* %a) ret void } define void @make_live(i32* nonnull dereferenceable(8) %a) { -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@make_live -; NOT_CGSCC_OPM-SAME: (i32* noundef nonnull align 16 dereferenceable(8) [[A:%.*]]) { -; NOT_CGSCC_OPM-NEXT: call void @naked(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) -; NOT_CGSCC_OPM-NEXT: call void @control(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: call void @optnone(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@make_live -; IS__CGSCC_OPM-SAME: (i32* noundef nonnull align 16 dereferenceable(8) [[A:%.*]]) { -; IS__CGSCC_OPM-NEXT: call void @naked(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) -; IS__CGSCC_OPM-NEXT: call void @control(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: call void @optnone(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) -; IS__CGSCC_OPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@make_live +; CHECK-SAME: (i32* noundef nonnull align 16 dereferenceable(8) [[A:%.*]]) { +; CHECK-NEXT: call void @naked(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) +; CHECK-NEXT: call void @control(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR3]] +; CHECK-NEXT: call void @optnone(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) +; CHECK-NEXT: ret void ; call void @naked(i32* nonnull dereferenceable(8) align 16 %a) call void @control(i32* nonnull dereferenceable(8) align 16 %a) @@ -1222,21 +906,21 @@ declare i32 @g(i32*) willreturn nounwind define i32 @nonnull_exec_ctx_1(i32* %a, i32 %b) { ; -; IS__TUNIT_OPM: Function Attrs: nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1 -; IS__TUNIT_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: en: -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; IS__TUNIT_OPM: ex: -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR3]] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP5]] -; IS__TUNIT_OPM: hd: -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; IS__TUNIT_OPM-NEXT: tail call void @h(i32* [[A]]) #[[ATTR3]] -; IS__TUNIT_OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; IS__TUNIT_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; IS__TUNIT_OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] +; IS________OPM: Function Attrs: nounwind +; IS________OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1 +; IS________OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR3]] { +; IS________OPM-NEXT: en: +; IS________OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 +; IS________OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] +; IS________OPM: ex: +; IS________OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR3]] +; IS________OPM-NEXT: ret i32 [[TMP5]] +; IS________OPM: hd: +; IS________OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] +; IS________OPM-NEXT: tail call void @h(i32* [[A]]) #[[ATTR3]] +; IS________OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 +; IS________OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] +; IS________OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] ; ; IS________NPM: Function Attrs: nounwind willreturn ; IS________NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1 @@ -1254,22 +938,6 @@ ; IS________NPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] ; IS________NPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] ; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1 -; IS__CGSCC_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: en: -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; IS__CGSCC_OPM: ex: -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP5]] -; IS__CGSCC_OPM: hd: -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; IS__CGSCC_OPM-NEXT: tail call void @h(i32* [[A]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] -; en: %tmp3 = icmp eq i32 %b, 0 br i1 %tmp3, label %ex, label %hd @@ -1288,23 +956,23 @@ define i32 @nonnull_exec_ctx_1b(i32* %a, i32 %b) { ; -; IS__TUNIT_OPM: Function Attrs: nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b -; IS__TUNIT_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: en: -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; IS__TUNIT_OPM: ex: -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR3]] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP5]] -; IS__TUNIT_OPM: hd: -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; IS__TUNIT_OPM-NEXT: tail call void @h(i32* [[A]]) #[[ATTR3]] -; IS__TUNIT_OPM-NEXT: br label [[HD2]] -; IS__TUNIT_OPM: hd2: -; IS__TUNIT_OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; IS__TUNIT_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; IS__TUNIT_OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] +; IS________OPM: Function Attrs: nounwind +; IS________OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b +; IS________OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR3]] { +; IS________OPM-NEXT: en: +; IS________OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 +; IS________OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] +; IS________OPM: ex: +; IS________OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR3]] +; IS________OPM-NEXT: ret i32 [[TMP5]] +; IS________OPM: hd: +; IS________OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] +; IS________OPM-NEXT: tail call void @h(i32* [[A]]) #[[ATTR3]] +; IS________OPM-NEXT: br label [[HD2]] +; IS________OPM: hd2: +; IS________OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 +; IS________OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] +; IS________OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] ; ; IS________NPM: Function Attrs: nounwind willreturn ; IS________NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b @@ -1324,24 +992,6 @@ ; IS________NPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] ; IS________NPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] ; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b -; IS__CGSCC_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: en: -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; IS__CGSCC_OPM: ex: -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP5]] -; IS__CGSCC_OPM: hd: -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; IS__CGSCC_OPM-NEXT: tail call void @h(i32* [[A]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: br label [[HD2]] -; IS__CGSCC_OPM: hd2: -; IS__CGSCC_OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] -; en: %tmp3 = icmp eq i32 %b, 0 br i1 %tmp3, label %ex, label %hd @@ -1363,37 +1013,21 @@ define i32 @nonnull_exec_ctx_2(i32* %a, i32 %b) willreturn nounwind { ; -; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2 -; NOT_CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] { -; NOT_CGSCC_OPM-NEXT: en: -; NOT_CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; NOT_CGSCC_OPM: ex: -; NOT_CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: ret i32 [[TMP5]] -; NOT_CGSCC_OPM: hd: -; NOT_CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; NOT_CGSCC_OPM-NEXT: tail call void @h(i32* nonnull [[A]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; NOT_CGSCC_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; NOT_CGSCC_OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] -; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2 -; IS__CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] { -; IS__CGSCC_OPM-NEXT: en: -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; IS__CGSCC_OPM: ex: -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP5]] -; IS__CGSCC_OPM: hd: -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; IS__CGSCC_OPM-NEXT: tail call void @h(i32* nonnull [[A]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] +; CHECK: Function Attrs: nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2 +; CHECK-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] { +; CHECK-NEXT: en: +; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 +; CHECK-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] +; CHECK: ex: +; CHECK-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR3]] +; CHECK-NEXT: ret i32 [[TMP5]] +; CHECK: hd: +; CHECK-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] +; CHECK-NEXT: tail call void @h(i32* nonnull [[A]]) #[[ATTR3]] +; CHECK-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 +; CHECK-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] +; CHECK-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] ; en: %tmp3 = icmp eq i32 %b, 0 @@ -1413,41 +1047,23 @@ define i32 @nonnull_exec_ctx_2b(i32* %a, i32 %b) willreturn nounwind { ; -; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b -; NOT_CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] { -; NOT_CGSCC_OPM-NEXT: en: -; NOT_CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; NOT_CGSCC_OPM: ex: -; NOT_CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: ret i32 [[TMP5]] -; NOT_CGSCC_OPM: hd: -; NOT_CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; NOT_CGSCC_OPM-NEXT: tail call void @h(i32* nonnull [[A]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: br label [[HD2]] -; NOT_CGSCC_OPM: hd2: -; NOT_CGSCC_OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; NOT_CGSCC_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; NOT_CGSCC_OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] -; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b -; IS__CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] { -; IS__CGSCC_OPM-NEXT: en: -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; IS__CGSCC_OPM: ex: -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP5]] -; IS__CGSCC_OPM: hd: -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; IS__CGSCC_OPM-NEXT: tail call void @h(i32* nonnull [[A]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: br label [[HD2]] -; IS__CGSCC_OPM: hd2: -; IS__CGSCC_OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] +; CHECK: Function Attrs: nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b +; CHECK-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] { +; CHECK-NEXT: en: +; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 +; CHECK-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] +; CHECK: ex: +; CHECK-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR3]] +; CHECK-NEXT: ret i32 [[TMP5]] +; CHECK: hd: +; CHECK-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] +; CHECK-NEXT: tail call void @h(i32* nonnull [[A]]) #[[ATTR3]] +; CHECK-NEXT: br label [[HD2]] +; CHECK: hd2: +; CHECK-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 +; CHECK-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] +; CHECK-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] ; en: %tmp3 = icmp eq i32 %b, 0 @@ -1584,23 +1200,14 @@ ; We should not mark the return of @strrchr as `nonnull`, it may well be NULL! define i8* @mybasename(i8* nofree readonly %str) { -; NOT_CGSCC_OPM: Function Attrs: nofree nounwind readonly willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@mybasename -; NOT_CGSCC_OPM-SAME: (i8* nofree readonly [[STR:%.*]]) #[[ATTR10:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: [[CALL:%.*]] = call i8* @strrchr(i8* nofree readonly [[STR]], i32 noundef 47) #[[ATTR13]] -; NOT_CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp ne i8* [[CALL]], null -; NOT_CGSCC_OPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[CALL]], i64 1 -; NOT_CGSCC_OPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i8* [[ADD_PTR]], i8* [[STR]] -; NOT_CGSCC_OPM-NEXT: ret i8* [[COND]] -; -; IS__CGSCC_OPM: Function Attrs: nofree nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@mybasename -; IS__CGSCC_OPM-SAME: (i8* nofree readonly [[STR:%.*]]) #[[ATTR11:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i8* @strrchr(i8* nofree readonly [[STR]], i32 noundef 47) #[[ATTR14]] -; IS__CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp ne i8* [[CALL]], null -; IS__CGSCC_OPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[CALL]], i64 1 -; IS__CGSCC_OPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i8* [[ADD_PTR]], i8* [[STR]] -; IS__CGSCC_OPM-NEXT: ret i8* [[COND]] +; CHECK: Function Attrs: nofree nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@mybasename +; CHECK-SAME: (i8* nofree readonly [[STR:%.*]]) #[[ATTR10:[0-9]+]] { +; CHECK-NEXT: [[CALL:%.*]] = call i8* @strrchr(i8* nofree readonly [[STR]], i32 noundef 47) #[[ATTR13]] +; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i8* [[CALL]], null +; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[CALL]], i64 1 +; CHECK-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i8* [[ADD_PTR]], i8* [[STR]] +; CHECK-NEXT: ret i8* [[COND]] ; %call = call i8* @strrchr(i8* %str, i32 47) %tobool = icmp ne i8* %call, null @@ -1617,19 +1224,12 @@ ; ATTRIBUTOR-NEXT: [[TMP1:%.*]] = call i8* @unknown() ; ATTRIBUTOR-NEXT: ret void ; -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_pos -; NOT_CGSCC_OPM-SAME: (i8* nocapture nofree nonnull readnone [[ARG:%.*]]) { -; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "nonnull"(i8* [[ARG]]) ] -; NOT_CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: [[TMP1:%.*]] = call i8* @unknown() -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_pos -; IS__CGSCC_OPM-SAME: (i8* nocapture nofree nonnull readnone [[ARG:%.*]]) { -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "nonnull"(i8* [[ARG]]) ] -; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = call i8* @unknown() -; IS__CGSCC_OPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_pos +; CHECK-SAME: (i8* nocapture nofree nonnull readnone [[ARG:%.*]]) { +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "nonnull"(i8* [[ARG]]) ] +; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]] +; CHECK-NEXT: [[TMP1:%.*]] = call i8* @unknown() +; CHECK-NEXT: ret void ; call void @llvm.assume(i1 true) ["nonnull"(i8* %arg)] call void @use_i8_ptr(i8* %arg) @@ -1650,29 +1250,17 @@ ; 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() -; NOT_CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ] -; NOT_CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: [[TMP2:%.*]] = call i8* @unknown() -; NOT_CGSCC_OPM-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ] -; NOT_CGSCC_OPM-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_neg -; IS__CGSCC_OPM-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) { -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = call i8* @unknown() -; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ] -; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = call i8* @unknown() -; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ] -; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_neg +; CHECK-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) { +; CHECK-NEXT: [[TMP1:%.*]] = call i8* @unknown() +; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG]]) #[[ATTR3]] +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ] +; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]] +; CHECK-NEXT: [[TMP2:%.*]] = call i8* @unknown() +; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]] +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ] +; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]] +; CHECK-NEXT: ret void ; call i8* @unknown() call void @use_i8_ptr(i8* %arg) @@ -1688,15 +1276,10 @@ declare void @use_i8_ptr_ret(i8* nofree nocapture readnone) nounwind willreturn define i8* @nonnull_function_ptr_1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@nonnull_function_ptr_1 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8* bitcast (i8* ()* @nonnull_function_ptr_1 to i8*) -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nonnull_function_ptr_1 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8* bitcast (i8* ()* @nonnull_function_ptr_1 to i8*) +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@nonnull_function_ptr_1 +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i8* bitcast (i8* ()* @nonnull_function_ptr_1 to i8*) ; %bc = bitcast i8*()* @nonnull_function_ptr_1 to i8* ret i8* %bc @@ -1704,15 +1287,10 @@ declare i8* @function_decl() define i8* @nonnull_function_ptr_2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@nonnull_function_ptr_2 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8* bitcast (i8* ()* @function_decl to i8*) -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nonnull_function_ptr_2 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8* bitcast (i8* ()* @function_decl to i8*) +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@nonnull_function_ptr_2 +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i8* bitcast (i8* ()* @function_decl to i8*) ; %bc = bitcast i8*()* @function_decl to i8* ret i8* %bc @@ -1734,49 +1312,18 @@ attributes #0 = { null_pointer_is_valid } attributes #1 = { nounwind willreturn} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { noreturn } -; IS__TUNIT____: attributes #[[ATTR3]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind readonly } -; IS__TUNIT____: attributes #[[ATTR5]] = { nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR6:[0-9]+]] = { nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR7]] = { nofree nosync nounwind null_pointer_is_valid readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR8]] = { naked } -; IS__TUNIT____: attributes #[[ATTR9]] = { noinline optnone } -; IS__TUNIT____: attributes #[[ATTR10]] = { nofree nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR11]] = { willreturn } -; IS__TUNIT____: attributes #[[ATTR12]] = { nofree nosync nounwind readonly } -; IS__TUNIT____: attributes #[[ATTR13]] = { readonly willreturn } -;. -; 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 nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { noreturn } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind readonly } -; IS__CGSCC_OPM: attributes #[[ATTR6]] = { nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR7:[0-9]+]] = { nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR9]] = { naked } -; IS__CGSCC_OPM: attributes #[[ATTR10]] = { noinline optnone } -; IS__CGSCC_OPM: attributes #[[ATTR11]] = { nofree nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR12]] = { willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR13]] = { nofree nosync nounwind readonly } -; IS__CGSCC_OPM: attributes #[[ATTR14]] = { readonly willreturn } -;. -; 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]] = { noreturn } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind readonly } -; IS__CGSCC_NPM: attributes #[[ATTR5]] = { nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR6:[0-9]+]] = { nounwind readonly willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR8]] = { naked } -; IS__CGSCC_NPM: attributes #[[ATTR9]] = { noinline optnone } -; IS__CGSCC_NPM: attributes #[[ATTR10]] = { nofree nounwind readonly willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR11]] = { willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR12]] = { nofree nosync nounwind readonly } -; IS__CGSCC_NPM: attributes #[[ATTR13]] = { readonly willreturn } +; CHECK: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; CHECK: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR2]] = { noreturn } +; CHECK: attributes #[[ATTR3]] = { nounwind } +; CHECK: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind readonly } +; CHECK: attributes #[[ATTR5]] = { nounwind willreturn } +; CHECK: attributes #[[ATTR6:[0-9]+]] = { nounwind readonly willreturn } +; CHECK: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } +; CHECK: attributes #[[ATTR8]] = { naked } +; CHECK: attributes #[[ATTR9]] = { noinline optnone } +; CHECK: attributes #[[ATTR10]] = { nofree nounwind readonly willreturn } +; CHECK: attributes #[[ATTR11]] = { willreturn } +; CHECK: attributes #[[ATTR12]] = { nofree nosync nounwind readonly } +; CHECK: attributes #[[ATTR13]] = { readonly willreturn } ;. 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 @@ -5,85 +5,49 @@ ; 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 define i32 @leaf() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@leaf -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32 1 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@leaf -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32 1 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@leaf +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: ret i32 1 ; ret i32 1 } define i32 @self_rec() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@self_rec -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 4 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@self_rec -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 4 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@self_rec +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i32 4 ; %a = call i32 @self_rec() ret i32 4 } define i32 @indirect_rec() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@indirect_rec -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 undef -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@indirect_rec -; IS__CGSCC_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: ret i32 undef -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@indirect_rec -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: ret i32 undef +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@indirect_rec +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i32 undef ; %a = call i32 @indirect_rec2() ret i32 %a } define i32 @indirect_rec2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@indirect_rec2 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 undef -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@indirect_rec2 -; IS__CGSCC_OPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: ret i32 undef -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@indirect_rec2 -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: ret i32 undef +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@indirect_rec2 +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i32 undef ; %a = call i32 @indirect_rec() ret i32 %a } define i32 @extern() { -; NOT_CGSCC_OPM: Function Attrs: nosync readnone -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@extern -; NOT_CGSCC_OPM-SAME: () #[[ATTR1:[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: () #[[ATTR2:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @k() -; IS__CGSCC_OPM-NEXT: ret i32 [[A]] +; CHECK: Function Attrs: nosync readnone +; CHECK-LABEL: define {{[^@]+}}@extern +; CHECK-SAME: () #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: [[A:%.*]] = call i32 @k() +; CHECK-NEXT: ret i32 [[A]] ; %a = call i32 @k() ret i32 %a @@ -94,23 +58,11 @@ declare i32 @k() readnone define void @intrinsic(i8* %dest, i8* %src, i32 %len) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@intrinsic -; IS__TUNIT____-SAME: (i8* nocapture nofree writeonly [[DEST:%.*]], i8* nocapture nofree readonly [[SRC:%.*]], i32 [[LEN:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-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) #[[ATTR8:[0-9]+]] -; IS__TUNIT____-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:%.*]]) #[[ATTR4:[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) #[[ATTR8:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@intrinsic -; IS__CGSCC_NPM-SAME: (i8* nocapture nofree writeonly [[DEST:%.*]], i8* nocapture nofree readonly [[SRC:%.*]], i32 [[LEN:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC_NPM-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) #[[ATTR7:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret void +; 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:%.*]]) #[[ATTR3:[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) #[[ATTR7:[0-9]+]] +; CHECK-NEXT: ret void ; call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i1 false) ret void @@ -121,23 +73,11 @@ declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i1) define internal i32 @called_by_norecurse() { -; IS__TUNIT____: Function Attrs: nosync readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@called_by_norecurse -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @k() -; IS__TUNIT____-NEXT: ret i32 undef -; -; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@called_by_norecurse -; IS__CGSCC_OPM-SAME: () #[[ATTR6:[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: () #[[ATTR5:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @k() -; IS__CGSCC_NPM-NEXT: ret i32 undef +; CHECK: Function Attrs: norecurse nosync readnone +; CHECK-LABEL: define {{[^@]+}}@called_by_norecurse +; CHECK-SAME: () #[[ATTR5:[0-9]+]] { +; CHECK-NEXT: [[A:%.*]] = call i32 @k() +; CHECK-NEXT: ret i32 undef ; %a = call i32 @k() ret i32 %a @@ -145,60 +85,42 @@ define void @m() norecurse { ; IS__TUNIT____: Function Attrs: norecurse nosync readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@m -; IS__TUNIT____-SAME: () #[[ATTR5:[0-9]+]] { +; IS__TUNIT____-SAME: () #[[ATTR5]] { ; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() #[[ATTR1]] ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@m -; IS__CGSCC_OPM-SAME: () #[[ATTR6]] { -; 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: () #[[ATTR5]] { -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() -; IS__CGSCC_NPM-NEXT: ret void +; IS__CGSCC____: Function Attrs: norecurse nosync readnone +; IS__CGSCC____-LABEL: define {{[^@]+}}@m +; IS__CGSCC____-SAME: () #[[ATTR5]] { +; IS__CGSCC____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() +; IS__CGSCC____-NEXT: ret void ; %a = call i32 @called_by_norecurse() ret void } define internal i32 @called_by_norecurse_indirectly() { -; NOT_CGSCC_OPM: Function Attrs: nosync readnone -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@called_by_norecurse_indirectly -; NOT_CGSCC_OPM-SAME: () #[[ATTR1]] { -; 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: () #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @k() -; IS__CGSCC_OPM-NEXT: ret i32 [[A]] +; CHECK: Function Attrs: norecurse nosync readnone +; CHECK-LABEL: define {{[^@]+}}@called_by_norecurse_indirectly +; CHECK-SAME: () #[[ATTR5]] { +; CHECK-NEXT: [[A:%.*]] = call i32 @k() +; CHECK-NEXT: ret i32 [[A]] ; %a = call i32 @k() ret i32 %a } define internal i32 @o() { -; IS__TUNIT____: Function Attrs: nosync readnone +; IS__TUNIT____: Function Attrs: norecurse nosync readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@o -; IS__TUNIT____-SAME: () #[[ATTR1]] { +; IS__TUNIT____-SAME: () #[[ATTR5]] { ; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() #[[ATTR1]] ; IS__TUNIT____-NEXT: ret i32 [[A]] ; -; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@o -; IS__CGSCC_OPM-SAME: () #[[ATTR6]] { -; 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: () #[[ATTR5]] { -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() -; IS__CGSCC_NPM-NEXT: ret i32 [[A]] +; IS__CGSCC____: Function Attrs: norecurse nosync readnone +; IS__CGSCC____-LABEL: define {{[^@]+}}@o +; IS__CGSCC____-SAME: () #[[ATTR5]] { +; IS__CGSCC____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() +; IS__CGSCC____-NEXT: ret i32 [[A]] ; %a = call i32 @called_by_norecurse_indirectly() ret i32 %a @@ -210,48 +132,29 @@ ; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @o() #[[ATTR1]] ; IS__TUNIT____-NEXT: ret i32 [[A]] ; -; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@p -; IS__CGSCC_OPM-SAME: () #[[ATTR6]] { -; 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: () #[[ATTR5]] { -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @o() -; IS__CGSCC_NPM-NEXT: ret i32 [[A]] +; IS__CGSCC____: Function Attrs: norecurse nosync readnone +; IS__CGSCC____-LABEL: define {{[^@]+}}@p +; IS__CGSCC____-SAME: () #[[ATTR5]] { +; IS__CGSCC____-NEXT: [[A:%.*]] = call i32 @o() +; IS__CGSCC____-NEXT: ret i32 [[A]] ; %a = call i32 @o() ret i32 %a } define void @f(i32 %x) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@f -; IS__TUNIT____-SAME: (i32 [[X:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 -; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 -; IS__TUNIT____-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: br label [[IF_END]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR1]] { -; 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: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC_OPM: if.then: -; IS__CGSCC_OPM-NEXT: br label [[IF_END]] -; IS__CGSCC_OPM: if.end: -; IS__CGSCC_OPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f +; NOT_CGSCC_NPM-SAME: (i32 [[X:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: br label [[IF_END]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f @@ -281,17 +184,11 @@ } define void @g() norecurse { -; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@g -; IS__TUNIT____-SAME: () #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@g -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@g +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret void ; entry: call void @f(i32 0) @@ -317,17 +214,11 @@ } define i32 @eval_func2(i32 (i32)* , i32) local_unnamed_addr null_pointer_is_valid{ -; NOT_CGSCC_NPM: Function Attrs: null_pointer_is_valid -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@eval_func2 -; NOT_CGSCC_NPM-SAME: (i32 (i32)* nocapture nofree noundef [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = tail call i32 [[TMP0]](i32 [[TMP1]]) -; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP3]] -; -; IS__CGSCC_NPM: Function Attrs: null_pointer_is_valid -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@eval_func2 -; IS__CGSCC_NPM-SAME: (i32 (i32)* nocapture nofree noundef [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR6:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = tail call i32 [[TMP0]](i32 [[TMP1]]) -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP3]] +; 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 #[[ATTR6:[0-9]+]] { +; CHECK-NEXT: [[TMP3:%.*]] = tail call i32 [[TMP0]](i32 [[TMP1]]) +; CHECK-NEXT: ret i32 [[TMP3]] ; %3 = tail call i32 %0(i32 %1) #2 ret i32 %3 @@ -336,19 +227,12 @@ ; Call an unknown function in a dead block. declare void @unknown() define i32 @call_unknown_in_dead_block() local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@call_unknown_in_dead_block -; IS__TUNIT____-SAME: () local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 0 -; IS__TUNIT____: Dead: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_unknown_in_dead_block -; IS__CGSCC____-SAME: () local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 0 -; IS__CGSCC____: Dead: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@call_unknown_in_dead_block +; CHECK-SAME: () local_unnamed_addr #[[ATTR0]] { +; CHECK-NEXT: ret i32 0 +; CHECK: Dead: +; CHECK-NEXT: unreachable ; ret i32 0 Dead: @@ -357,32 +241,12 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nosync readnone } -; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { readnone } -; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { argmemonly nofree nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR5]] = { norecurse nosync readnone } -; IS__TUNIT____: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR7]] = { null_pointer_is_valid } -; IS__TUNIT____: attributes #[[ATTR8]] = { willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nosync readnone } -; IS__CGSCC_OPM: attributes #[[ATTR3:[0-9]+]] = { readnone } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR6]] = { norecurse nosync readnone } -; IS__CGSCC_OPM: attributes #[[ATTR7]] = { null_pointer_is_valid } -; IS__CGSCC_OPM: attributes #[[ATTR8]] = { willreturn } -;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nosync readnone } -; IS__CGSCC_NPM: attributes #[[ATTR2:[0-9]+]] = { readnone } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR4:[0-9]+]] = { argmemonly nofree nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR5]] = { norecurse nosync readnone } -; IS__CGSCC_NPM: attributes #[[ATTR6]] = { null_pointer_is_valid } -; IS__CGSCC_NPM: attributes #[[ATTR7]] = { willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR1]] = { nosync readnone } +; CHECK: attributes #[[ATTR2:[0-9]+]] = { readnone } +; CHECK: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn } +; CHECK: attributes #[[ATTR4:[0-9]+]] = { argmemonly nofree nounwind willreturn } +; CHECK: attributes #[[ATTR5]] = { norecurse nosync readnone } +; CHECK: attributes #[[ATTR6]] = { null_pointer_is_valid } +; CHECK: attributes #[[ATTR7]] = { willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/noreturn.ll b/llvm/test/Transforms/Attributor/noreturn.ll --- a/llvm/test/Transforms/Attributor/noreturn.ll +++ b/llvm/test/Transforms/Attributor/noreturn.ll @@ -17,17 +17,11 @@ ; } ; define void @srec0() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@srec0 -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@srec0 -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@srec0 +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret void ; entry: call void @srec0() @@ -42,21 +36,13 @@ ; } ; define i32 @srec16(i32 %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@srec16 -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@srec16 -; IS__CGSCC____-SAME: (i32 [[A:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@srec16 +; CHECK-SAME: (i32 [[A:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: unreachable +; CHECK: exit: +; CHECK-NEXT: unreachable ; entry: %call = call i32 @srec16(i32 %a) @@ -89,21 +75,13 @@ ; } ; define i32 @endless_loop(i32 %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@endless_loop -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[WHILE_BODY:%.*]] -; IS__TUNIT____: while.body: -; IS__TUNIT____-NEXT: br label [[WHILE_BODY]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@endless_loop -; IS__CGSCC____-SAME: (i32 [[A:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[WHILE_BODY:%.*]] -; IS__CGSCC____: while.body: -; IS__CGSCC____-NEXT: br label [[WHILE_BODY]] +; CHECK: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable +; CHECK-LABEL: define {{[^@]+}}@endless_loop +; CHECK-SAME: (i32 [[A:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: br label [[WHILE_BODY:%.*]] +; CHECK: while.body: +; CHECK-NEXT: br label [[WHILE_BODY]] ; entry: br label %while.body @@ -122,25 +100,15 @@ ; ; FIXME: no-return missing (D65243 should fix this) define i32 @dead_return(i32 %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@dead_return -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[WHILE_BODY:%.*]] -; IS__TUNIT____: while.body: -; IS__TUNIT____-NEXT: br label [[WHILE_BODY]] -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@dead_return -; IS__CGSCC____-SAME: (i32 [[A:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[WHILE_BODY:%.*]] -; IS__CGSCC____: while.body: -; IS__CGSCC____-NEXT: br label [[WHILE_BODY]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable +; CHECK-LABEL: define {{[^@]+}}@dead_return +; CHECK-SAME: (i32 [[A:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: br label [[WHILE_BODY:%.*]] +; CHECK: while.body: +; CHECK-NEXT: br label [[WHILE_BODY]] +; CHECK: return: +; CHECK-NEXT: unreachable ; entry: br label %while.body @@ -160,31 +128,18 @@ ; } ; define i32 @multiple_noreturn_calls(i32 %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@multiple_noreturn_calls -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; IS__TUNIT____: cond.true: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: cond.false: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: cond.end: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@multiple_noreturn_calls -; IS__CGSCC____-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; IS__CGSCC____: cond.true: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: cond.false: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: cond.end: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@multiple_noreturn_calls +; CHECK-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 +; CHECK-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; CHECK: cond.true: +; CHECK-NEXT: unreachable +; CHECK: cond.false: +; CHECK-NEXT: unreachable +; CHECK: cond.end: +; CHECK-NEXT: unreachable ; entry: %cmp = icmp eq i32 %a, 0 @@ -208,21 +163,13 @@ ; FIXME: we should derive "UB" as an argument and report it to the user on request. define i32 @endless_loop_but_willreturn() willreturn { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@endless_loop_but_willreturn -; IS__TUNIT____-SAME: () #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[WHILE_BODY:%.*]] -; IS__TUNIT____: while.body: -; IS__TUNIT____-NEXT: br label [[WHILE_BODY]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@endless_loop_but_willreturn -; IS__CGSCC____-SAME: () #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[WHILE_BODY:%.*]] -; IS__CGSCC____: while.body: -; IS__CGSCC____-NEXT: br label [[WHILE_BODY]] +; CHECK: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@endless_loop_but_willreturn +; CHECK-SAME: () #[[ATTR3:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: br label [[WHILE_BODY:%.*]] +; CHECK: while.body: +; CHECK-NEXT: br label [[WHILE_BODY]] ; entry: br label %while.body @@ -233,17 +180,11 @@ ; TEST 6b: willreturn means *not* no-return or UB define i32 @UB_and_willreturn() willreturn { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@UB_and_willreturn -; IS__TUNIT____-SAME: () #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@UB_and_willreturn -; IS__CGSCC____-SAME: () #[[ATTR3]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@UB_and_willreturn +; CHECK-SAME: () #[[ATTR3]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: unreachable ; entry: unreachable @@ -251,13 +192,8 @@ attributes #0 = { noinline nounwind uwtable } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree noinline noreturn nosync nounwind readnone uwtable } -; IS__TUNIT____: attributes #[[ATTR3]] = { nofree noreturn nosync nounwind readnone willreturn } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } -; IS__CGSCC____: attributes #[[ATTR3]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; CHECK: attributes #[[ATTR1]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; CHECK: attributes #[[ATTR2]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } +; CHECK: attributes #[[ATTR3]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/nosync.ll b/llvm/test/Transforms/Attributor/nosync.ll --- a/llvm/test/Transforms/Attributor/nosync.ll +++ b/llvm/test/Transforms/Attributor/nosync.ll @@ -32,19 +32,12 @@ ; CHECK: @[[A:[a-zA-Z0-9_$"\\.-]+]] = common global i32 0, align 4 ;. define i32* @foo(%struct.ST* %s) nounwind uwtable readnone optsize ssp { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind optsize readnone ssp uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (%struct.ST* nofree readnone "no-capture-maybe-returned" [[S:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], %struct.ST* [[S]], i64 1, i32 2, i32 1, i64 5, i64 13 -; IS__TUNIT____-NEXT: ret i32* [[ARRAYIDX]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind optsize readnone ssp uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (%struct.ST* nofree readnone "no-capture-maybe-returned" [[S:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], %struct.ST* [[S]], i64 1, i32 2, i32 1, i64 5, i64 13 -; IS__CGSCC____-NEXT: ret i32* [[ARRAYIDX]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind optsize readnone ssp uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@foo +; CHECK-SAME: (%struct.ST* nofree readnone "no-capture-maybe-returned" [[S:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], %struct.ST* [[S]], i64 1, i32 2, i32 1, i64 5, i64 13 +; CHECK-NEXT: ret i32* [[ARRAYIDX]] ; entry: %arrayidx = getelementptr inbounds %struct.ST, %struct.ST* %s, i64 1, i32 2, i32 1, i64 5, i64 13 @@ -211,14 +204,14 @@ ; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nounwind uwtable ; IS__TUNIT____-LABEL: define {{[^@]+}}@scc1 ; IS__TUNIT____-SAME: (i32* nofree [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__TUNIT____-NEXT: tail call void @scc2(i32* nofree [[TMP0]]) #[[ATTR7:[0-9]+]] -; IS__TUNIT____-NEXT: [[VAL:%.*]] = tail call i32 @volatile_load(i32* nofree align 4 [[TMP0]]) #[[ATTR7]] +; IS__TUNIT____-NEXT: tail call void @scc2(i32* nofree [[TMP0]]) #[[ATTR19:[0-9]+]] +; IS__TUNIT____-NEXT: [[VAL:%.*]] = tail call i32 @volatile_load(i32* nofree align 4 [[TMP0]]) #[[ATTR19]] ; IS__TUNIT____-NEXT: ret i32 [[VAL]] ; ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline nounwind uwtable ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@scc1 ; IS__CGSCC_OPM-SAME: (i32* nofree [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: tail call void @scc2(i32* nofree [[TMP0]]) #[[ATTR19:[0-9]+]] +; IS__CGSCC_OPM-NEXT: tail call void @scc2(i32* nofree [[TMP0]]) #[[ATTR8:[0-9]+]] ; IS__CGSCC_OPM-NEXT: [[VAL:%.*]] = tail call i32 @volatile_load(i32* nofree noundef align 4 [[TMP0]]) #[[ATTR20:[0-9]+]] ; IS__CGSCC_OPM-NEXT: ret i32 [[VAL]] ; @@ -235,17 +228,17 @@ } define void @scc2(i32* %0) noinline nounwind uwtable { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@scc2 -; IS__TUNIT____-SAME: (i32* nofree [[TMP0:%.*]]) #[[ATTR5]] { -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = tail call i32 @scc1(i32* nofree [[TMP0]]) #[[ATTR7]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@scc2 -; IS__CGSCC____-SAME: (i32* nofree [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = tail call i32 @scc1(i32* nofree [[TMP0]]) #[[ATTR19:[0-9]+]] -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree noinline nounwind uwtable +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@scc2 +; NOT_CGSCC_OPM-SAME: (i32* nofree [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: [[TMP2:%.*]] = tail call i32 @scc1(i32* nofree [[TMP0]]) #[[ATTR19:[0-9]+]] +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nounwind uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@scc2 +; IS__CGSCC_OPM-SAME: (i32* nofree [[TMP0:%.*]]) #[[ATTR6:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = tail call i32 @scc1(i32* nofree [[TMP0]]) #[[ATTR21:[0-9]+]] +; IS__CGSCC_OPM-NEXT: ret void ; tail call i32 @scc1(i32* %0); ret void; @@ -271,23 +264,23 @@ %"struct.std::__atomic_base" = type { i8 } define void @foo1(i32* %0, %"struct.std::atomic"* %1) { -; IS__TUNIT____: Function Attrs: nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo1 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: store i32 100, i32* [[TMP0]], align 4 -; IS__TUNIT____-NEXT: fence release -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 -; IS__TUNIT____-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo1 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 100, i32* [[TMP0]], align 4 -; IS__CGSCC____-NEXT: fence release -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 -; IS__CGSCC____-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: nofree norecurse nounwind willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@foo1 +; NOT_CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: store i32 100, i32* [[TMP0]], align 4 +; NOT_CGSCC_OPM-NEXT: fence release +; NOT_CGSCC_OPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; NOT_CGSCC_OPM-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nounwind willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@foo1 +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR7:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: store i32 100, i32* [[TMP0]], align 4 +; IS__CGSCC_OPM-NEXT: fence release +; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; IS__CGSCC_OPM-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 +; IS__CGSCC_OPM-NEXT: ret void ; store i32 100, i32* %0, align 4 fence release @@ -297,33 +290,33 @@ } define void @bar(i32* %0, %"struct.std::atomic"* %1) { -; IS__TUNIT____: Function Attrs: nofree nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR7]] { -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 -; IS__TUNIT____-NEXT: br label [[TMP4:%.*]] -; IS__TUNIT____: 4: -; IS__TUNIT____-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 -; IS__TUNIT____-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 -; IS__TUNIT____-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 -; IS__TUNIT____-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] -; IS__TUNIT____: 8: -; IS__TUNIT____-NEXT: fence acquire -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@bar -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 -; IS__CGSCC____-NEXT: br label [[TMP4:%.*]] -; IS__CGSCC____: 4: -; IS__CGSCC____-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 -; IS__CGSCC____-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 -; IS__CGSCC____-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 -; IS__CGSCC____-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] -; IS__CGSCC____: 8: -; IS__CGSCC____-NEXT: fence acquire -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: nofree norecurse nounwind +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@bar +; NOT_CGSCC_OPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; NOT_CGSCC_OPM-NEXT: br label [[TMP4:%.*]] +; NOT_CGSCC_OPM: 4: +; NOT_CGSCC_OPM-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 +; NOT_CGSCC_OPM-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 +; NOT_CGSCC_OPM-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 +; NOT_CGSCC_OPM-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] +; NOT_CGSCC_OPM: 8: +; NOT_CGSCC_OPM-NEXT: fence acquire +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nounwind +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bar +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR8]] { +; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; IS__CGSCC_OPM-NEXT: br label [[TMP4:%.*]] +; IS__CGSCC_OPM: 4: +; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 +; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 +; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 +; IS__CGSCC_OPM-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] +; IS__CGSCC_OPM: 8: +; IS__CGSCC_OPM-NEXT: fence acquire +; IS__CGSCC_OPM-NEXT: ret void ; %3 = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* %1, i64 0, i32 0, i32 0 br label %4 @@ -341,23 +334,23 @@ ; TEST 13 - Fence syncscope("singlethread") seq_cst define void @foo1_singlethread(i32* %0, %"struct.std::atomic"* %1) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo1_singlethread -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__TUNIT____-NEXT: store i32 100, i32* [[TMP0]], align 4 -; IS__TUNIT____-NEXT: fence syncscope("singlethread") release -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 -; IS__TUNIT____-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo1_singlethread -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 100, i32* [[TMP0]], align 4 -; IS__CGSCC____-NEXT: fence syncscope("singlethread") release -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 -; IS__CGSCC____-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@foo1_singlethread +; NOT_CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: store i32 100, i32* [[TMP0]], align 4 +; NOT_CGSCC_OPM-NEXT: fence syncscope("singlethread") release +; NOT_CGSCC_OPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; NOT_CGSCC_OPM-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@foo1_singlethread +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR9:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: store i32 100, i32* [[TMP0]], align 4 +; IS__CGSCC_OPM-NEXT: fence syncscope("singlethread") release +; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; IS__CGSCC_OPM-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 +; IS__CGSCC_OPM-NEXT: ret void ; store i32 100, i32* %0, align 4 fence syncscope("singlethread") release @@ -367,33 +360,33 @@ } define void @bar_singlethread(i32* %0, %"struct.std::atomic"* %1) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar_singlethread -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 -; IS__TUNIT____-NEXT: br label [[TMP4:%.*]] -; IS__TUNIT____: 4: -; IS__TUNIT____-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 -; IS__TUNIT____-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 -; IS__TUNIT____-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 -; IS__TUNIT____-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] -; IS__TUNIT____: 8: -; IS__TUNIT____-NEXT: fence syncscope("singlethread") acquire -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@bar_singlethread -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 -; IS__CGSCC____-NEXT: br label [[TMP4:%.*]] -; IS__CGSCC____: 4: -; IS__CGSCC____-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 -; IS__CGSCC____-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 -; IS__CGSCC____-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 -; IS__CGSCC____-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] -; IS__CGSCC____: 8: -; IS__CGSCC____-NEXT: fence syncscope("singlethread") acquire -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@bar_singlethread +; NOT_CGSCC_OPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR9:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; NOT_CGSCC_OPM-NEXT: br label [[TMP4:%.*]] +; NOT_CGSCC_OPM: 4: +; NOT_CGSCC_OPM-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 +; NOT_CGSCC_OPM-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 +; NOT_CGSCC_OPM-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 +; NOT_CGSCC_OPM-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] +; NOT_CGSCC_OPM: 8: +; NOT_CGSCC_OPM-NEXT: fence syncscope("singlethread") acquire +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bar_singlethread +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR10:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; IS__CGSCC_OPM-NEXT: br label [[TMP4:%.*]] +; IS__CGSCC_OPM: 4: +; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 +; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 +; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 +; IS__CGSCC_OPM-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] +; IS__CGSCC_OPM: 8: +; IS__CGSCC_OPM-NEXT: fence syncscope("singlethread") acquire +; IS__CGSCC_OPM-NEXT: ret void ; %3 = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* %1, i64 0, i32 0, i32 0 br label %4 @@ -417,23 +410,17 @@ ; It is odd to add nocapture but a result of the llvm.memcpy nocapture. ; define i32 @memcpy_volatile(i8* %ptr1, i8* %ptr2) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@memcpy_volatile -; IS__TUNIT____-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR10:[0-9]+]] { -; IS__TUNIT____-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[PTR1]], i8* noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR18:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 4 +; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree nounwind willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@memcpy_volatile +; NOT_CGSCC_OPM-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR10:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[PTR1]], i8* noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR20:[0-9]+]] +; NOT_CGSCC_OPM-NEXT: ret i32 4 ; ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nounwind willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@memcpy_volatile -; IS__CGSCC_OPM-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR10:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[PTR1]], i8* noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR21:[0-9]+]] +; IS__CGSCC_OPM-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR11:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[PTR1]], i8* noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR22:[0-9]+]] ; IS__CGSCC_OPM-NEXT: ret i32 4 -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@memcpy_volatile -; IS__CGSCC_NPM-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR10:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[PTR1]], i8* noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR20:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 4 ; call void @llvm.memcpy(i8* %ptr1, i8* %ptr2, i32 8, i1 1) ret i32 4 @@ -444,23 +431,17 @@ ; It is odd to add nocapture but a result of the llvm.memset nocapture. ; define i32 @memset_non_volatile(i8* %ptr1, i8 %val) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@memset_non_volatile -; IS__TUNIT____-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR11:[0-9]+]] { -; IS__TUNIT____-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR19:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 4 +; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@memset_non_volatile +; NOT_CGSCC_OPM-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR11:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR21:[0-9]+]] +; NOT_CGSCC_OPM-NEXT: ret i32 4 ; ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@memset_non_volatile -; IS__CGSCC_OPM-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR11:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR22:[0-9]+]] +; IS__CGSCC_OPM-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR12:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR23:[0-9]+]] ; IS__CGSCC_OPM-NEXT: ret i32 4 -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@memset_non_volatile -; IS__CGSCC_NPM-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR11:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR21:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 4 ; call void @llvm.memset(i8* %ptr1, i8 %val, i32 8, i1 0) ret i32 4 @@ -482,11 +463,17 @@ ; TEST 17 - negative. Convergent define void @convergent_readnone(){ -; CHECK: Function Attrs: readnone -; CHECK-LABEL: define {{[^@]+}}@convergent_readnone -; CHECK-SAME: () #[[ATTR13:[0-9]+]] { -; CHECK-NEXT: call void @readnone_test() -; CHECK-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: readnone +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@convergent_readnone +; NOT_CGSCC_OPM-SAME: () #[[ATTR13:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: call void @readnone_test() +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: readnone +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@convergent_readnone +; IS__CGSCC_OPM-SAME: () #[[ATTR14:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: call void @readnone_test() +; IS__CGSCC_OPM-NEXT: ret void ; call void @readnone_test() ret void @@ -500,11 +487,17 @@ ; TEST 18 - negative. Synchronizing intrinsic define void @i_totally_sync() { -; CHECK: Function Attrs: nounwind -; CHECK-LABEL: define {{[^@]+}}@i_totally_sync -; CHECK-SAME: () #[[ATTR14:[0-9]+]] { -; CHECK-NEXT: tail call void @llvm.x86.sse2.clflush(i8* noundef nonnull align 4 dereferenceable(4) bitcast (i32* @a to i8*)) -; CHECK-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: nounwind +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@i_totally_sync +; NOT_CGSCC_OPM-SAME: () #[[ATTR14:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: tail call void @llvm.x86.sse2.clflush(i8* noundef nonnull align 4 dereferenceable(4) bitcast (i32* @a to i8*)) +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: nounwind +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@i_totally_sync +; IS__CGSCC_OPM-SAME: () #[[ATTR15:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: tail call void @llvm.x86.sse2.clflush(i8* noundef nonnull align 4 dereferenceable(4) bitcast (i32* @a to i8*)) +; IS__CGSCC_OPM-NEXT: ret void ; tail call void @llvm.x86.sse2.clflush(i8* bitcast (i32* @a to i8*)) ret void @@ -515,64 +508,60 @@ ; TEST 19 - positive, readnone & non-convergent intrinsic. define i32 @cos_test(float %x) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cos_test -; IS__TUNIT____-SAME: (float [[X:%.*]]) #[[ATTR15:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32 4 +; NOT_CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@cos_test +; NOT_CGSCC_OPM-SAME: (float [[X:%.*]]) #[[ATTR15:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: ret i32 4 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cos_test -; IS__CGSCC____-SAME: (float [[X:%.*]]) #[[ATTR15:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32 4 +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@cos_test +; IS__CGSCC_OPM-SAME: (float [[X:%.*]]) #[[ATTR16:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: ret i32 4 ; call float @llvm.cos(float %x) ret i32 4 } define float @cos_test2(float %x) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cos_test2 -; IS__TUNIT____-SAME: (float [[X:%.*]]) #[[ATTR15]] { -; IS__TUNIT____-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) #[[ATTR20:[0-9]+]] -; IS__TUNIT____-NEXT: ret float [[C]] +; NOT_CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@cos_test2 +; NOT_CGSCC_OPM-SAME: (float [[X:%.*]]) #[[ATTR16:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) #[[ATTR22:[0-9]+]] +; NOT_CGSCC_OPM-NEXT: ret float [[C]] ; ; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@cos_test2 -; IS__CGSCC_OPM-SAME: (float [[X:%.*]]) #[[ATTR16:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) #[[ATTR23:[0-9]+]] +; IS__CGSCC_OPM-SAME: (float [[X:%.*]]) #[[ATTR17:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) #[[ATTR24:[0-9]+]] ; IS__CGSCC_OPM-NEXT: ret float [[C]] -; -; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@cos_test2 -; IS__CGSCC_NPM-SAME: (float [[X:%.*]]) #[[ATTR16:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) #[[ATTR22:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret float [[C]] ; %c = call float @llvm.cos(float %x) ret float %c } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind optsize readnone ssp uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { argmemonly nofree norecurse nounwind uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR3]] = { noinline nosync nounwind uwtable } -; IS__TUNIT____: attributes #[[ATTR4]] = { noinline nounwind uwtable } -; IS__TUNIT____: attributes #[[ATTR5]] = { argmemonly nofree noinline nounwind uwtable } -; IS__TUNIT____: attributes #[[ATTR6]] = { nofree nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR7]] = { nofree nounwind } -; IS__TUNIT____: attributes #[[ATTR8]] = { nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR9]] = { nofree nosync nounwind } -; IS__TUNIT____: attributes #[[ATTR10]] = { argmemonly nofree nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR11]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR12:[0-9]+]] = { convergent readnone } -; IS__TUNIT____: attributes #[[ATTR13]] = { readnone } -; IS__TUNIT____: attributes #[[ATTR14]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR15]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR16:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR17:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__TUNIT____: attributes #[[ATTR18]] = { willreturn } -; IS__TUNIT____: attributes #[[ATTR19]] = { willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR20]] = { readnone willreturn } +; NOT_CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind optsize readnone ssp uwtable willreturn } +; NOT_CGSCC_OPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind uwtable willreturn } +; NOT_CGSCC_OPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nounwind uwtable willreturn } +; NOT_CGSCC_OPM: attributes #[[ATTR3]] = { noinline nosync nounwind uwtable } +; NOT_CGSCC_OPM: attributes #[[ATTR4]] = { noinline nounwind uwtable } +; NOT_CGSCC_OPM: attributes #[[ATTR5]] = { argmemonly nofree noinline nounwind uwtable } +; NOT_CGSCC_OPM: attributes #[[ATTR6]] = { nofree norecurse nounwind willreturn } +; NOT_CGSCC_OPM: attributes #[[ATTR7]] = { nofree norecurse nounwind } +; NOT_CGSCC_OPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind willreturn } +; NOT_CGSCC_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind } +; NOT_CGSCC_OPM: attributes #[[ATTR10]] = { argmemonly nofree nounwind willreturn } +; NOT_CGSCC_OPM: attributes #[[ATTR11]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_OPM: attributes #[[ATTR12:[0-9]+]] = { convergent readnone } +; NOT_CGSCC_OPM: attributes #[[ATTR13]] = { readnone } +; NOT_CGSCC_OPM: attributes #[[ATTR14]] = { nounwind } +; NOT_CGSCC_OPM: attributes #[[ATTR15]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_CGSCC_OPM: attributes #[[ATTR16]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_OPM: attributes #[[ATTR17:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; NOT_CGSCC_OPM: attributes #[[ATTR18:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; NOT_CGSCC_OPM: attributes #[[ATTR19]] = { nofree nounwind } +; NOT_CGSCC_OPM: attributes #[[ATTR20]] = { willreturn } +; NOT_CGSCC_OPM: attributes #[[ATTR21]] = { willreturn writeonly } +; NOT_CGSCC_OPM: attributes #[[ATTR22]] = { readnone willreturn } ;. ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind optsize readnone ssp uwtable willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind uwtable willreturn } @@ -580,46 +569,23 @@ ; IS__CGSCC_OPM: attributes #[[ATTR3]] = { noinline nosync nounwind uwtable } ; IS__CGSCC_OPM: attributes #[[ATTR4]] = { noinline nounwind uwtable } ; IS__CGSCC_OPM: attributes #[[ATTR5]] = { argmemonly nofree noinline nounwind uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR6]] = { nofree norecurse nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nofree norecurse nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR10]] = { argmemonly nofree nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR11]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR12:[0-9]+]] = { convergent readnone } -; IS__CGSCC_OPM: attributes #[[ATTR13]] = { readnone } -; IS__CGSCC_OPM: attributes #[[ATTR14]] = { nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR15]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR16]] = { nofree nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR17:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR18:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR19]] = { nofree nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR6]] = { argmemonly nofree noinline norecurse nounwind uwtable } +; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nofree norecurse nounwind willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree norecurse nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR11]] = { argmemonly nofree nounwind willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR12]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR13:[0-9]+]] = { convergent readnone } +; IS__CGSCC_OPM: attributes #[[ATTR14]] = { readnone } +; IS__CGSCC_OPM: attributes #[[ATTR15]] = { nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR16]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR17]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR18:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR19:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR20]] = { nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR21]] = { willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR22]] = { willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR23]] = { readnone willreturn } -;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind optsize readnone ssp uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nounwind uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { noinline nosync nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR4]] = { noinline nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree noinline nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR6]] = { nofree norecurse nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree norecurse nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR10]] = { argmemonly nofree nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR11]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR12:[0-9]+]] = { convergent readnone } -; IS__CGSCC_NPM: attributes #[[ATTR13]] = { readnone } -; IS__CGSCC_NPM: attributes #[[ATTR14]] = { nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR15]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR16]] = { nofree nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR17:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR18:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR19]] = { nofree nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR20]] = { willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR21]] = { willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR22]] = { readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR21]] = { nofree nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR22]] = { willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR23]] = { willreturn writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR24]] = { readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/nounwind.ll b/llvm/test/Transforms/Attributor/nounwind.ll --- a/llvm/test/Transforms/Attributor/nounwind.ll +++ b/llvm/test/Transforms/Attributor/nounwind.ll @@ -6,35 +6,20 @@ ; TEST 1 define i32 @foo1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo1 -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32 1 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo1 -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32 1 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@foo1 +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: ret i32 1 ; ret i32 1 } ; TEST 2 define i32 @scc1_foo() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@scc1_foo -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 1 -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@scc1_foo -; IS__CGSCC_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: ret i32 1 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@scc1_foo -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: ret i32 1 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@scc1_foo +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i32 1 ; %1 = call i32 @scc1_bar() ret i32 1 @@ -43,20 +28,10 @@ ; TEST 3 define i32 @scc1_bar() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@scc1_bar -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 1 -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@scc1_bar -; IS__CGSCC_OPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: ret i32 1 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@scc1_bar -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: ret i32 1 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@scc1_bar +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i32 1 ; %1 = call i32 @scc1_foo() ret i32 1 @@ -158,10 +133,5 @@ declare void @__cxa_end_catch() ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/openmp_parallel.ll b/llvm/test/Transforms/Attributor/openmp_parallel.ll --- a/llvm/test/Transforms/Attributor/openmp_parallel.ll +++ b/llvm/test/Transforms/Attributor/openmp_parallel.ll @@ -45,7 +45,7 @@ ; IS__TUNIT_NPM-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB2]], i32 noundef 3, void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, float**, float**)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) undef, float** noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A_ADDR]], float** noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[B_ADDR]]) ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: nounwind uwtable +; IS__CGSCC_OPM: Function Attrs: norecurse nounwind uwtable ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@func ; IS__CGSCC_OPM-SAME: (float* nocapture nofree [[A:%.*]], float* nofree [[B:%.*]], i32 [[N:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { ; IS__CGSCC_OPM-NEXT: entry: @@ -57,7 +57,7 @@ ; IS__CGSCC_OPM-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB2]], i32 noundef 3, void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, float**, float**)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* noalias nocapture nofree noundef nonnull readnone align 4 dereferenceable(4) [[N_ADDR]], float** nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A_ADDR]], float** nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[B_ADDR]]) ; IS__CGSCC_OPM-NEXT: ret void ; -; IS__CGSCC_NPM: Function Attrs: nounwind uwtable +; IS__CGSCC_NPM: Function Attrs: norecurse nounwind uwtable ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@func ; IS__CGSCC_NPM-SAME: (float* nocapture nofree [[A:%.*]], float* nofree [[B:%.*]], i32 [[N:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { ; IS__CGSCC_NPM-NEXT: entry: @@ -284,9 +284,13 @@ !1 = !{!2} !2 = !{i64 2, i64 -1, i64 -1, i1 true} ;. -; CHECK: attributes #[[ATTR0:[0-9]+]] = { nounwind uwtable } -; CHECK: attributes #[[ATTR1:[0-9]+]] = { alwaysinline nofree norecurse nounwind uwtable } -; CHECK: attributes #[[ATTR2:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { nounwind uwtable } +; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { alwaysinline nofree norecurse nounwind uwtable } +; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +;. +; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { norecurse nounwind uwtable } +; IS__CGSCC____: attributes #[[ATTR1:[0-9]+]] = { alwaysinline nofree norecurse nounwind uwtable } +; IS__CGSCC____: attributes #[[ATTR2:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } ;. ; CHECK: [[META0:![0-9]+]] = !{i32 7, !"openmp", i32 50} ; CHECK: [[META1:![0-9]+]] = !{!2} 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 @@ -21,15 +21,10 @@ } define i1 @potential_test1(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i1 false -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test1 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 false +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@potential_test1 +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: ret i1 false ; %arg = select i1 %c, i32 -1, i32 1 %ret = call i1 @iszero1(i32 %arg) @@ -60,6 +55,7 @@ ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@call_with_two_values ; IS__CGSCC____-SAME: () #[[ATTR0]] { +; IS__CGSCC____-NEXT: [[RET:%.*]] = add i32 0, 0 ; IS__CGSCC____-NEXT: ret i32 undef ; %csret1 = call i32 @iszero2(i32 %c) @@ -70,15 +66,10 @@ } define i32 @potential_test2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@potential_test2 +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: ret i32 0 ; %csret1 = call i32 @call_with_two_values(i32 1) %csret2 = call i32 @call_with_two_values(i32 -1) @@ -113,9 +104,7 @@ 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 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp slt i32 undef, 2 -; IS__CGSCC____-NEXT: [[RET:%.*]] = zext i1 true to i32 +; IS__CGSCC____-SAME: () #[[ATTR0]] { ; IS__CGSCC____-NEXT: ret i32 undef ; %cmp = icmp slt i32 %c, 2 @@ -124,15 +113,10 @@ } define i32 @potential_test3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test3 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 2 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test3 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 2 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@potential_test3 +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i32 2 ; %cmp1 = call i32 @iszero3(i32 0) %true1 = call i32 @less_than_two(i32 %cmp1) @@ -154,15 +138,10 @@ ; int potential_test7(int c) { return return1or3(c) == return3or4(c); } define i32 @potential_test4(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test4 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test4 -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@potential_test4 +; CHECK-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: ret i32 0 ; %csret = call i32 @return1or3(i32 %c) %false = icmp eq i32 %csret, 2 @@ -171,15 +150,10 @@ } define i32 @potential_test5(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test5 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test5 -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@potential_test5 +; CHECK-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: ret i32 0 ; %csret1 = call i32 @return1or3(i32 %c) %csret2 = call i32 @return2or4(i32 %c) @@ -189,26 +163,19 @@ } define i1 @potential_test6(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test6 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR0]], !range [[RNG0:![0-9]+]] -; IS__TUNIT____-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], 3 -; IS__TUNIT____-NEXT: ret i1 [[RET]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test6 -; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR2:[0-9]+]], !range [[RNG0:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], 3 -; IS__CGSCC_OPM-NEXT: ret i1 [[RET]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test6 -; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], 3 -; IS__CGSCC_NPM-NEXT: ret i1 [[RET]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________OPM-LABEL: define {{[^@]+}}@potential_test6 +; IS________OPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; IS________OPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR2:[0-9]+]], !range [[RNG0:![0-9]+]] +; IS________OPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], 3 +; IS________OPM-NEXT: ret i1 [[RET]] +; +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@potential_test6 +; IS________NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; IS________NPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] +; IS________NPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], 3 +; IS________NPM-NEXT: ret i1 [[RET]] ; %csret1 = call i32 @return1or3(i32 %c) %ret = icmp eq i32 %csret1, 3 @@ -216,19 +183,27 @@ } define i1 @potential_test7(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test7 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR0]], !range [[RNG0]] -; IS__TUNIT____-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR0]], !range [[RNG1:![0-9]+]] -; IS__TUNIT____-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] -; IS__TUNIT____-NEXT: ret i1 [[RET]] +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@potential_test7 +; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; IS__TUNIT_OPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR2]], !range [[RNG0]] +; IS__TUNIT_OPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR2]], !range [[RNG1:![0-9]+]] +; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] +; IS__TUNIT_OPM-NEXT: ret i1 [[RET]] +; +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test7 +; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; IS__TUNIT_NPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR1]], !range [[RNG0]] +; IS__TUNIT_NPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR1]], !range [[RNG1:![0-9]+]] +; IS__TUNIT_NPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] +; IS__TUNIT_NPM-NEXT: ret i1 [[RET]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test7 ; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { ; IS__CGSCC_OPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR2]], !range [[RNG0]] -; IS__CGSCC_OPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR2]], !range [[RNG1:![0-9]+]] +; IS__CGSCC_OPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR3:[0-9]+]], !range [[RNG1:![0-9]+]] ; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] ; IS__CGSCC_OPM-NEXT: ret i1 [[RET]] ; @@ -236,7 +211,7 @@ ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test7 ; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { ; IS__CGSCC_NPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR1]], !range [[RNG0]] -; IS__CGSCC_NPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR1]], !range [[RNG1:![0-9]+]] +; IS__CGSCC_NPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR2:[0-9]+]], !range [[RNG1:![0-9]+]] ; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] ; IS__CGSCC_NPM-NEXT: ret i1 [[RET]] ; @@ -247,19 +222,12 @@ } define internal i32 @return1or3(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@return1or3 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 -; IS__TUNIT____-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 1, i32 3 -; IS__TUNIT____-NEXT: ret i32 [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@return1or3 -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 -; IS__CGSCC____-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 1, i32 3 -; IS__CGSCC____-NEXT: ret i32 [[RET]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@return1or3 +; CHECK-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 +; CHECK-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 1, i32 3 +; CHECK-NEXT: ret i32 [[RET]] ; %cmp = icmp eq i32 %c, 0 %ret = select i1 %cmp, i32 1, i32 3 @@ -280,19 +248,12 @@ } define internal i32 @return3or4(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@return3or4 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 -; IS__TUNIT____-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 3, i32 4 -; IS__TUNIT____-NEXT: ret i32 [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@return3or4 -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 -; IS__CGSCC____-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 3, i32 4 -; IS__CGSCC____-NEXT: ret i32 [[RET]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@return3or4 +; CHECK-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 +; CHECK-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 3, i32 4 +; CHECK-NEXT: ret i32 [[RET]] ; %cmp = icmp eq i32 %c, 0 %ret = select i1 %cmp, i32 3, i32 4 @@ -324,15 +285,10 @@ } define i1 @potential_test8() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test8 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i1 false -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test8 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 false +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@potential_test8 +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i1 false ; %res1 = call i1 @wrapper(i32 1) %res3 = call i1 @wrapper(i32 3) @@ -343,81 +299,43 @@ } define i1 @potential_test9() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@potential_test9 -; IS__TUNIT_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[COND:%.*]] -; IS__TUNIT_OPM: cond: -; IS__TUNIT_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] -; IS__TUNIT_OPM: body: -; IS__TUNIT_OPM-NEXT: [[C_1]] = mul i32 [[C_0]], -1 -; IS__TUNIT_OPM-NEXT: br label [[INC]] -; IS__TUNIT_OPM: inc: -; IS__TUNIT_OPM-NEXT: [[I_1]] = add i32 [[I_0]], 1 -; IS__TUNIT_OPM-NEXT: br label [[COND]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: ret i1 false -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test9 -; IS__TUNIT_NPM-SAME: () #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[COND:%.*]] -; IS__TUNIT_NPM: cond: -; IS__TUNIT_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] -; IS__TUNIT_NPM: body: -; IS__TUNIT_NPM-NEXT: [[C_1]] = mul i32 [[C_0]], -1 -; IS__TUNIT_NPM-NEXT: br label [[INC]] -; IS__TUNIT_NPM: inc: -; IS__TUNIT_NPM-NEXT: [[I_1]] = add i32 [[I_0]], 1 -; IS__TUNIT_NPM-NEXT: br label [[COND]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: ret i1 false -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test9 -; IS__CGSCC_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[COND:%.*]] -; IS__CGSCC_OPM: cond: -; IS__CGSCC_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] -; IS__CGSCC_OPM: body: -; IS__CGSCC_OPM-NEXT: [[C_1]] = mul i32 [[C_0]], -1 -; IS__CGSCC_OPM-NEXT: br label [[INC]] -; IS__CGSCC_OPM: inc: -; IS__CGSCC_OPM-NEXT: [[I_1]] = add i32 [[I_0]], 1 -; IS__CGSCC_OPM-NEXT: br label [[COND]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: ret i1 false -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test9 -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[COND:%.*]] -; IS__CGSCC_NPM: cond: -; IS__CGSCC_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] -; IS__CGSCC_NPM: body: -; IS__CGSCC_NPM-NEXT: [[C_1]] = mul i32 [[C_0]], -1 -; IS__CGSCC_NPM-NEXT: br label [[INC]] -; IS__CGSCC_NPM: inc: -; IS__CGSCC_NPM-NEXT: [[I_1]] = add i32 [[I_0]], 1 -; IS__CGSCC_NPM-NEXT: br label [[COND]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret i1 false +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone +; IS________OPM-LABEL: define {{[^@]+}}@potential_test9 +; IS________OPM-SAME: () #[[ATTR1:[0-9]+]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: br label [[COND:%.*]] +; IS________OPM: cond: +; IS________OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] +; IS________OPM-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] +; IS________OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 +; IS________OPM-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] +; IS________OPM: body: +; IS________OPM-NEXT: [[C_1]] = mul i32 [[C_0]], -1 +; IS________OPM-NEXT: br label [[INC]] +; IS________OPM: inc: +; IS________OPM-NEXT: [[I_1]] = add i32 [[I_0]], 1 +; IS________OPM-NEXT: br label [[COND]] +; IS________OPM: end: +; IS________OPM-NEXT: ret i1 false +; +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@potential_test9 +; IS________NPM-SAME: () #[[ATTR0]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: br label [[COND:%.*]] +; IS________NPM: cond: +; IS________NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] +; IS________NPM-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] +; IS________NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 +; IS________NPM-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] +; IS________NPM: body: +; IS________NPM-NEXT: [[C_1]] = mul i32 [[C_0]], -1 +; IS________NPM-NEXT: br label [[INC]] +; IS________NPM: inc: +; IS________NPM-NEXT: [[I_1]] = add i32 [[I_0]], 1 +; IS________NPM-NEXT: br label [[COND]] +; IS________NPM: end: +; IS________NPM-NEXT: ret i1 false ; entry: br label %cond @@ -467,7 +385,7 @@ } define i1 @potential_test10(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test10 ; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { ; IS__TUNIT____-NEXT: ret i1 false @@ -484,23 +402,14 @@ } define i32 @optimize_undef_1(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@optimize_undef_1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: ret i32 0 -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: ret i32 1 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@optimize_undef_1 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i32 0 -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: ret i32 1 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@optimize_undef_1 +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CHECK: t: +; CHECK-NEXT: ret i32 0 +; CHECK: f: +; CHECK-NEXT: ret i32 1 ; br i1 %c, label %t, label %f t: @@ -511,23 +420,14 @@ } define i32 @optimize_undef_2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@optimize_undef_2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: ret i32 0 -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: ret i32 -1 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@optimize_undef_2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i32 0 -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: ret i32 -1 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@optimize_undef_2 +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CHECK: t: +; CHECK-NEXT: ret i32 0 +; CHECK: f: +; CHECK-NEXT: ret i32 -1 ; br i1 %c, label %t, label %f t: @@ -538,23 +438,14 @@ } define i32 @optimize_undef_3(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@optimize_undef_3 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: ret i32 0 -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: ret i32 1 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@optimize_undef_3 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i32 0 -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: ret i32 1 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@optimize_undef_3 +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CHECK: t: +; CHECK-NEXT: ret i32 0 +; CHECK: f: +; CHECK-NEXT: ret i32 1 ; br i1 %c, label %t, label %f t: @@ -568,35 +459,25 @@ ; FIXME: returned value can be simplified to 0 define i32 @potential_test11(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test11 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) #[[ATTR0]], !range [[RNG2:![0-9]+]] -; IS__TUNIT____-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) #[[ATTR0]], !range [[RNG3:![0-9]+]] -; IS__TUNIT____-NEXT: [[ZERO3:%.*]] = call i32 @optimize_undef_3(i1 [[C]]) #[[ATTR0]], !range [[RNG2]] -; IS__TUNIT____-NEXT: [[ACC1:%.*]] = add i32 [[ZERO1]], [[ZERO2]] -; IS__TUNIT____-NEXT: [[ACC2:%.*]] = add i32 [[ACC1]], [[ZERO3]] -; IS__TUNIT____-NEXT: ret i32 [[ACC2]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test11 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) #[[ATTR2]], !range [[RNG2:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) #[[ATTR2]], !range [[RNG3:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[ZERO3:%.*]] = call i32 @optimize_undef_3(i1 [[C]]) #[[ATTR2]], !range [[RNG2]] -; IS__CGSCC_OPM-NEXT: [[ACC1:%.*]] = add i32 [[ZERO1]], [[ZERO2]] -; IS__CGSCC_OPM-NEXT: [[ACC2:%.*]] = add i32 [[ACC1]], [[ZERO3]] -; IS__CGSCC_OPM-NEXT: ret i32 [[ACC2]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test11 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) #[[ATTR1]], !range [[RNG2:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) #[[ATTR1]], !range [[RNG3:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[ZERO3:%.*]] = call i32 @optimize_undef_3(i1 [[C]]) #[[ATTR1]], !range [[RNG2]] -; IS__CGSCC_NPM-NEXT: [[ACC1:%.*]] = add i32 [[ZERO1]], [[ZERO2]] -; IS__CGSCC_NPM-NEXT: [[ACC2:%.*]] = add i32 [[ACC1]], [[ZERO3]] -; IS__CGSCC_NPM-NEXT: ret i32 [[ACC2]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________OPM-LABEL: define {{[^@]+}}@potential_test11 +; IS________OPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; IS________OPM-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) #[[ATTR2]], !range [[RNG2:![0-9]+]] +; IS________OPM-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) #[[ATTR2]], !range [[RNG3:![0-9]+]] +; IS________OPM-NEXT: [[ZERO3:%.*]] = call i32 @optimize_undef_3(i1 [[C]]) #[[ATTR2]], !range [[RNG2]] +; IS________OPM-NEXT: [[ACC1:%.*]] = add i32 [[ZERO1]], [[ZERO2]] +; IS________OPM-NEXT: [[ACC2:%.*]] = add i32 [[ACC1]], [[ZERO3]] +; IS________OPM-NEXT: ret i32 [[ACC2]] +; +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@potential_test11 +; IS________NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; IS________NPM-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) #[[ATTR1]], !range [[RNG2:![0-9]+]] +; IS________NPM-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) #[[ATTR1]], !range [[RNG3:![0-9]+]] +; IS________NPM-NEXT: [[ZERO3:%.*]] = call i32 @optimize_undef_3(i1 [[C]]) #[[ATTR1]], !range [[RNG2]] +; IS________NPM-NEXT: [[ACC1:%.*]] = add i32 [[ZERO1]], [[ZERO2]] +; IS________NPM-NEXT: [[ACC2:%.*]] = add i32 [[ACC1]], [[ZERO3]] +; IS________NPM-NEXT: ret i32 [[ACC2]] ; %zero1 = call i32 @optimize_undef_1(i1 %c) %zero2 = call i32 @optimize_undef_2(i1 %c) @@ -607,41 +488,23 @@ } define i32 @optimize_poison_1(i1 %c) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@optimize_poison_1 -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT_OPM: t: -; IS__TUNIT_OPM-NEXT: ret i32 0 -; IS__TUNIT_OPM: f: -; IS__TUNIT_OPM-NEXT: ret i32 -1 -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@optimize_poison_1 -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT_NPM: t: -; IS__TUNIT_NPM-NEXT: ret i32 0 -; IS__TUNIT_NPM: f: -; IS__TUNIT_NPM-NEXT: ret i32 undef -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@optimize_poison_1 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_OPM: t: -; IS__CGSCC_OPM-NEXT: ret i32 0 -; IS__CGSCC_OPM: f: -; IS__CGSCC_OPM-NEXT: ret i32 -1 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@optimize_poison_1 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_NPM: t: -; IS__CGSCC_NPM-NEXT: ret i32 0 -; IS__CGSCC_NPM: f: -; IS__CGSCC_NPM-NEXT: ret i32 undef +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________OPM-LABEL: define {{[^@]+}}@optimize_poison_1 +; IS________OPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; IS________OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS________OPM: t: +; IS________OPM-NEXT: ret i32 0 +; IS________OPM: f: +; IS________OPM-NEXT: ret i32 -1 +; +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@optimize_poison_1 +; IS________NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; IS________NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS________NPM: t: +; IS________NPM-NEXT: ret i32 0 +; IS________NPM: f: +; IS________NPM-NEXT: ret i32 undef ; br i1 %c, label %t, label %f t: @@ -653,27 +516,16 @@ ; FIXME: returned value can be simplified to 0 define i32 @potential_test12(i1 %c) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@potential_test12 -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: [[ZERO:%.*]] = call noundef i32 @optimize_poison_1(i1 [[C]]) #[[ATTR0]], !range [[RNG3]] -; IS__TUNIT_OPM-NEXT: ret i32 [[ZERO]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test12 -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: ret i32 0 +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________OPM-LABEL: define {{[^@]+}}@potential_test12 +; IS________OPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; IS________OPM-NEXT: [[ZERO:%.*]] = call noundef i32 @optimize_poison_1(i1 [[C]]) #[[ATTR2]], !range [[RNG3]] +; IS________OPM-NEXT: ret i32 [[ZERO]] ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test12 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[ZERO:%.*]] = call noundef i32 @optimize_poison_1(i1 [[C]]) #[[ATTR2]], !range [[RNG3]] -; IS__CGSCC_OPM-NEXT: ret i32 [[ZERO]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test12 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: ret i32 0 +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@potential_test12 +; IS________NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; IS________NPM-NEXT: ret i32 0 ; %zero = call i32 @optimize_poison_1(i1 %c) ret i32 %zero @@ -685,39 +537,39 @@ ; However, we should not simplify `and i32 %c, 3` to `%c` define internal i32 @potential_test13_callee(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test13_callee -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = and i32 [[C]], 3 -; IS__TUNIT____-NEXT: ret i32 [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test13_callee -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[RET:%.*]] = and i32 [[C]], 3 -; IS__CGSCC____-NEXT: ret i32 [[RET]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@potential_test13_callee +; CHECK-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[RET:%.*]] = and i32 [[C]], 3 +; CHECK-NEXT: ret i32 [[RET]] ; %ret = and i32 %c, 3 ret i32 %ret } define i32 @potential_test13_caller1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test13_caller1 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 0) #[[ATTR0]], !range [[RNG2]] -; IS__TUNIT____-NEXT: ret i32 [[RET]] +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@potential_test13_caller1 +; IS__TUNIT_OPM-SAME: () #[[ATTR0]] { +; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 0) #[[ATTR2]], !range [[RNG2]] +; IS__TUNIT_OPM-NEXT: ret i32 [[RET]] +; +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test13_caller1 +; IS__TUNIT_NPM-SAME: () #[[ATTR0]] { +; IS__TUNIT_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 0) #[[ATTR1]], !range [[RNG2]] +; IS__TUNIT_NPM-NEXT: ret i32 [[RET]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test13_caller1 ; IS__CGSCC_OPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 0) #[[ATTR2]], !range [[RNG2]] +; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 0) #[[ATTR3]], !range [[RNG2]] ; IS__CGSCC_OPM-NEXT: ret i32 [[RET]] ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test13_caller1 ; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 0) #[[ATTR1]], !range [[RNG2]] +; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 0) #[[ATTR2]], !range [[RNG2]] ; IS__CGSCC_NPM-NEXT: ret i32 [[RET]] ; %ret = call i32 @potential_test13_callee(i32 0) @@ -725,22 +577,28 @@ } define i32 @potential_test13_caller2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test13_caller2 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 1) #[[ATTR0]], !range [[RNG2]] -; IS__TUNIT____-NEXT: ret i32 [[RET]] +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@potential_test13_caller2 +; IS__TUNIT_OPM-SAME: () #[[ATTR0]] { +; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 1) #[[ATTR2]], !range [[RNG2]] +; IS__TUNIT_OPM-NEXT: ret i32 [[RET]] +; +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test13_caller2 +; IS__TUNIT_NPM-SAME: () #[[ATTR0]] { +; IS__TUNIT_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 1) #[[ATTR1]], !range [[RNG2]] +; IS__TUNIT_NPM-NEXT: ret i32 [[RET]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test13_caller2 ; IS__CGSCC_OPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 1) #[[ATTR2]], !range [[RNG2]] +; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 1) #[[ATTR3]], !range [[RNG2]] ; IS__CGSCC_OPM-NEXT: ret i32 [[RET]] ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test13_caller2 ; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 1) #[[ATTR1]], !range [[RNG2]] +; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 1) #[[ATTR2]], !range [[RNG2]] ; IS__CGSCC_NPM-NEXT: ret i32 [[RET]] ; %ret = call i32 @potential_test13_callee(i32 1) @@ -748,22 +606,28 @@ } define i32 @potential_test13_caller3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test13_caller3 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR0]], !range [[RNG2]] -; IS__TUNIT____-NEXT: ret i32 [[RET]] +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@potential_test13_caller3 +; IS__TUNIT_OPM-SAME: () #[[ATTR0]] { +; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR2]], !range [[RNG2]] +; IS__TUNIT_OPM-NEXT: ret i32 [[RET]] +; +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test13_caller3 +; IS__TUNIT_NPM-SAME: () #[[ATTR0]] { +; IS__TUNIT_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR1]], !range [[RNG2]] +; IS__TUNIT_NPM-NEXT: ret i32 [[RET]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test13_caller3 ; IS__CGSCC_OPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR2]], !range [[RNG2]] +; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR3]], !range [[RNG2]] ; IS__CGSCC_OPM-NEXT: ret i32 [[RET]] ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test13_caller3 ; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR1]], !range [[RNG2]] +; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR2]], !range [[RNG2]] ; IS__CGSCC_NPM-NEXT: ret i32 [[RET]] ; %ret = call i32 @potential_test13_callee(i32 undef) @@ -771,25 +635,15 @@ } define i1 @potential_test14(i1 %c0, i1 %c1, i1 %c2, i1 %c3) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test14 -; IS__TUNIT____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[X0:%.*]] = select i1 [[C0]], i32 0, i32 1 -; IS__TUNIT____-NEXT: [[X1:%.*]] = select i1 [[C1]], i32 [[X0]], i32 undef -; IS__TUNIT____-NEXT: [[Y2:%.*]] = select i1 [[C2]], i32 0, i32 7 -; IS__TUNIT____-NEXT: [[Z3:%.*]] = select i1 [[C3]], i32 [[X1]], i32 [[Y2]] -; IS__TUNIT____-NEXT: [[RET:%.*]] = icmp slt i32 [[Z3]], 7 -; IS__TUNIT____-NEXT: ret i1 [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test14 -; IS__CGSCC____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[X0:%.*]] = select i1 [[C0]], i32 0, i32 1 -; IS__CGSCC____-NEXT: [[X1:%.*]] = select i1 [[C1]], i32 [[X0]], i32 undef -; IS__CGSCC____-NEXT: [[Y2:%.*]] = select i1 [[C2]], i32 0, i32 7 -; IS__CGSCC____-NEXT: [[Z3:%.*]] = select i1 [[C3]], i32 [[X1]], i32 [[Y2]] -; IS__CGSCC____-NEXT: [[RET:%.*]] = icmp slt i32 [[Z3]], 7 -; IS__CGSCC____-NEXT: ret i1 [[RET]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@potential_test14 +; CHECK-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[X0:%.*]] = select i1 [[C0]], i32 0, i32 1 +; CHECK-NEXT: [[X1:%.*]] = select i1 [[C1]], i32 [[X0]], i32 undef +; CHECK-NEXT: [[Y2:%.*]] = select i1 [[C2]], i32 0, i32 7 +; CHECK-NEXT: [[Z3:%.*]] = select i1 [[C3]], i32 [[X1]], i32 [[Y2]] +; CHECK-NEXT: [[RET:%.*]] = icmp slt i32 [[Z3]], 7 +; CHECK-NEXT: ret i1 [[RET]] ; %x0 = select i1 %c0, i32 0, i32 1 %x1 = select i1 %c1, i32 %x0, i32 undef @@ -800,15 +654,10 @@ } define i1 @potential_test15(i1 %c0, i1 %c1) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test15 -; IS__TUNIT____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i1 false -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test15 -; IS__CGSCC____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 false +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@potential_test15 +; CHECK-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: ret i1 false ; %x0 = select i1 %c0, i32 0, i32 1 %x1 = select i1 %c1, i32 %x0, i32 undef @@ -817,15 +666,10 @@ } define i1 @potential_test16(i1 %c0, i1 %c1) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test16 -; IS__TUNIT____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i1 false -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test16 -; IS__CGSCC____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 false +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@potential_test16 +; CHECK-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: ret i1 false ; %x0 = select i1 %c0, i32 0, i32 undef %x1 = select i1 %c1, i32 %x0, i32 1 @@ -834,17 +678,21 @@ } ;. -; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone } +; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone } +; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__TUNIT_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } ;. ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone } ; IS__CGSCC_OPM: attributes #[[ATTR2]] = { readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nounwind readnone willreturn } ;. ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { readnone willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nounwind readnone willreturn } ;. ; CHECK: [[META0:![0-9]+]] = !{i32 1, i32 4} ; CHECK: [[META1:![0-9]+]] = !{i32 3, i32 5} 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 @@ -1,5 +1,5 @@ ; 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=21 -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 -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=22 -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=20 -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 @@ -7,34 +7,34 @@ ; FIXME: CGSCC is not looking at callees and calleers even though it could be allowed. define i32 @test0(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test0 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG0:![0-9]+]] -; IS__TUNIT____-NEXT: ret i32 [[A]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test0 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG0:![0-9]+]] -; IS__CGSCC____-NEXT: ret i32 [[A]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@test0 +; CHECK-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: [[A:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG0:![0-9]+]] +; CHECK-NEXT: ret i32 [[A]] ; %a = load i32, i32* %p, !range !0 ret i32 %a } define i32 @test0-range-check(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test0-range-check ; IS__TUNIT____-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { ; IS__TUNIT____-NEXT: [[A:%.*]] = tail call i32 @test0(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR3:[0-9]+]], !range [[RNG0]] ; IS__TUNIT____-NEXT: ret i32 [[A]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test0-range-check -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = tail call i32 @test0(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR3:[0-9]+]], !range [[RNG0]] -; IS__CGSCC____-NEXT: ret i32 [[A]] +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test0-range-check +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; IS__CGSCC_OPM-NEXT: [[A:%.*]] = tail call i32 @test0(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR4:[0-9]+]], !range [[RNG0]] +; IS__CGSCC_OPM-NEXT: ret i32 [[A]] +; +; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test0-range-check +; IS__CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; IS__CGSCC_NPM-NEXT: [[A:%.*]] = tail call i32 @test0(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR3:[0-9]+]], !range [[RNG0]] +; IS__CGSCC_NPM-NEXT: ret i32 [[A]] ; %a = tail call i32 @test0(i32* %p) ret i32 %a @@ -101,52 +101,99 @@ ; IS__TUNIT____-NEXT: tail call void @use3(i1 [[CMP_LTE_4]], i1 [[CMP_LTE_5]], i1 noundef false) ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@test0-icmp-check -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) { -; IS__CGSCC____-NEXT: [[RET:%.*]] = tail call i32 @test0(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR3]], !range [[RNG0]] -; IS__CGSCC____-NEXT: [[CMP_EQ_2:%.*]] = icmp eq i32 [[RET]], 9 -; IS__CGSCC____-NEXT: [[CMP_EQ_3:%.*]] = icmp eq i32 [[RET]], 8 -; IS__CGSCC____-NEXT: [[CMP_EQ_4:%.*]] = icmp eq i32 [[RET]], 1 -; IS__CGSCC____-NEXT: [[CMP_EQ_5:%.*]] = icmp eq i32 [[RET]], 0 -; IS__CGSCC____-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_EQ_2]], i1 [[CMP_EQ_3]]) -; IS__CGSCC____-NEXT: tail call void @use3(i1 [[CMP_EQ_4]], i1 [[CMP_EQ_5]], i1 noundef false) -; IS__CGSCC____-NEXT: [[CMP_NE_2:%.*]] = icmp ne i32 [[RET]], 9 -; IS__CGSCC____-NEXT: [[CMP_NE_3:%.*]] = icmp ne i32 [[RET]], 8 -; IS__CGSCC____-NEXT: [[CMP_NE_4:%.*]] = icmp ne i32 [[RET]], 1 -; IS__CGSCC____-NEXT: [[CMP_NE_5:%.*]] = icmp ne i32 [[RET]], 0 -; IS__CGSCC____-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_NE_2]], i1 [[CMP_NE_3]]) -; IS__CGSCC____-NEXT: tail call void @use3(i1 [[CMP_NE_4]], i1 [[CMP_NE_5]], i1 noundef true) -; IS__CGSCC____-NEXT: [[CMP_UGT_3:%.*]] = icmp ugt i32 [[RET]], 8 -; IS__CGSCC____-NEXT: [[CMP_UGT_4:%.*]] = icmp ugt i32 [[RET]], 1 -; IS__CGSCC____-NEXT: [[CMP_UGT_5:%.*]] = icmp ugt i32 [[RET]], 0 -; IS__CGSCC____-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_UGT_3]]) -; IS__CGSCC____-NEXT: tail call void @use3(i1 [[CMP_UGT_4]], i1 [[CMP_UGT_5]], i1 noundef false) -; IS__CGSCC____-NEXT: [[CMP_UGE_2:%.*]] = icmp uge i32 [[RET]], 9 -; IS__CGSCC____-NEXT: [[CMP_UGE_3:%.*]] = icmp uge i32 [[RET]], 8 -; IS__CGSCC____-NEXT: [[CMP_UGE_4:%.*]] = icmp uge i32 [[RET]], 1 -; IS__CGSCC____-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_UGE_2]], i1 [[CMP_UGE_3]]) -; IS__CGSCC____-NEXT: tail call void @use3(i1 [[CMP_UGE_4]], i1 noundef true, i1 noundef false) -; IS__CGSCC____-NEXT: [[CMP_SGT_3:%.*]] = icmp sgt i32 [[RET]], 8 -; IS__CGSCC____-NEXT: [[CMP_SGT_4:%.*]] = icmp sgt i32 [[RET]], 1 -; IS__CGSCC____-NEXT: [[CMP_SGT_5:%.*]] = icmp sgt i32 [[RET]], 0 -; IS__CGSCC____-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_SGT_3]]) -; IS__CGSCC____-NEXT: tail call void @use3(i1 [[CMP_SGT_4]], i1 [[CMP_SGT_5]], i1 noundef true) -; IS__CGSCC____-NEXT: [[CMP_GTE_2:%.*]] = icmp sge i32 [[RET]], 9 -; IS__CGSCC____-NEXT: [[CMP_GTE_3:%.*]] = icmp sge i32 [[RET]], 8 -; IS__CGSCC____-NEXT: [[CMP_GTE_4:%.*]] = icmp sge i32 [[RET]], 1 -; IS__CGSCC____-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_GTE_2]], i1 [[CMP_GTE_3]]) -; IS__CGSCC____-NEXT: tail call void @use3(i1 [[CMP_GTE_4]], i1 noundef true, i1 noundef true) -; IS__CGSCC____-NEXT: [[CMP_SLT_2:%.*]] = icmp slt i32 [[RET]], 9 -; IS__CGSCC____-NEXT: [[CMP_SLT_3:%.*]] = icmp slt i32 [[RET]], 8 -; IS__CGSCC____-NEXT: [[CMP_SLT_4:%.*]] = icmp slt i32 [[RET]], 1 -; IS__CGSCC____-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_SLT_2]], i1 [[CMP_SLT_3]]) -; IS__CGSCC____-NEXT: tail call void @use3(i1 [[CMP_SLT_4]], i1 noundef false, i1 noundef false) -; IS__CGSCC____-NEXT: [[CMP_LTE_3:%.*]] = icmp sle i32 [[RET]], 8 -; IS__CGSCC____-NEXT: [[CMP_LTE_4:%.*]] = icmp sle i32 [[RET]], 1 -; IS__CGSCC____-NEXT: [[CMP_LTE_5:%.*]] = icmp sle i32 [[RET]], 0 -; IS__CGSCC____-NEXT: tail call void @use3(i1 noundef true, i1 noundef true, i1 [[CMP_LTE_3]]) -; IS__CGSCC____-NEXT: tail call void @use3(i1 [[CMP_LTE_4]], i1 [[CMP_LTE_5]], i1 noundef false) -; IS__CGSCC____-NEXT: ret void +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test0-icmp-check +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) { +; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = tail call i32 @test0(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR4]], !range [[RNG0]] +; IS__CGSCC_OPM-NEXT: [[CMP_EQ_2:%.*]] = icmp eq i32 [[RET]], 9 +; IS__CGSCC_OPM-NEXT: [[CMP_EQ_3:%.*]] = icmp eq i32 [[RET]], 8 +; IS__CGSCC_OPM-NEXT: [[CMP_EQ_4:%.*]] = icmp eq i32 [[RET]], 1 +; IS__CGSCC_OPM-NEXT: [[CMP_EQ_5:%.*]] = icmp eq i32 [[RET]], 0 +; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_EQ_2]], i1 [[CMP_EQ_3]]) +; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 [[CMP_EQ_4]], i1 [[CMP_EQ_5]], i1 noundef false) +; IS__CGSCC_OPM-NEXT: [[CMP_NE_2:%.*]] = icmp ne i32 [[RET]], 9 +; IS__CGSCC_OPM-NEXT: [[CMP_NE_3:%.*]] = icmp ne i32 [[RET]], 8 +; IS__CGSCC_OPM-NEXT: [[CMP_NE_4:%.*]] = icmp ne i32 [[RET]], 1 +; IS__CGSCC_OPM-NEXT: [[CMP_NE_5:%.*]] = icmp ne i32 [[RET]], 0 +; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_NE_2]], i1 [[CMP_NE_3]]) +; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 [[CMP_NE_4]], i1 [[CMP_NE_5]], i1 noundef true) +; IS__CGSCC_OPM-NEXT: [[CMP_UGT_3:%.*]] = icmp ugt i32 [[RET]], 8 +; IS__CGSCC_OPM-NEXT: [[CMP_UGT_4:%.*]] = icmp ugt i32 [[RET]], 1 +; IS__CGSCC_OPM-NEXT: [[CMP_UGT_5:%.*]] = icmp ugt i32 [[RET]], 0 +; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_UGT_3]]) +; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 [[CMP_UGT_4]], i1 [[CMP_UGT_5]], i1 noundef false) +; IS__CGSCC_OPM-NEXT: [[CMP_UGE_2:%.*]] = icmp uge i32 [[RET]], 9 +; IS__CGSCC_OPM-NEXT: [[CMP_UGE_3:%.*]] = icmp uge i32 [[RET]], 8 +; IS__CGSCC_OPM-NEXT: [[CMP_UGE_4:%.*]] = icmp uge i32 [[RET]], 1 +; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_UGE_2]], i1 [[CMP_UGE_3]]) +; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 [[CMP_UGE_4]], i1 noundef true, i1 noundef false) +; IS__CGSCC_OPM-NEXT: [[CMP_SGT_3:%.*]] = icmp sgt i32 [[RET]], 8 +; IS__CGSCC_OPM-NEXT: [[CMP_SGT_4:%.*]] = icmp sgt i32 [[RET]], 1 +; IS__CGSCC_OPM-NEXT: [[CMP_SGT_5:%.*]] = icmp sgt i32 [[RET]], 0 +; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_SGT_3]]) +; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 [[CMP_SGT_4]], i1 [[CMP_SGT_5]], i1 noundef true) +; IS__CGSCC_OPM-NEXT: [[CMP_GTE_2:%.*]] = icmp sge i32 [[RET]], 9 +; IS__CGSCC_OPM-NEXT: [[CMP_GTE_3:%.*]] = icmp sge i32 [[RET]], 8 +; IS__CGSCC_OPM-NEXT: [[CMP_GTE_4:%.*]] = icmp sge i32 [[RET]], 1 +; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_GTE_2]], i1 [[CMP_GTE_3]]) +; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 [[CMP_GTE_4]], i1 noundef true, i1 noundef true) +; IS__CGSCC_OPM-NEXT: [[CMP_SLT_2:%.*]] = icmp slt i32 [[RET]], 9 +; IS__CGSCC_OPM-NEXT: [[CMP_SLT_3:%.*]] = icmp slt i32 [[RET]], 8 +; IS__CGSCC_OPM-NEXT: [[CMP_SLT_4:%.*]] = icmp slt i32 [[RET]], 1 +; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_SLT_2]], i1 [[CMP_SLT_3]]) +; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 [[CMP_SLT_4]], i1 noundef false, i1 noundef false) +; IS__CGSCC_OPM-NEXT: [[CMP_LTE_3:%.*]] = icmp sle i32 [[RET]], 8 +; IS__CGSCC_OPM-NEXT: [[CMP_LTE_4:%.*]] = icmp sle i32 [[RET]], 1 +; IS__CGSCC_OPM-NEXT: [[CMP_LTE_5:%.*]] = icmp sle i32 [[RET]], 0 +; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 noundef true, i1 noundef true, i1 [[CMP_LTE_3]]) +; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 [[CMP_LTE_4]], i1 [[CMP_LTE_5]], i1 noundef false) +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test0-icmp-check +; IS__CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) { +; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = tail call i32 @test0(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR3]], !range [[RNG0]] +; IS__CGSCC_NPM-NEXT: [[CMP_EQ_2:%.*]] = icmp eq i32 [[RET]], 9 +; IS__CGSCC_NPM-NEXT: [[CMP_EQ_3:%.*]] = icmp eq i32 [[RET]], 8 +; IS__CGSCC_NPM-NEXT: [[CMP_EQ_4:%.*]] = icmp eq i32 [[RET]], 1 +; IS__CGSCC_NPM-NEXT: [[CMP_EQ_5:%.*]] = icmp eq i32 [[RET]], 0 +; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_EQ_2]], i1 [[CMP_EQ_3]]) +; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_EQ_4]], i1 [[CMP_EQ_5]], i1 noundef false) +; IS__CGSCC_NPM-NEXT: [[CMP_NE_2:%.*]] = icmp ne i32 [[RET]], 9 +; IS__CGSCC_NPM-NEXT: [[CMP_NE_3:%.*]] = icmp ne i32 [[RET]], 8 +; IS__CGSCC_NPM-NEXT: [[CMP_NE_4:%.*]] = icmp ne i32 [[RET]], 1 +; IS__CGSCC_NPM-NEXT: [[CMP_NE_5:%.*]] = icmp ne i32 [[RET]], 0 +; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_NE_2]], i1 [[CMP_NE_3]]) +; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_NE_4]], i1 [[CMP_NE_5]], i1 noundef true) +; IS__CGSCC_NPM-NEXT: [[CMP_UGT_3:%.*]] = icmp ugt i32 [[RET]], 8 +; IS__CGSCC_NPM-NEXT: [[CMP_UGT_4:%.*]] = icmp ugt i32 [[RET]], 1 +; IS__CGSCC_NPM-NEXT: [[CMP_UGT_5:%.*]] = icmp ugt i32 [[RET]], 0 +; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_UGT_3]]) +; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_UGT_4]], i1 [[CMP_UGT_5]], i1 noundef false) +; IS__CGSCC_NPM-NEXT: [[CMP_UGE_2:%.*]] = icmp uge i32 [[RET]], 9 +; IS__CGSCC_NPM-NEXT: [[CMP_UGE_3:%.*]] = icmp uge i32 [[RET]], 8 +; IS__CGSCC_NPM-NEXT: [[CMP_UGE_4:%.*]] = icmp uge i32 [[RET]], 1 +; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_UGE_2]], i1 [[CMP_UGE_3]]) +; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_UGE_4]], i1 noundef true, i1 noundef false) +; IS__CGSCC_NPM-NEXT: [[CMP_SGT_3:%.*]] = icmp sgt i32 [[RET]], 8 +; IS__CGSCC_NPM-NEXT: [[CMP_SGT_4:%.*]] = icmp sgt i32 [[RET]], 1 +; IS__CGSCC_NPM-NEXT: [[CMP_SGT_5:%.*]] = icmp sgt i32 [[RET]], 0 +; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_SGT_3]]) +; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_SGT_4]], i1 [[CMP_SGT_5]], i1 noundef true) +; IS__CGSCC_NPM-NEXT: [[CMP_GTE_2:%.*]] = icmp sge i32 [[RET]], 9 +; IS__CGSCC_NPM-NEXT: [[CMP_GTE_3:%.*]] = icmp sge i32 [[RET]], 8 +; IS__CGSCC_NPM-NEXT: [[CMP_GTE_4:%.*]] = icmp sge i32 [[RET]], 1 +; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_GTE_2]], i1 [[CMP_GTE_3]]) +; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_GTE_4]], i1 noundef true, i1 noundef true) +; IS__CGSCC_NPM-NEXT: [[CMP_SLT_2:%.*]] = icmp slt i32 [[RET]], 9 +; IS__CGSCC_NPM-NEXT: [[CMP_SLT_3:%.*]] = icmp slt i32 [[RET]], 8 +; IS__CGSCC_NPM-NEXT: [[CMP_SLT_4:%.*]] = icmp slt i32 [[RET]], 1 +; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_SLT_2]], i1 [[CMP_SLT_3]]) +; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_SLT_4]], i1 noundef false, i1 noundef false) +; IS__CGSCC_NPM-NEXT: [[CMP_LTE_3:%.*]] = icmp sle i32 [[RET]], 8 +; IS__CGSCC_NPM-NEXT: [[CMP_LTE_4:%.*]] = icmp sle i32 [[RET]], 1 +; IS__CGSCC_NPM-NEXT: [[CMP_LTE_5:%.*]] = icmp sle i32 [[RET]], 0 +; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 noundef true, i1 noundef true, i1 [[CMP_LTE_3]]) +; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_LTE_4]], i1 [[CMP_LTE_5]], i1 noundef false) +; IS__CGSCC_NPM-NEXT: ret void ; %ret = tail call i32 @test0(i32 *%p) @@ -233,21 +280,13 @@ ret void } define i32 @test1(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test1 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[LOAD_10_100:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG1:![0-9]+]] -; IS__TUNIT____-NEXT: [[ADD_10_THEN_20_110:%.*]] = add i32 [[LOAD_10_100]], 10 -; IS__TUNIT____-NEXT: [[MUL_10_THEN_200_1091:%.*]] = mul i32 [[ADD_10_THEN_20_110]], 10 -; IS__TUNIT____-NEXT: ret i32 [[MUL_10_THEN_200_1091]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test1 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[LOAD_10_100:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG1:![0-9]+]] -; IS__CGSCC____-NEXT: [[ADD_10_THEN_20_110:%.*]] = add i32 [[LOAD_10_100]], 10 -; IS__CGSCC____-NEXT: [[MUL_10_THEN_200_1091:%.*]] = mul i32 [[ADD_10_THEN_20_110]], 10 -; IS__CGSCC____-NEXT: ret i32 [[MUL_10_THEN_200_1091]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@test1 +; CHECK-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[LOAD_10_100:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG1:![0-9]+]] +; CHECK-NEXT: [[ADD_10_THEN_20_110:%.*]] = add i32 [[LOAD_10_100]], 10 +; CHECK-NEXT: [[MUL_10_THEN_200_1091:%.*]] = mul i32 [[ADD_10_THEN_20_110]], 10 +; CHECK-NEXT: ret i32 [[MUL_10_THEN_200_1091]] ; %load-10-100 = load i32, i32* %p, !range !1 %add-10-then-20-110 = add i32 %load-10-100, 10 @@ -257,19 +296,26 @@ define i1 @test1-check(i32* %p) { ; -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test1-check ; IS__TUNIT____-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { ; IS__TUNIT____-NEXT: [[RES:%.*]] = tail call i32 @test1(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR3]], !range [[RNG2:![0-9]+]] ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 500 ; IS__TUNIT____-NEXT: ret i1 [[CMP]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test1-check -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[RES:%.*]] = tail call i32 @test1(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR3]], !range [[RNG2:![0-9]+]] -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 500 -; IS__CGSCC____-NEXT: ret i1 [[CMP]] +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test1-check +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; IS__CGSCC_OPM-NEXT: [[RES:%.*]] = tail call i32 @test1(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR4]], !range [[RNG2:![0-9]+]] +; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 500 +; IS__CGSCC_OPM-NEXT: ret i1 [[CMP]] +; +; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test1-check +; IS__CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; IS__CGSCC_NPM-NEXT: [[RES:%.*]] = tail call i32 @test1(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR3]], !range [[RNG2:![0-9]+]] +; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 500 +; IS__CGSCC_NPM-NEXT: ret i1 [[CMP]] ; %res = tail call i32 @test1(i32* %p) %cmp = icmp eq i32 %res, 500 @@ -289,23 +335,14 @@ ; } define i32 @test2(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 4 -; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__TUNIT____-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i32 4, i32 3 -; IS__TUNIT____-NEXT: ret i32 [[COND]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 4 -; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__CGSCC____-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i32 4, i32 3 -; IS__CGSCC____-NEXT: ret i32 [[COND]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@test2 +; CHECK-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 4 +; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0 +; CHECK-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i32 4, i32 3 +; CHECK-NEXT: ret i32 [[COND]] ; entry: %0 = load i32, i32* %p, align 4 @@ -315,7 +352,7 @@ } define i32 @test2_check(i32* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test2_check ; IS__TUNIT____-SAME: (i32* nocapture nofree readnone align 4 [[P:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: @@ -383,43 +420,24 @@ declare dso_local void @unkown() 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 #[[ATTR2:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: br label [[TMP4:%.*]] -; IS__TUNIT_OPM: 1: -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[TMP7:%.*]], 10000 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[F:%.*]] -; IS__TUNIT_OPM: 3: -; IS__TUNIT_OPM-NEXT: ret i32 20 -; IS__TUNIT_OPM: f: -; IS__TUNIT_OPM-NEXT: ret i32 10 -; IS__TUNIT_OPM: 4: -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP0:%.*]] ], [ [[TMP8:%.*]], [[TMP4]] ] -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = phi i32 [ 0, [[TMP0]] ], [ [[TMP7]], [[TMP4]] ] -; IS__TUNIT_OPM-NEXT: [[TMP7]] = add nuw nsw i32 [[TMP5]], [[TMP6]] -; IS__TUNIT_OPM-NEXT: [[TMP8]] = add nuw nsw i32 [[TMP5]], 1 -; IS__TUNIT_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], 100 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP9]], label [[TMP1:%.*]], label [[TMP4]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@r1 -; 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 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[F:%.*]] -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: ret i32 20 -; IS__CGSCC_OPM: f: -; IS__CGSCC_OPM-NEXT: ret i32 10 -; IS__CGSCC_OPM: 4: -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP0:%.*]] ], [ [[TMP8:%.*]], [[TMP4]] ] -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = phi i32 [ 0, [[TMP0]] ], [ [[TMP7]], [[TMP4]] ] -; IS__CGSCC_OPM-NEXT: [[TMP7]] = add nuw nsw i32 [[TMP5]], [[TMP6]] -; IS__CGSCC_OPM-NEXT: [[TMP8]] = add nuw nsw i32 [[TMP5]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], 100 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP9]], label [[TMP1:%.*]], label [[TMP4]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone +; IS________OPM-LABEL: define {{[^@]+}}@r1 +; IS________OPM-SAME: () local_unnamed_addr #[[ATTR2:[0-9]+]] { +; IS________OPM-NEXT: br label [[TMP4:%.*]] +; IS________OPM: 1: +; IS________OPM-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[TMP7:%.*]], 10000 +; IS________OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[F:%.*]] +; IS________OPM: 3: +; IS________OPM-NEXT: ret i32 20 +; IS________OPM: f: +; IS________OPM-NEXT: ret i32 10 +; IS________OPM: 4: +; IS________OPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP0:%.*]] ], [ [[TMP8:%.*]], [[TMP4]] ] +; IS________OPM-NEXT: [[TMP6:%.*]] = phi i32 [ 0, [[TMP0]] ], [ [[TMP7]], [[TMP4]] ] +; IS________OPM-NEXT: [[TMP7]] = add nuw nsw i32 [[TMP5]], [[TMP6]] +; IS________OPM-NEXT: [[TMP8]] = add nuw nsw i32 [[TMP5]], 1 +; IS________OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], 100 +; IS________OPM-NEXT: br i1 [[TMP9]], label [[TMP1:%.*]], label [[TMP4]] ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@r1 @@ -460,7 +478,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() #[[ATTR2]] +; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = tail call i32 @r1() #[[ATTR4:[0-9]+]] ; 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: @@ -469,18 +487,19 @@ ; IS__TUNIT_OPM: 5: ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f1 -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: br label [[TMP3:%.*]] -; IS__TUNIT_NPM: 2: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: 3: -; IS__TUNIT_NPM-NEXT: ret void +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@f1 +; IS________NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1]] { +; IS________NPM-NEXT: br label [[TMP3:%.*]] +; IS________NPM: 2: +; IS________NPM-NEXT: unreachable +; IS________NPM: 3: +; IS________NPM-NEXT: ret void ; +; IS__CGSCC_OPM: Function Attrs: norecurse ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]]) { -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = tail call i32 @r1() #[[ATTR4:[0-9]+]], !range [[RNG3:![0-9]+]] +; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR3:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = tail call i32 @r1() #[[ATTR5:[0-9]+]], !range [[RNG3:![0-9]+]] ; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP2]], 15 ; IS__CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP5:%.*]] ; IS__CGSCC_OPM: 4: @@ -488,15 +507,6 @@ ; IS__CGSCC_OPM-NEXT: br label [[TMP5]] ; IS__CGSCC_OPM: 5: ; IS__CGSCC_OPM-NEXT: ret void -; -; 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: br label [[TMP3:%.*]] -; IS__CGSCC_NPM: 2: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: ret void ; %2 = tail call i32 @r1(i32 %0) %3 = icmp sgt i32 %2, 15 @@ -521,29 +531,17 @@ ; } ; } define dso_local i32 @test4-f1(i32 %u) { -; 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____: 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]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test4-f1 +; CHECK-SAME: (i32 [[U:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 +; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] +; CHECK: if.then: +; CHECK-NEXT: br label [[RETURN]] +; CHECK: return: +; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[U]], [[IF_THEN]] ], [ 0, [[ENTRY:%.*]] ] +; CHECK-NEXT: ret i32 [[RETVAL_0]] ; ; FIXME: RETVAL_0 >= 0 entry: @@ -560,27 +558,27 @@ define dso_local i32 @test4-g1(i32 %u) { -; 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__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test4-g1 +; IS__TUNIT_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; IS__TUNIT_OPM-NEXT: entry: +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR5:[0-9]+]] +; IS__TUNIT_OPM-NEXT: ret i32 [[CALL]] +; +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@test4-g1 +; IS________NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR4:[0-9]+]] +; IS________NPM-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:%.*]]) #[[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: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR6:[0-9]+]] ; IS__CGSCC_OPM-NEXT: ret i32 [[CALL]] ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test4-g1 -; IS__CGSCC_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR4:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 [[CALL]] -; ; FIXME: %call should have range [0, inf] entry: @@ -597,35 +595,20 @@ ; } ; } define dso_local i32 @test4-f2(i32 %u) { -; 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____: 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]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test4-f2 +; CHECK-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 +; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; CHECK: if.then: +; CHECK-NEXT: [[ADD:%.*]] = add nuw nsw i32 [[U]], 1 +; CHECK-NEXT: br label [[RETURN:%.*]] +; CHECK: if.else: +; CHECK-NEXT: br label [[RETURN]] +; CHECK: return: +; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[ADD]], [[IF_THEN]] ], [ 1, [[IF_ELSE]] ] +; CHECK-NEXT: ret i32 [[RETVAL_0]] ; entry: %cmp = icmp sgt i32 %u, -1 @@ -645,34 +628,27 @@ define dso_local i32 @test4-g2(i32 %u) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test4-g2 ; IS__TUNIT_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR1]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR5]] ; IS__TUNIT_OPM-NEXT: ret i32 [[CALL]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test4-g2 -; IS__TUNIT_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR1]], !range [[RNG3:![0-9]+]] -; IS__TUNIT_NPM-NEXT: ret i32 [[CALL]] +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@test4-g2 +; IS________NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR4]], !range [[RNG3:![0-9]+]] +; IS________NPM-NEXT: ret i32 [[CALL]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test4-g2 ; 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: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR6]] ; IS__CGSCC_OPM-NEXT: ret i32 [[CALL]] ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test4-g2 -; IS__CGSCC_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR4]], !range [[RNG3:![0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 [[CALL]] -; entry: %call = tail call i32 @test4-f2(i32 %u) ret i32 %call @@ -771,57 +747,31 @@ ; FIXME: All but the return is not needed anymore define dso_local zeroext i1 @phi(i32 %arg) { -; 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 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@phi +; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: bb: +; CHECK-NEXT: [[TMP:%.*]] = icmp sgt i32 [[ARG]], 5 +; CHECK-NEXT: br i1 [[TMP]], label [[BB1:%.*]], label [[BB2:%.*]] +; CHECK: bb1: +; CHECK-NEXT: br label [[BB3:%.*]] +; CHECK: bb2: +; CHECK-NEXT: br label [[BB3]] +; CHECK: bb3: +; CHECK-NEXT: [[TMP4:%.*]] = icmp sgt i32 [[ARG]], 10 +; CHECK-NEXT: br i1 [[TMP4]], label [[BB5:%.*]], label [[BB7:%.*]] +; CHECK: bb5: +; CHECK-NEXT: br label [[BB9:%.*]] +; CHECK: bb7: +; CHECK-NEXT: br label [[BB9]] +; CHECK: bb9: +; CHECK-NEXT: br label [[BB12:%.*]] +; CHECK: bb11: +; CHECK-NEXT: unreachable +; CHECK: bb12: +; CHECK-NEXT: br label [[BB13:%.*]] +; CHECK: bb13: +; CHECK-NEXT: ret i1 false ; bb: %tmp = icmp sgt i32 %arg, 5 @@ -863,17 +813,11 @@ } define dso_local i1 @select(i32 %a) local_unnamed_addr #0 { -; 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____: 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 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@select +; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i1 false ; entry: %cmp = icmp sgt i32 %a, 5 @@ -886,17 +830,11 @@ } define dso_local i32 @select_zext(i32 %a) local_unnamed_addr #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____: 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 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@select_zext +; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 0 ; entry: %cmp = icmp sgt i32 %a, 5 @@ -910,17 +848,11 @@ } define dso_local i64 @select_int2ptr_bitcast_ptr2int(i32 %a) local_unnamed_addr #0 { -; 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: ret i64 0 -; -; 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: ret i64 0 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@select_int2ptr_bitcast_ptr2int +; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i64 0 ; entry: %cmp = icmp sgt i32 %a, 5 @@ -938,117 +870,89 @@ ; } define i1 @f_fcmp(float %a, float %b) { -; 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]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@f_fcmp +; CHECK-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: [[R:%.*]] = fcmp uge float [[A]], [[B]] +; CHECK-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; CHECK-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____: 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]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@d_fcmp +; CHECK-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: [[R:%.*]] = fcmp oeq double [[A]], [[B]] +; CHECK-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; CHECK-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____: 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]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@dp_icmp +; CHECK-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: [[R:%.*]] = icmp sge double* [[A]], [[B]] +; CHECK-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; CHECK-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____: 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]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@ip_icmp +; CHECK-SAME: (i8* nofree readnone [[A:%.*]], i8* nofree readnone [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: [[R:%.*]] = icmp ult i8* [[A]], [[B]] +; CHECK-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; CHECK-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____: 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__TUNIT_OPM: Function Attrs: nofree norecurse 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:%.*]]) #[[ATTR1]] { +; IS__TUNIT_OPM-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR5]] +; IS__TUNIT_OPM-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR5]] +; IS__TUNIT_OPM-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR5]] +; IS__TUNIT_OPM-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR5]] +; 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________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@fcmp_caller +; IS________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________NPM-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR4]] +; IS________NPM-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR4]] +; IS________NPM-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR4]] +; IS________NPM-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR4]] +; IS________NPM-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] +; IS________NPM-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] +; IS________NPM-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] +; IS________NPM-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:%.*]]) #[[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]] -; IS__CGSCC_OPM-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR5]] +; IS__CGSCC_OPM-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR6]] +; IS__CGSCC_OPM-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR6]] +; IS__CGSCC_OPM-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR6]] +; IS__CGSCC_OPM-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR6]] ; IS__CGSCC_OPM-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] ; IS__CGSCC_OPM-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] ; IS__CGSCC_OPM-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] ; IS__CGSCC_OPM-NEXT: ret i1 [[O3]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fcmp_caller -; IS__CGSCC_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__CGSCC_NPM-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR4]] -; IS__CGSCC_NPM-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR4]] -; IS__CGSCC_NPM-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR4]] -; IS__CGSCC_NPM-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR4]] -; IS__CGSCC_NPM-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] -; IS__CGSCC_NPM-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] -; IS__CGSCC_NPM-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] -; IS__CGSCC_NPM-NEXT: ret i1 [[O3]] ; %r1 = call i1 @f_fcmp(float %fa, float %fb) %r2 = call i1 @d_fcmp(double %da, double %db) @@ -1061,43 +965,28 @@ } define i8 @ret_two() { -; 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__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 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@ret_two +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i8 2 ; ret i8 2 } define i8 @ret_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____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_undef -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 undef +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@ret_undef +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-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____: 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__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 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@undef_collapse_1 +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i8 0 ; %c = call i8 @ret_undef() %s = shl i8 %c, 2 @@ -1106,15 +995,10 @@ ; Verify we collapse undef to a value and return something non-undef here. define i8 @undef_collapse_2() { -; 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__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 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@undef_collapse_2 +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i8 0 ; %c = call i8 @ret_two() %s = shl i8 undef, %c @@ -1123,15 +1007,10 @@ define i8 @undef_collapse_caller() { ; -; 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____: 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 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@undef_collapse_caller +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i8 0 ; %c1 = call i8 @undef_collapse_1() %c2 = call i8 @undef_collapse_2() @@ -1140,32 +1019,21 @@ } define i32 @ret1or2(i1 %c) { -; 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]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@ret1or2 +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: [[S:%.*]] = select i1 [[C]], i32 1, i32 2 +; CHECK-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____: 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____: 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 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@callee_range_1 +; CHECK-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret i1 true ; %r1 = call i32 @ret1or2(i1 %c1) %r2 = call i32 @ret1or2(i1 %c2) @@ -1179,43 +1047,34 @@ define i1 @callee_range_2(i1 %c1, i1 %c2) { ; -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callee_range_2 ; 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: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR5]], !range [[RNG4:![0-9]+]] +; IS__TUNIT_OPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR5]], !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 ; IS__TUNIT_OPM-NEXT: ret i1 [[F]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee_range_2 -; IS__TUNIT_NPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR1]], !range [[RNG5:![0-9]+]] -; IS__TUNIT_NPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR1]], !range [[RNG5]] -; IS__TUNIT_NPM-NEXT: [[A:%.*]] = add i32 [[R1]], [[R2]] -; IS__TUNIT_NPM-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 3 -; IS__TUNIT_NPM-NEXT: ret i1 [[I1]] +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@callee_range_2 +; IS________NPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR1]] { +; IS________NPM-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR4]], !range [[RNG5:![0-9]+]] +; IS________NPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR4]], !range [[RNG5]] +; IS________NPM-NEXT: [[A:%.*]] = add i32 [[R1]], [[R2]] +; IS________NPM-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 3 +; IS________NPM-NEXT: ret i1 [[I1]] ; ; 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:%.*]]) #[[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: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR6]], !range [[RNG5:![0-9]+]] +; IS__CGSCC_OPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR6]], !range [[RNG5]] ; IS__CGSCC_OPM-NEXT: [[A:%.*]] = add i32 [[R1]], [[R2]] ; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 3 ; IS__CGSCC_OPM-NEXT: [[F:%.*]] = and i1 [[I1]], true ; IS__CGSCC_OPM-NEXT: ret i1 [[F]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee_range_2 -; IS__CGSCC_NPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR4]], !range [[RNG5:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR4]], !range [[RNG5]] -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = add i32 [[R1]], [[R2]] -; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 3 -; IS__CGSCC_NPM-NEXT: ret i1 [[I1]] ; %r1 = call i32 @ret1or2(i1 %c1) %r2 = call i32 @ret1or2(i1 %c2) @@ -1228,72 +1087,41 @@ define i32 @ret100() { -; 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____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret100 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 100 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@ret100 +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i32 100 ; ret i32 100 } define i1 @ctx_adjustment(i32 %V) { ; -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@ctx_adjustment -; 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: -; IS__TUNIT_OPM-NEXT: br label [[END:%.*]] -; IS__TUNIT_OPM: if.false: -; IS__TUNIT_OPM-NEXT: br label [[END]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: [[PHI:%.*]] = phi i32 [ [[V]], [[IF_TRUE]] ], [ 100, [[IF_FALSE]] ] -; IS__TUNIT_OPM-NEXT: [[C2:%.*]] = icmp sge i32 [[PHI]], 100 -; IS__TUNIT_OPM-NEXT: ret i1 [[C2]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@ctx_adjustment -; IS__TUNIT_NPM-SAME: (i32 [[V:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 -; IS__TUNIT_NPM-NEXT: br i1 [[C1]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] -; IS__TUNIT_NPM: if.true: -; IS__TUNIT_NPM-NEXT: br label [[END:%.*]] -; IS__TUNIT_NPM: if.false: -; IS__TUNIT_NPM-NEXT: br label [[END]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: ret i1 true -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ctx_adjustment -; 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: -; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_OPM: if.false: -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: [[PHI:%.*]] = phi i32 [ [[V]], [[IF_TRUE]] ], [ 100, [[IF_FALSE]] ] -; IS__CGSCC_OPM-NEXT: [[C2:%.*]] = icmp sge i32 [[PHI]], 100 -; IS__CGSCC_OPM-NEXT: ret i1 [[C2]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ctx_adjustment -; IS__CGSCC_NPM-SAME: (i32 [[V:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 -; IS__CGSCC_NPM-NEXT: br i1 [[C1]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] -; IS__CGSCC_NPM: if.true: -; IS__CGSCC_NPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_NPM: if.false: -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret i1 true +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________OPM-LABEL: define {{[^@]+}}@ctx_adjustment +; IS________OPM-SAME: (i32 [[V:%.*]]) #[[ATTR1]] { +; IS________OPM-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 +; IS________OPM-NEXT: br i1 [[C1]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] +; IS________OPM: if.true: +; IS________OPM-NEXT: br label [[END:%.*]] +; IS________OPM: if.false: +; IS________OPM-NEXT: br label [[END]] +; IS________OPM: end: +; IS________OPM-NEXT: [[PHI:%.*]] = phi i32 [ [[V]], [[IF_TRUE]] ], [ 100, [[IF_FALSE]] ] +; IS________OPM-NEXT: [[C2:%.*]] = icmp sge i32 [[PHI]], 100 +; IS________OPM-NEXT: ret i1 [[C2]] +; +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@ctx_adjustment +; IS________NPM-SAME: (i32 [[V:%.*]]) #[[ATTR1]] { +; IS________NPM-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 +; IS________NPM-NEXT: br i1 [[C1]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] +; IS________NPM: if.true: +; IS________NPM-NEXT: br label [[END:%.*]] +; IS________NPM: if.false: +; IS________NPM-NEXT: br label [[END]] +; IS________NPM: end: +; IS________NPM-NEXT: ret i1 true ; %c1 = icmp sge i32 %V, 100 br i1 %c1, label %if.true, label %if.false @@ -1310,46 +1138,40 @@ define i32 @func(i1 %c) { -; 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]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@func +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: [[RET:%.*]] = select i1 [[C]], i32 0, i32 1 +; CHECK-NEXT: ret i32 [[RET]] ; %ret = select i1 %c, i32 0, i32 1 ret i32 %ret } define i32 @simplify_callsite_argument(i1 %d) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@simplify_callsite_argument ; 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 noundef i32 @func(i1 noundef [[C]]) #[[ATTR1]], !range [[RNG3]] +; IS__TUNIT_OPM-NEXT: [[RET1:%.*]] = call noundef i32 @func(i1 noundef [[C]]) #[[ATTR5]], !range [[RNG3]] ; IS__TUNIT_OPM-NEXT: ret i32 [[RET1]] ; IS__TUNIT_OPM: f: -; IS__TUNIT_OPM-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR1]], !range [[RNG3]] +; IS__TUNIT_OPM-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR5]], !range [[RNG3]] ; IS__TUNIT_OPM-NEXT: ret i32 [[RET2]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@simplify_callsite_argument -; IS__TUNIT_NPM-SAME: (i1 [[D:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = select i1 [[D]], i1 true, i1 false -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT_NPM: t: -; IS__TUNIT_NPM-NEXT: [[RET1:%.*]] = call noundef i32 @func(i1 noundef true) #[[ATTR1]], !range [[RNG4]] -; IS__TUNIT_NPM-NEXT: ret i32 [[RET1]] -; IS__TUNIT_NPM: f: -; IS__TUNIT_NPM-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR1]], !range [[RNG4]] -; IS__TUNIT_NPM-NEXT: ret i32 [[RET2]] +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@simplify_callsite_argument +; IS________NPM-SAME: (i1 [[D:%.*]]) #[[ATTR1]] { +; IS________NPM-NEXT: [[C:%.*]] = select i1 [[D]], i1 true, i1 false +; IS________NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS________NPM: t: +; IS________NPM-NEXT: [[RET1:%.*]] = call noundef i32 @func(i1 noundef true) #[[ATTR4]], !range [[RNG4]] +; IS________NPM-NEXT: ret i32 [[RET1]] +; IS________NPM: f: +; IS________NPM-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR4]], !range [[RNG4]] +; IS________NPM-NEXT: ret i32 [[RET2]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@simplify_callsite_argument @@ -1357,23 +1179,11 @@ ; 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: -; IS__CGSCC_OPM-NEXT: [[RET1:%.*]] = call noundef i32 @func(i1 noundef [[C]]) #[[ATTR5]], !range [[RNG4]] +; IS__CGSCC_OPM-NEXT: [[RET1:%.*]] = call noundef i32 @func(i1 noundef [[C]]) #[[ATTR6]], !range [[RNG4]] ; IS__CGSCC_OPM-NEXT: ret i32 [[RET1]] ; IS__CGSCC_OPM: f: -; IS__CGSCC_OPM-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR5]], !range [[RNG4]] +; IS__CGSCC_OPM-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR6]], !range [[RNG4]] ; IS__CGSCC_OPM-NEXT: ret i32 [[RET2]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@simplify_callsite_argument -; IS__CGSCC_NPM-SAME: (i1 [[D:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = select i1 [[D]], i1 true, i1 false -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_NPM: t: -; IS__CGSCC_NPM-NEXT: [[RET1:%.*]] = call noundef i32 @func(i1 noundef true) #[[ATTR4]], !range [[RNG4]] -; IS__CGSCC_NPM-NEXT: ret i32 [[RET1]] -; IS__CGSCC_NPM: f: -; IS__CGSCC_NPM-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR4]], !range [[RNG4]] -; IS__CGSCC_NPM-NEXT: ret i32 [[RET2]] ; %c = select i1 %d, i1 true, i1 false br i1 %c, label %t, label %f @@ -1400,8 +1210,7 @@ define internal i1 @is_less_than_65536(i32 %arg) { ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@is_less_than_65536 -; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp ult i32 undef, 65536 +; IS__CGSCC____-SAME: () #[[ATTR1]] { ; IS__CGSCC____-NEXT: ret i1 undef ; %cmp = icmp ult i32 %arg, 65536 @@ -1409,15 +1218,10 @@ } define i1 @check_divided_range(i32 %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@check_divided_range -; IS__TUNIT____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 true -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@check_divided_range -; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 true +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@check_divided_range +; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret i1 true ; %csret1 = call i32 @less_than_65536(i32 0) %csret2 = call i32 @less_than_65536(i32 %arg) @@ -1450,15 +1254,10 @@ } define i1 @check_casted_range(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@check_casted_range -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-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 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@check_casted_range +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret i1 true ; %csret1 = call i32 @cast_and_return(i1 true) %csret2 = call i32 @cast_and_return(i1 %c) @@ -1533,15 +1332,10 @@ } define i1 @propagate_range1(i32 %c){ -; 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__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 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@propagate_range1 +; CHECK-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret i1 true ; %csret = call i32 @less_than_100_1(i32 %c) %true = call i1 @is_less_than_100_1(i32 %csret) @@ -1608,8 +1402,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@is_less_than_100_2 -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp slt i32 undef, 100 +; IS__CGSCC____-SAME: () #[[ATTR1]] { ; IS__CGSCC____-NEXT: ret i1 undef ; %cmp = icmp slt i32 %c, 100 @@ -1617,15 +1410,10 @@ } define i1 @propagate_range2(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@propagate_range2 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-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 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@propagate_range2 +; CHECK-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret i1 true ; %csret1 = call i32 @less_than_100_2(i32 0) %true1 = call i1 @is_less_than_100_2(i32 %csret1) @@ -1636,17 +1424,11 @@ } 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:%.*]]) #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: [[R:%.*]] = icmp ne i8 [[V]], 0 -; IS__TUNIT_OPM-NEXT: ret i1 [[R]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@non_zero -; IS__CGSCC_OPM-SAME: (i8 [[V:%.*]]) #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: [[R:%.*]] = icmp ne i8 [[V]], 0 -; IS__CGSCC_OPM-NEXT: ret i1 [[R]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________OPM-LABEL: define {{[^@]+}}@non_zero +; IS________OPM-SAME: (i8 [[V:%.*]]) #[[ATTR1]] { +; IS________OPM-NEXT: [[R:%.*]] = icmp ne i8 [[V]], 0 +; IS________OPM-NEXT: ret i1 [[R]] ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@non_zero @@ -1659,28 +1441,28 @@ ; Avoid range metadata for %l below define i1 @context(i8* %p) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@context ; IS__TUNIT_OPM-SAME: (i8* nocapture nofree noundef nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR0]] { ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 ; 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]]) #[[ATTR1]] +; IS__TUNIT_OPM-NEXT: [[R:%.*]] = call i1 @non_zero(i8 [[L]]) #[[ATTR5]] ; IS__TUNIT_OPM-NEXT: ret i1 [[R]] ; IS__TUNIT_OPM: f: ; IS__TUNIT_OPM-NEXT: ret i1 false ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@context -; IS__TUNIT_NPM-SAME: (i8* nocapture nofree noundef nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT_NPM: t: -; IS__TUNIT_NPM-NEXT: ret i1 true -; IS__TUNIT_NPM: f: -; IS__TUNIT_NPM-NEXT: ret i1 false +; IS________NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS________NPM-LABEL: define {{[^@]+}}@context +; IS________NPM-SAME: (i8* nocapture nofree noundef nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR0]] { +; IS________NPM-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 +; IS________NPM-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] +; IS________NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS________NPM: t: +; IS________NPM-NEXT: ret i1 true +; IS________NPM: f: +; IS________NPM-NEXT: ret i1 false ; ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@context @@ -1689,21 +1471,10 @@ ; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] ; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__CGSCC_OPM: t: -; IS__CGSCC_OPM-NEXT: [[R:%.*]] = call i1 @non_zero(i8 [[L]]) #[[ATTR5]] +; IS__CGSCC_OPM-NEXT: [[R:%.*]] = call i1 @non_zero(i8 [[L]]) #[[ATTR7:[0-9]+]] ; IS__CGSCC_OPM-NEXT: ret i1 [[R]] ; IS__CGSCC_OPM: f: ; IS__CGSCC_OPM-NEXT: ret i1 false -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@context -; IS__CGSCC_NPM-SAME: (i8* nocapture nofree noundef nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_NPM: t: -; IS__CGSCC_NPM-NEXT: ret i1 true -; IS__CGSCC_NPM: f: -; IS__CGSCC_NPM-NEXT: ret i1 false ; %l = load i8, i8* %p %c = icmp slt i8 0, %l @@ -1779,35 +1550,20 @@ } define i1 @loop_1(i32 %N) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@loop_1 -; IS__TUNIT____-SAME: (i32 [[N:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[HEADER:%.*]] -; IS__TUNIT____: header: -; IS__TUNIT____-NEXT: [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[AND:%.*]], [[HEADER]] ] -; IS__TUNIT____-NEXT: [[INC:%.*]] = add i32 [[I]], 1 -; IS__TUNIT____-NEXT: [[AND]] = and i32 [[INC]], 9999 -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp ne i32 [[N]], [[AND]] -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[HEADER]], label [[EXIT:%.*]] -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: [[R:%.*]] = icmp sle i32 [[I]], 5 -; IS__TUNIT____-NEXT: ret i1 [[R]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@loop_1 -; IS__CGSCC____-SAME: (i32 [[N:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[HEADER:%.*]] -; IS__CGSCC____: header: -; IS__CGSCC____-NEXT: [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[AND:%.*]], [[HEADER]] ] -; IS__CGSCC____-NEXT: [[INC:%.*]] = add i32 [[I]], 1 -; IS__CGSCC____-NEXT: [[AND]] = and i32 [[INC]], 9999 -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp ne i32 [[N]], [[AND]] -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[HEADER]], label [[EXIT:%.*]] -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: [[R:%.*]] = icmp sle i32 [[I]], 5 -; IS__CGSCC____-NEXT: ret i1 [[R]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone +; CHECK-LABEL: define {{[^@]+}}@loop_1 +; CHECK-SAME: (i32 [[N:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: br label [[HEADER:%.*]] +; CHECK: header: +; CHECK-NEXT: [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[AND:%.*]], [[HEADER]] ] +; CHECK-NEXT: [[INC:%.*]] = add i32 [[I]], 1 +; CHECK-NEXT: [[AND]] = and i32 [[INC]], 9999 +; CHECK-NEXT: [[CMP:%.*]] = icmp ne i32 [[N]], [[AND]] +; CHECK-NEXT: br i1 [[CMP]], label [[HEADER]], label [[EXIT:%.*]] +; CHECK: exit: +; CHECK-NEXT: [[R:%.*]] = icmp sle i32 [[I]], 5 +; CHECK-NEXT: ret i1 [[R]] ; entry: br label %header @@ -1830,17 +1586,27 @@ !0 = !{i32 0, i32 10} !1 = !{i32 10, i32 100} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone } +; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR4]] = { nofree nosync nounwind readnone } +; IS__TUNIT_OPM: attributes #[[ATTR5]] = { nofree nosync nounwind readnone willreturn } +;. +; IS__TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone } +; IS__TUNIT_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind readnone willreturn } ;. ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly 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 } +; IS__CGSCC_OPM: attributes #[[ATTR3]] = { norecurse } +; IS__CGSCC_OPM: attributes #[[ATTR4]] = { readonly willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR5]] = { nounwind readnone } +; IS__CGSCC_OPM: attributes #[[ATTR6]] = { readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nounwind readnone willreturn } ;. ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } @@ -1857,9 +1623,9 @@ ; IS________NPM: [[RNG0]] = !{i32 0, i32 10} ; IS________NPM: [[RNG1]] = !{i32 10, i32 100} ; IS________NPM: [[RNG2]] = !{i32 200, i32 1091} -; IS________NPM: [[META3:![0-9]+]] = !{i32 1, i32 -2147483648} +; IS________NPM: [[RNG3]] = !{i32 1, i32 -2147483648} ; IS________NPM: [[RNG4]] = !{i32 0, i32 2} -; IS________NPM: [[META5:![0-9]+]] = !{i32 1, i32 3} +; IS________NPM: [[RNG5]] = !{i32 1, i32 3} ;. ; IS__CGSCC_OPM: [[RNG0]] = !{i32 0, i32 10} ; IS__CGSCC_OPM: [[RNG1]] = !{i32 10, i32 100} diff --git a/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll b/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll --- a/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll +++ b/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll @@ -39,20 +39,20 @@ ; IS__TUNIT____-LABEL: define {{[^@]+}}@external_ret2_nrw ; IS__TUNIT____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree [[W0]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rrw(i32* nofree align 4 [[R0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly align 4 [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL3:%.*]] = call i32* @internal_ret1_rw(i32* nofree align 4 [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree [[W0]]) #[[ATTR3:[0-9]+]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rrw(i32* nofree align 4 [[R0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly align 4 [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL3:%.*]] = call i32* @internal_ret1_rw(i32* nofree align 4 [[R0]], i32* nofree [[W0]]) #[[ATTR3]] ; IS__TUNIT____-NEXT: ret i32* [[CALL3]] ; ; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind ; IS__CGSCC____-LABEL: define {{[^@]+}}@external_ret2_nrw ; IS__CGSCC____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree [[W0]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rrw(i32* nofree align 4 [[R0]], i32* nofree align 4 [[R0]], i32* nofree [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly align 4 [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR3:[0-9]+]] -; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32* @internal_ret1_rw(i32* nofree align 4 [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree [[W0]]) #[[ATTR3:[0-9]+]] +; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rrw(i32* nofree align 4 [[R0]], i32* nofree align 4 [[R0]], i32* nofree [[W0]]) #[[ATTR3]] +; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly align 4 [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR4:[0-9]+]] +; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32* @internal_ret1_rw(i32* nofree align 4 [[R0]], i32* nofree [[W0]]) #[[ATTR3]] ; IS__CGSCC____-NEXT: ret i32* [[CALL3]] ; entry: @@ -78,12 +78,12 @@ ; IS__TUNIT____-NEXT: store i32 3, i32* [[R0]], align 4 ; IS__TUNIT____-NEXT: store i32 5, i32* [[R1]], align 4 ; IS__TUNIT____-NEXT: store i32 1, i32* [[W0]], align 4 -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL4:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R1]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL4:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R1]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] ; IS__TUNIT____-NEXT: br label [[RETURN]] ; IS__TUNIT____: return: ; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[N0]], [[IF_END]] ], [ [[N0]], [[IF_THEN]] ] @@ -103,12 +103,12 @@ ; IS__CGSCC____-NEXT: store i32 3, i32* [[R0]], align 4 ; IS__CGSCC____-NEXT: store i32 5, i32* [[R1]], align 4 ; IS__CGSCC____-NEXT: store i32 1, i32* [[W0]], align 4 -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] -; IS__CGSCC____-NEXT: [[CALL4:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R1]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] -; IS__CGSCC____-NEXT: [[CALL5:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR4]] +; IS__CGSCC____-NEXT: [[CALL4:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R1]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR4]] +; IS__CGSCC____-NEXT: [[CALL5:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] ; IS__CGSCC____-NEXT: br label [[RETURN]] ; IS__CGSCC____: return: ; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[N0]], [[IF_END]] ], [ [[N0]], [[IF_THEN]] ] @@ -151,19 +151,19 @@ ; IS__TUNIT____: if.then: ; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] ; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR3]] ; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32, i32* [[R0]], align 4 ; IS__TUNIT____-NEXT: [[TMP2:%.*]] = load i32, i32* [[R1]], align 4 ; IS__TUNIT____-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[TMP2]] ; IS__TUNIT____-NEXT: store i32 [[ADD]], i32* [[W0]], align 4 -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL3:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32* @external_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[R1]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL3:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32* @external_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[R1]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] ; IS__TUNIT____-NEXT: br label [[RETURN]] ; IS__TUNIT____: return: ; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL8]], [[IF_END]] ], [ [[R1]], [[IF_THEN]] ] @@ -179,19 +179,19 @@ ; IS__CGSCC____: if.then: ; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] ; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR3]] ; IS__CGSCC____-NEXT: [[TMP1:%.*]] = load i32, i32* [[R0]], align 4 ; IS__CGSCC____-NEXT: [[TMP2:%.*]] = load i32, i32* [[R1]], align 4 ; IS__CGSCC____-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[TMP2]] ; IS__CGSCC____-NEXT: store i32 [[ADD]], i32* [[W0]], align 4 -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL5:%.*]] = call i32* @external_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL6:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[R1]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] -; IS__CGSCC____-NEXT: [[CALL7:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] -; IS__CGSCC____-NEXT: [[CALL8:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__CGSCC____-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__CGSCC____-NEXT: [[CALL5:%.*]] = call i32* @external_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__CGSCC____-NEXT: [[CALL6:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[R1]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR4]] +; IS__CGSCC____-NEXT: [[CALL7:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR4]] +; IS__CGSCC____-NEXT: [[CALL8:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] ; IS__CGSCC____-NEXT: br label [[RETURN]] ; IS__CGSCC____: return: ; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[R1]], [[IF_END]] ], [ [[R1]], [[IF_THEN]] ] @@ -227,35 +227,20 @@ } define i32* @external_sink_ret2_nrw(i32* %n0, i32* %r0, i32* %w0) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@external_sink_ret2_nrw -; IS__TUNIT____-SAME: (i32* nofree [[N0:%.*]], i32* nocapture nofree readonly [[R0:%.*]], i32* nofree returned writeonly "no-capture-maybe-returned" [[W0:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp ne i32* [[N0]], null -; IS__TUNIT____-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 -; IS__TUNIT____-NEXT: store i32 [[TMP0]], i32* [[W0]], align 4 -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: ret i32* [[W0]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@external_sink_ret2_nrw -; IS__CGSCC____-SAME: (i32* nofree [[N0:%.*]], i32* nocapture nofree readonly [[R0:%.*]], i32* nofree returned writeonly "no-capture-maybe-returned" [[W0:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp ne i32* [[N0]], null -; IS__CGSCC____-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 -; IS__CGSCC____-NEXT: store i32 [[TMP0]], i32* [[W0]], align 4 -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: ret i32* [[W0]] +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@external_sink_ret2_nrw +; CHECK-SAME: (i32* nofree [[N0:%.*]], i32* nocapture nofree readonly [[R0:%.*]], i32* nofree returned writeonly "no-capture-maybe-returned" [[W0:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i32* [[N0]], null +; CHECK-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; CHECK: if.then: +; CHECK-NEXT: br label [[RETURN:%.*]] +; CHECK: if.end: +; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 +; CHECK-NEXT: store i32 [[TMP0]], i32* [[W0]], align 4 +; CHECK-NEXT: br label [[RETURN]] +; CHECK: return: +; CHECK-NEXT: ret i32* [[W0]] ; entry: %tobool = icmp ne i32* %n0, null @@ -284,13 +269,13 @@ ; IS__TUNIT____: if.then: ; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] ; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR3]] ; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32, i32* [[R0]], align 4 ; IS__TUNIT____-NEXT: store i32 [[TMP1]], i32* [[W0]], align 4 -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] ; IS__TUNIT____-NEXT: br label [[RETURN]] ; IS__TUNIT____: return: ; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL4]], [[IF_END]] ], [ [[W0]], [[IF_THEN]] ] @@ -306,13 +291,13 @@ ; IS__CGSCC____: if.then: ; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] ; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR3]] ; IS__CGSCC____-NEXT: [[TMP1:%.*]] = load i32, i32* [[R0]], align 4 ; IS__CGSCC____-NEXT: store i32 [[TMP1]], i32* [[W0]], align 4 -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR4:[0-9]+]] -; IS__CGSCC____-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR5:[0-9]+]] +; IS__CGSCC____-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] ; IS__CGSCC____-NEXT: br label [[RETURN]] ; IS__CGSCC____: return: ; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL4]], [[IF_END]] ], [ [[W0]], [[IF_THEN]] ] @@ -342,20 +327,20 @@ } define i32* @external_source_ret2_nrw(i32* %n0, i32* %r0, i32* %w0) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind ; IS__TUNIT____-LABEL: define {{[^@]+}}@external_source_ret2_nrw -; IS__TUNIT____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { +; IS__TUNIT____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR2:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR3:[0-9]+]] -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR4:[0-9]+]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR3]] ; IS__TUNIT____-NEXT: ret i32* [[CALL1]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind +; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind ; IS__CGSCC____-LABEL: define {{[^@]+}}@external_source_ret2_nrw -; IS__CGSCC____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { +; IS__CGSCC____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR2:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR4]] -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR3]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR5]] +; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR4]] ; IS__CGSCC____-NEXT: ret i32* [[CALL1]] ; entry: @@ -368,13 +353,15 @@ ; for a subset relation. ;. ; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind } -; IS__TUNIT____: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind } -; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind } +; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nosync nounwind } +; IS__TUNIT____: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind } ; IS__CGSCC____: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { nofree nosync nounwind } -; IS__CGSCC____: attributes #[[ATTR3]] = { nounwind } -; IS__CGSCC____: attributes #[[ATTR4]] = { nounwind willreturn } +; IS__CGSCC____: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind } +; IS__CGSCC____: attributes #[[ATTR3]] = { nofree nosync nounwind } +; IS__CGSCC____: attributes #[[ATTR4]] = { nounwind } +; IS__CGSCC____: attributes #[[ATTR5]] = { nounwind willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/readattrs.ll b/llvm/test/Transforms/Attributor/readattrs.ll --- a/llvm/test/Transforms/Attributor/readattrs.ll +++ b/llvm/test/Transforms/Attributor/readattrs.ll @@ -28,34 +28,22 @@ } define i8* @test2(i8* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT____-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: store i32 0, i32* @x, align 4 -; IS__TUNIT____-NEXT: ret i8* [[P]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC____-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 0, i32* @x, align 4 -; IS__CGSCC____-NEXT: ret i8* [[P]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@test2 +; CHECK-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: store i32 0, i32* @x, align 4 +; CHECK-NEXT: ret i8* [[P]] ; store i32 0, i32* @x ret i8* %p } define i1 @test3(i8* %p, i8* %q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test3 -; IS__TUNIT____-SAME: (i8* nofree readnone [[P:%.*]], i8* nofree readnone [[Q:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = icmp ult i8* [[P]], [[Q]] -; IS__TUNIT____-NEXT: ret i1 [[A]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test3 -; IS__CGSCC____-SAME: (i8* nofree readnone [[P:%.*]], i8* nofree readnone [[Q:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = icmp ult i8* [[P]], [[Q]] -; IS__CGSCC____-NEXT: ret i1 [[A]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test3 +; CHECK-SAME: (i8* nofree readnone [[P:%.*]], i8* nofree readnone [[Q:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: [[A:%.*]] = icmp ult i8* [[P]], [[Q]] +; CHECK-NEXT: ret i1 [[A]] ; %A = icmp ult i8* %p, %q ret i1 %A @@ -76,17 +64,11 @@ ; Missed optz'n: we could make %q readnone, but don't break test6! define void @test5(i8** %p, i8* %q) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test5 -; IS__TUNIT____-SAME: (i8** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[P:%.*]], i8* nofree writeonly [[Q:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: store i8* [[Q]], i8** [[P]], align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test5 -; IS__CGSCC____-SAME: (i8** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[P:%.*]], i8* nofree writeonly [[Q:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: store i8* [[Q]], i8** [[P]], align 8 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@test5 +; CHECK-SAME: (i8** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[P:%.*]], i8* nofree writeonly [[Q:%.*]]) #[[ATTR3:[0-9]+]] { +; CHECK-NEXT: store i8* [[Q]], i8** [[P]], align 8 +; CHECK-NEXT: ret void ; store i8* %q, i8** %p ret void @@ -108,50 +90,32 @@ ; inalloca parameters are always considered written define void @test7_1(i32* inalloca(i32) %a) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test7_1 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly inalloca(i32) dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test7_1 -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly inalloca(i32) dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test7_1 +; CHECK-SAME: (i32* nocapture nofree nonnull writeonly inalloca(i32) dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret void ; ret void } define i32* @test8_1(i32* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test8_1 -; IS__TUNIT____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32* [[P]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test8_1 -; IS__CGSCC____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32* [[P]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test8_1 +; CHECK-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32* [[P]] ; entry: ret i32* %p } define void @test8_2(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test8_2 -; IS__TUNIT____-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: store i32 10, i32* [[P]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test8_2 -; IS__CGSCC____-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: store i32 10, i32* [[P]], align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@test8_2 +; CHECK-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR3]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: store i32 10, i32* [[P]], align 4 +; CHECK-NEXT: ret void ; entry: %call = call i32* @test8_1(i32* %p) @@ -165,17 +129,11 @@ ; CHECK-NOT: readnone ; CHECK-NOT: readonly define void @test9(<4 x i32*> %ptrs, <4 x i32>%val) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test9 -; IS__TUNIT____-SAME: (<4 x i32*> [[PTRS:%.*]], <4 x i32> [[VAL:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: call void @llvm.masked.scatter.v4i32.v4p0i32(<4 x i32> [[VAL]], <4 x i32*> [[PTRS]], i32 noundef 4, <4 x i1> noundef ) #[[ATTR10:[0-9]+]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test9 -; IS__CGSCC____-SAME: (<4 x i32*> [[PTRS:%.*]], <4 x i32> [[VAL:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC____-NEXT: call void @llvm.masked.scatter.v4i32.v4p0i32(<4 x i32> [[VAL]], <4 x i32*> [[PTRS]], i32 noundef 4, <4 x i1> noundef ) #[[ATTR11:[0-9]+]] -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@test9 +; CHECK-SAME: (<4 x i32*> [[PTRS:%.*]], <4 x i32> [[VAL:%.*]]) #[[ATTR4:[0-9]+]] { +; CHECK-NEXT: call void @llvm.masked.scatter.v4i32.v4p0i32(<4 x i32> [[VAL]], <4 x i32*> [[PTRS]], i32 noundef 4, <4 x i1> noundef ) #[[ATTR11:[0-9]+]] +; CHECK-NEXT: ret void ; call void @llvm.masked.scatter.v4i32.v4p0i32(<4 x i32>%val, <4 x i32*> %ptrs, i32 4, <4 x i1>) ret void @@ -184,17 +142,11 @@ ; CHECK: declare <4 x i32> @llvm.masked.gather declare <4 x i32> @llvm.masked.gather.v4i32.v4p0i32(<4 x i32*>, i32, <4 x i1>, <4 x i32>) define <4 x i32> @test10(<4 x i32*> %ptrs) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test10 -; IS__TUNIT____-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT____-NEXT: [[RES:%.*]] = call <4 x i32> @llvm.masked.gather.v4i32.v4p0i32(<4 x i32*> [[PTRS]], i32 noundef 4, <4 x i1> noundef , <4 x i32> undef) #[[ATTR11:[0-9]+]] -; IS__TUNIT____-NEXT: ret <4 x i32> [[RES]] -; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test10 -; IS__CGSCC____-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC____-NEXT: [[RES:%.*]] = call <4 x i32> @llvm.masked.gather.v4i32.v4p0i32(<4 x i32*> [[PTRS]], i32 noundef 4, <4 x i1> noundef , <4 x i32> undef) #[[ATTR12:[0-9]+]] -; IS__CGSCC____-NEXT: ret <4 x i32> [[RES]] +; CHECK: Function Attrs: nofree nosync nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@test10 +; CHECK-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR5:[0-9]+]] { +; CHECK-NEXT: [[RES:%.*]] = call <4 x i32> @llvm.masked.gather.v4i32.v4p0i32(<4 x i32*> [[PTRS]], i32 noundef 4, <4 x i1> noundef , <4 x i32> undef) #[[ATTR12:[0-9]+]] +; CHECK-NEXT: ret <4 x i32> [[RES]] ; %res = call <4 x i32> @llvm.masked.gather.v4i32.v4p0i32(<4 x i32*> %ptrs, i32 4, <4 x i1>, <4 x i32>undef) ret <4 x i32> %res @@ -203,17 +155,11 @@ ; CHECK: declare <4 x i32> @test11_1 declare <4 x i32> @test11_1(<4 x i32*>) argmemonly nounwind readonly define <4 x i32> @test11_2(<4 x i32*> %ptrs) { -; IS__TUNIT____: Function Attrs: argmemonly nounwind readonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test11_2 -; IS__TUNIT____-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__TUNIT____-NEXT: [[RES:%.*]] = call <4 x i32> @test11_1(<4 x i32*> [[PTRS]]) #[[ATTR9:[0-9]+]] -; IS__TUNIT____-NEXT: ret <4 x i32> [[RES]] -; -; IS__CGSCC____: Function Attrs: argmemonly nounwind readonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test11_2 -; IS__CGSCC____-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC____-NEXT: [[RES:%.*]] = call <4 x i32> @test11_1(<4 x i32*> [[PTRS]]) #[[ATTR10:[0-9]+]] -; IS__CGSCC____-NEXT: ret <4 x i32> [[RES]] +; CHECK: Function Attrs: argmemonly nounwind readonly +; CHECK-LABEL: define {{[^@]+}}@test11_2 +; CHECK-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR6:[0-9]+]] { +; CHECK-NEXT: [[RES:%.*]] = call <4 x i32> @test11_1(<4 x i32*> [[PTRS]]) #[[ATTR10:[0-9]+]] +; CHECK-NEXT: ret <4 x i32> [[RES]] ; %res = call <4 x i32> @test11_1(<4 x i32*> %ptrs) ret <4 x i32> %res @@ -222,34 +168,22 @@ declare <4 x i32> @test12_1(<4 x i32*>) argmemonly nounwind ; CHECK-NOT: readnone define <4 x i32> @test12_2(<4 x i32*> %ptrs) { -; IS__TUNIT____: Function Attrs: argmemonly nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@test12_2 -; IS__TUNIT____-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: [[RES:%.*]] = call <4 x i32> @test12_1(<4 x i32*> [[PTRS]]) #[[ATTR12:[0-9]+]] -; IS__TUNIT____-NEXT: ret <4 x i32> [[RES]] -; -; IS__CGSCC____: Function Attrs: argmemonly nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@test12_2 -; IS__CGSCC____-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: [[RES:%.*]] = call <4 x i32> @test12_1(<4 x i32*> [[PTRS]]) #[[ATTR13:[0-9]+]] -; IS__CGSCC____-NEXT: ret <4 x i32> [[RES]] +; CHECK: Function Attrs: argmemonly nounwind +; CHECK-LABEL: define {{[^@]+}}@test12_2 +; CHECK-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR7:[0-9]+]] { +; CHECK-NEXT: [[RES:%.*]] = call <4 x i32> @test12_1(<4 x i32*> [[PTRS]]) #[[ATTR13:[0-9]+]] +; CHECK-NEXT: ret <4 x i32> [[RES]] ; %res = call <4 x i32> @test12_1(<4 x i32*> %ptrs) ret <4 x i32> %res } define i32 @volatile_load(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@volatile_load -; IS__TUNIT____-SAME: (i32* nofree noundef align 4 [[P:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__TUNIT____-NEXT: [[LOAD:%.*]] = load volatile i32, i32* [[P]], align 4 -; IS__TUNIT____-NEXT: ret i32 [[LOAD]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@volatile_load -; IS__CGSCC____-SAME: (i32* nofree noundef align 4 [[P:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC____-NEXT: [[LOAD:%.*]] = load volatile i32, i32* [[P]], align 4 -; IS__CGSCC____-NEXT: ret i32 [[LOAD]] +; CHECK: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@volatile_load +; CHECK-SAME: (i32* nofree noundef align 4 [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; CHECK-NEXT: [[LOAD:%.*]] = load volatile i32, i32* [[P]], align 4 +; CHECK-NEXT: ret i32 [[LOAD]] ; %load = load volatile i32, i32* %p ret i32 %load @@ -312,68 +246,44 @@ } define void @byval_not_readonly_2(i8* byval(i8) %written) readonly { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@byval_not_readonly_2 -; IS__TUNIT____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: store i8 0, i8* [[WRITTEN]], align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@byval_not_readonly_2 -; IS__CGSCC____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: store i8 0, i8* [[WRITTEN]], align 1 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@byval_not_readonly_2 +; CHECK-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: store i8 0, i8* [[WRITTEN]], align 1 +; CHECK-NEXT: ret void ; store i8 0, i8* %written ret void } define void @byval_not_readnone_1(i8* byval(i8) %written) readnone { -; IS__TUNIT____: Function Attrs: readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@byval_not_readnone_1 -; IS__TUNIT____-SAME: (i8* noalias nonnull byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__TUNIT____-NEXT: call void @escape_i8(i8* nonnull dereferenceable(1) [[WRITTEN]]) -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@byval_not_readnone_1 -; IS__CGSCC____-SAME: (i8* noalias nonnull byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC____-NEXT: call void @escape_i8(i8* nonnull dereferenceable(1) [[WRITTEN]]) -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: readnone +; CHECK-LABEL: define {{[^@]+}}@byval_not_readnone_1 +; CHECK-SAME: (i8* noalias nonnull byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR9:[0-9]+]] { +; CHECK-NEXT: call void @escape_i8(i8* nonnull dereferenceable(1) [[WRITTEN]]) +; CHECK-NEXT: ret void ; call void @escape_i8(i8* %written) ret void } define void @byval_not_readnone_2(i8* byval(i8) %written) readnone { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@byval_not_readnone_2 -; IS__TUNIT____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: store i8 0, i8* [[WRITTEN]], align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@byval_not_readnone_2 -; IS__CGSCC____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: store i8 0, i8* [[WRITTEN]], align 1 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@byval_not_readnone_2 +; CHECK-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: store i8 0, i8* [[WRITTEN]], align 1 +; CHECK-NEXT: ret void ; store i8 0, i8* %written ret void } define void @byval_no_fnarg(i8* byval(i8) %written) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@byval_no_fnarg -; IS__TUNIT____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: store i8 0, i8* [[WRITTEN]], align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@byval_no_fnarg -; IS__CGSCC____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: store i8 0, i8* [[WRITTEN]], align 1 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@byval_no_fnarg +; CHECK-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR3]] { +; CHECK-NEXT: store i8 0, i8* [[WRITTEN]], align 1 +; CHECK-NEXT: ret void ; store i8 0, i8* %written ret void @@ -384,7 +294,7 @@ ; IS__TUNIT____-SAME: (i8* nocapture readonly [[READ_ONLY:%.*]]) { ; IS__TUNIT____-NEXT: call void @byval_not_readonly_1(i8* nocapture readonly byval(i8) [[READ_ONLY]]) #[[ATTR2]] ; IS__TUNIT____-NEXT: call void @byval_not_readnone_1(i8* noalias nocapture readnone byval(i8) [[READ_ONLY]]) -; IS__TUNIT____-NEXT: call void @byval_no_fnarg(i8* nocapture nofree readonly byval(i8) [[READ_ONLY]]) #[[ATTR13:[0-9]+]] +; IS__TUNIT____-NEXT: call void @byval_no_fnarg(i8* nocapture nofree readonly byval(i8) [[READ_ONLY]]) #[[ATTR14:[0-9]+]] ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____-LABEL: define {{[^@]+}}@testbyval @@ -408,19 +318,12 @@ declare void @val_use(i8 %ptr) readonly nounwind define void @ptr_uses(i8* %ptr) { -; IS__TUNIT____: Function Attrs: nounwind readonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@ptr_uses -; IS__TUNIT____-SAME: (i8* nocapture readonly [[PTR:%.*]]) #[[ATTR9]] { -; IS__TUNIT____-NEXT: [[CALL_PTR:%.*]] = call i8* @maybe_returned_ptr(i8* readonly [[PTR]]) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL_VAL:%.*]] = call i8 @maybe_returned_val(i8* readonly [[CALL_PTR]]) #[[ATTR9]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nounwind readonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@ptr_uses -; IS__CGSCC____-SAME: (i8* nocapture readonly [[PTR:%.*]]) #[[ATTR10]] { -; IS__CGSCC____-NEXT: [[CALL_PTR:%.*]] = call i8* @maybe_returned_ptr(i8* readonly [[PTR]]) #[[ATTR10]] -; IS__CGSCC____-NEXT: [[CALL_VAL:%.*]] = call i8 @maybe_returned_val(i8* readonly [[CALL_PTR]]) #[[ATTR10]] -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nounwind readonly +; CHECK-LABEL: define {{[^@]+}}@ptr_uses +; CHECK-SAME: (i8* nocapture readonly [[PTR:%.*]]) #[[ATTR10]] { +; CHECK-NEXT: [[CALL_PTR:%.*]] = call i8* @maybe_returned_ptr(i8* readonly [[PTR]]) #[[ATTR10]] +; CHECK-NEXT: [[CALL_VAL:%.*]] = call i8 @maybe_returned_val(i8* readonly [[CALL_PTR]]) #[[ATTR10]] +; CHECK-NEXT: ret void ; %call_ptr = call i8* @maybe_returned_ptr(i8* %ptr) %call_val = call i8 @maybe_returned_val(i8* %call_ptr) @@ -458,50 +361,29 @@ @constant_mem = external dso_local constant i32, align 4 define i32 @read_only_constant_mem() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@read_only_constant_mem -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[L:%.*]] = load i32, i32* @constant_mem, align 4 -; IS__TUNIT____-NEXT: ret i32 [[L]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@read_only_constant_mem -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @constant_mem, align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@read_only_constant_mem +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: [[L:%.*]] = load i32, i32* @constant_mem, align 4 +; CHECK-NEXT: ret i32 [[L]] ; %l = load i32, i32* @constant_mem ret i32 %l } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { readonly } -; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR5]] = { argmemonly nounwind readonly } -; IS__TUNIT____: attributes #[[ATTR6]] = { argmemonly nounwind } -; IS__TUNIT____: attributes #[[ATTR7]] = { argmemonly nofree nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR8]] = { readnone } -; IS__TUNIT____: attributes #[[ATTR9]] = { nounwind readonly } -; IS__TUNIT____: attributes #[[ATTR10]] = { willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR11]] = { readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR12]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR13]] = { nounwind writeonly } -;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { readonly } -; IS__CGSCC____: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR5]] = { nofree nosync nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR6]] = { argmemonly nounwind readonly } -; IS__CGSCC____: attributes #[[ATTR7]] = { argmemonly nounwind } -; IS__CGSCC____: attributes #[[ATTR8]] = { argmemonly nofree norecurse nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR9]] = { readnone } -; IS__CGSCC____: attributes #[[ATTR10]] = { nounwind readonly } -; IS__CGSCC____: attributes #[[ATTR11]] = { willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR12]] = { readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR13]] = { nounwind } -; IS__CGSCC____: attributes #[[ATTR14]] = { nounwind writeonly } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn writeonly } +; CHECK: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR2]] = { readonly } +; CHECK: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; CHECK: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn writeonly } +; CHECK: attributes #[[ATTR5]] = { nofree nosync nounwind readonly willreturn } +; CHECK: attributes #[[ATTR6]] = { argmemonly nounwind readonly } +; CHECK: attributes #[[ATTR7]] = { argmemonly nounwind } +; CHECK: attributes #[[ATTR8]] = { argmemonly nofree norecurse nounwind willreturn } +; CHECK: attributes #[[ATTR9]] = { readnone } +; CHECK: attributes #[[ATTR10]] = { nounwind readonly } +; CHECK: attributes #[[ATTR11]] = { willreturn writeonly } +; CHECK: attributes #[[ATTR12]] = { readonly willreturn } +; CHECK: attributes #[[ATTR13]] = { nounwind } +; CHECK: attributes #[[ATTR14:[0-9]+]] = { nounwind writeonly } ;. diff --git a/llvm/test/Transforms/Attributor/returned.ll b/llvm/test/Transforms/Attributor/returned.ll --- a/llvm/test/Transforms/Attributor/returned.ll +++ b/llvm/test/Transforms/Attributor/returned.ll @@ -43,17 +43,11 @@ ; CHECK: @[[_ZTI1Y:[a-zA-Z0-9_$"\\.-]+]] = external dso_local constant { i8*, i8*, i8* }, align 8 ;. define i32 @sink_r0(i32 %r) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@sink_r0 -; IS__TUNIT____-SAME: (i32 returned [[R:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 [[R]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@sink_r0 -; IS__CGSCC____-SAME: (i32 returned [[R:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 [[R]] +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@sink_r0 +; CHECK-SAME: (i32 returned [[R:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 [[R]] ; entry: ret i32 %r @@ -64,15 +58,22 @@ ; IS__TUNIT____-LABEL: define {{[^@]+}}@scc_r1 ; IS__TUNIT____-SAME: (i32 [[A:%.*]], i32 returned [[R:%.*]], i32 [[B:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR6:[0-9]+]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR9:[0-9]+]] ; IS__TUNIT____-NEXT: ret i32 [[R]] ; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@scc_r1 -; IS__CGSCC____-SAME: (i32 [[A:%.*]], i32 returned [[R:%.*]], i32 [[B:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR7:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 [[R]] +; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@scc_r1 +; IS__CGSCC_OPM-SAME: (i32 [[A:%.*]], i32 returned [[R:%.*]], i32 [[B:%.*]]) #[[ATTR1:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR10:[0-9]+]] +; IS__CGSCC_OPM-NEXT: ret i32 [[R]] +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@scc_r1 +; IS__CGSCC_NPM-SAME: (i32 [[A:%.*]], i32 returned [[R:%.*]], i32 [[B:%.*]]) #[[ATTR1:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR9:[0-9]+]] +; IS__CGSCC_NPM-NEXT: ret i32 [[R]] ; entry: %call = call i32 @sink_r0(i32 %r) @@ -88,18 +89,18 @@ ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] ; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR6]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR9]] ; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] ; IS__TUNIT____: if.end: ; IS__TUNIT____-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] ; IS__TUNIT____-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] ; IS__TUNIT____: if.then3: -; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR6]] +; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR9]] ; IS__TUNIT____-NEXT: br label [[RETURN]] ; IS__TUNIT____: if.end12: ; IS__TUNIT____-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] @@ -107,7 +108,7 @@ ; IS__TUNIT____: cond.true: ; IS__TUNIT____-NEXT: br label [[COND_END:%.*]] ; IS__TUNIT____: cond.false: -; IS__TUNIT____-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR6]] +; IS__TUNIT____-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR9]] ; IS__TUNIT____-NEXT: br label [[COND_END]] ; IS__TUNIT____: cond.end: ; IS__TUNIT____-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] @@ -116,40 +117,75 @@ ; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] ; IS__TUNIT____-NEXT: ret i32 [[R]] ; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@scc_r2 -; IS__CGSCC____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 returned [[R:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] -; IS__CGSCC____: if.then3: -; IS__CGSCC____-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: if.end12: -; IS__CGSCC____-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; IS__CGSCC____: cond.true: -; IS__CGSCC____-NEXT: br label [[COND_END:%.*]] -; IS__CGSCC____: cond.false: -; IS__CGSCC____-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[COND_END]] -; IS__CGSCC____: cond.end: -; IS__CGSCC____-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] -; IS__CGSCC____-NEXT: ret i32 [[R]] +; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@scc_r2 +; IS__CGSCC_OPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 returned [[R:%.*]]) #[[ATTR1]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] +; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; IS__CGSCC_OPM: if.then: +; IS__CGSCC_OPM-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: br label [[RETURN:%.*]] +; IS__CGSCC_OPM: if.end: +; IS__CGSCC_OPM-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] +; IS__CGSCC_OPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] +; IS__CGSCC_OPM: if.then3: +; IS__CGSCC_OPM-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: br label [[RETURN]] +; IS__CGSCC_OPM: if.end12: +; IS__CGSCC_OPM-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] +; IS__CGSCC_OPM-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; IS__CGSCC_OPM: cond.true: +; IS__CGSCC_OPM-NEXT: br label [[COND_END:%.*]] +; IS__CGSCC_OPM: cond.false: +; IS__CGSCC_OPM-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: br label [[COND_END]] +; IS__CGSCC_OPM: cond.end: +; IS__CGSCC_OPM-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] +; IS__CGSCC_OPM-NEXT: br label [[RETURN]] +; IS__CGSCC_OPM: return: +; IS__CGSCC_OPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] +; IS__CGSCC_OPM-NEXT: ret i32 [[R]] +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@scc_r2 +; IS__CGSCC_NPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 returned [[R:%.*]]) #[[ATTR1]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] +; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; IS__CGSCC_NPM: if.then: +; IS__CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: br label [[RETURN:%.*]] +; IS__CGSCC_NPM: if.end: +; IS__CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] +; IS__CGSCC_NPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] +; IS__CGSCC_NPM: if.then3: +; IS__CGSCC_NPM-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: br label [[RETURN]] +; IS__CGSCC_NPM: if.end12: +; IS__CGSCC_NPM-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] +; IS__CGSCC_NPM-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; IS__CGSCC_NPM: cond.true: +; IS__CGSCC_NPM-NEXT: br label [[COND_END:%.*]] +; IS__CGSCC_NPM: cond.false: +; IS__CGSCC_NPM-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: br label [[COND_END]] +; IS__CGSCC_NPM: cond.end: +; IS__CGSCC_NPM-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] +; IS__CGSCC_NPM-NEXT: br label [[RETURN]] +; IS__CGSCC_NPM: return: +; IS__CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] +; IS__CGSCC_NPM-NEXT: ret i32 [[R]] ; entry: %cmp = icmp sgt i32 %a, %b @@ -196,25 +232,25 @@ } define i32 @scc_rX(i32 %a, i32 %b, i32 %r) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__TUNIT____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable ; IS__TUNIT____-LABEL: define {{[^@]+}}@scc_rX -; IS__TUNIT____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[R:%.*]]) #[[ATTR1]] { +; IS__TUNIT____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[R:%.*]]) #[[ATTR2:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] ; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR6]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR9]] ; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] ; IS__TUNIT____: if.end: ; IS__TUNIT____-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] ; IS__TUNIT____-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] ; IS__TUNIT____: if.then3: -; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[B]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[B]], i32 undef) #[[ATTR6]] +; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[B]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[B]], i32 undef) #[[ATTR9]] ; IS__TUNIT____-NEXT: br label [[RETURN]] ; IS__TUNIT____: if.end12: ; IS__TUNIT____-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] @@ -222,7 +258,7 @@ ; IS__TUNIT____: cond.true: ; IS__TUNIT____-NEXT: br label [[COND_END:%.*]] ; IS__TUNIT____: cond.false: -; IS__TUNIT____-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR6]] +; IS__TUNIT____-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR9]] ; IS__TUNIT____-NEXT: br label [[COND_END]] ; IS__TUNIT____: cond.end: ; IS__TUNIT____-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] @@ -231,9 +267,9 @@ ; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[B]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] ; IS__TUNIT____-NEXT: ret i32 [[RETVAL_0]] ; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@scc_rX -; IS__CGSCC____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[R:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[R:%.*]]) #[[ATTR0]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] ; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] @@ -324,17 +360,11 @@ ; return a == b ? r : ptr_scc_r2(a, b, r); ; } define double* @ptr_sink_r0(double* %r) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ptr_sink_r0 -; IS__TUNIT____-SAME: (double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret double* [[R]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ptr_sink_r0 -; IS__CGSCC____-SAME: (double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret double* [[R]] +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@ptr_sink_r0 +; CHECK-SAME: (double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret double* [[R]] ; entry: ret double* %r @@ -345,15 +375,22 @@ ; IS__TUNIT____-LABEL: define {{[^@]+}}@ptr_scc_r1 ; IS__TUNIT____-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]], double* nocapture nofree readnone [[B:%.*]]) #[[ATTR1]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] ; IS__TUNIT____-NEXT: ret double* [[R]] ; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@ptr_scc_r1 -; IS__CGSCC____-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]], double* nocapture nofree readnone [[B:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: ret double* [[R]] +; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ptr_scc_r1 +; IS__CGSCC_OPM-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]], double* nocapture nofree readnone [[B:%.*]]) #[[ATTR2:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: ret double* [[R]] +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ptr_scc_r1 +; IS__CGSCC_NPM-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]], double* nocapture nofree readnone [[B:%.*]]) #[[ATTR2:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: ret double* [[R]] ; entry: %call = call double* @ptr_sink_r0(double* %r) @@ -369,18 +406,18 @@ ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp ugt double* [[A]], [[B]] ; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] ; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] ; IS__TUNIT____: if.end: ; IS__TUNIT____-NEXT: [[CMP2:%.*]] = icmp ult double* [[A]], [[B]] ; IS__TUNIT____-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] ; IS__TUNIT____: if.then3: -; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[B]], double* noalias nocapture nofree readnone undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR6]] +; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[B]], double* noalias nocapture nofree readnone undef) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR9]] ; IS__TUNIT____-NEXT: br label [[RETURN]] ; IS__TUNIT____: if.end12: ; IS__TUNIT____-NEXT: [[CMP13:%.*]] = icmp eq double* [[A]], [[B]] @@ -388,7 +425,7 @@ ; IS__TUNIT____: cond.true: ; IS__TUNIT____-NEXT: br label [[COND_END:%.*]] ; IS__TUNIT____: cond.false: -; IS__TUNIT____-NEXT: [[CALL14:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] +; IS__TUNIT____-NEXT: [[CALL14:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] ; IS__TUNIT____-NEXT: br label [[COND_END]] ; IS__TUNIT____: cond.end: ; IS__TUNIT____-NEXT: [[COND:%.*]] = phi double* [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] @@ -397,40 +434,75 @@ ; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi double* [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] ; IS__TUNIT____-NEXT: ret double* [[R]] ; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@ptr_scc_r2 -; IS__CGSCC____-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nocapture nofree readnone [[B:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp ugt double* [[A]], [[B]] -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[CMP2:%.*]] = icmp ult double* [[A]], [[B]] -; IS__CGSCC____-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] -; IS__CGSCC____: if.then3: -; IS__CGSCC____-NEXT: [[CALL5:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[B]], double* noalias nocapture nofree readnone undef) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: if.end12: -; IS__CGSCC____-NEXT: [[CMP13:%.*]] = icmp eq double* [[A]], [[B]] -; IS__CGSCC____-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; IS__CGSCC____: cond.true: -; IS__CGSCC____-NEXT: br label [[COND_END:%.*]] -; IS__CGSCC____: cond.false: -; IS__CGSCC____-NEXT: [[CALL14:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[COND_END]] -; IS__CGSCC____: cond.end: -; IS__CGSCC____-NEXT: [[COND:%.*]] = phi double* [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi double* [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] -; IS__CGSCC____-NEXT: ret double* [[R]] +; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ptr_scc_r2 +; IS__CGSCC_OPM-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nocapture nofree readnone [[B:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR2]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp ugt double* [[A]], [[B]] +; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; IS__CGSCC_OPM: if.then: +; IS__CGSCC_OPM-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: br label [[RETURN:%.*]] +; IS__CGSCC_OPM: if.end: +; IS__CGSCC_OPM-NEXT: [[CMP2:%.*]] = icmp ult double* [[A]], [[B]] +; IS__CGSCC_OPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] +; IS__CGSCC_OPM: if.then3: +; IS__CGSCC_OPM-NEXT: [[CALL5:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[B]], double* noalias nocapture nofree readnone undef) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: br label [[RETURN]] +; IS__CGSCC_OPM: if.end12: +; IS__CGSCC_OPM-NEXT: [[CMP13:%.*]] = icmp eq double* [[A]], [[B]] +; IS__CGSCC_OPM-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; IS__CGSCC_OPM: cond.true: +; IS__CGSCC_OPM-NEXT: br label [[COND_END:%.*]] +; IS__CGSCC_OPM: cond.false: +; IS__CGSCC_OPM-NEXT: [[CALL14:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: br label [[COND_END]] +; IS__CGSCC_OPM: cond.end: +; IS__CGSCC_OPM-NEXT: [[COND:%.*]] = phi double* [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] +; IS__CGSCC_OPM-NEXT: br label [[RETURN]] +; IS__CGSCC_OPM: return: +; IS__CGSCC_OPM-NEXT: [[RETVAL_0:%.*]] = phi double* [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] +; IS__CGSCC_OPM-NEXT: ret double* [[R]] +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ptr_scc_r2 +; IS__CGSCC_NPM-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nocapture nofree readnone [[B:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR2]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp ugt double* [[A]], [[B]] +; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; IS__CGSCC_NPM: if.then: +; IS__CGSCC_NPM-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: br label [[RETURN:%.*]] +; IS__CGSCC_NPM: if.end: +; IS__CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp ult double* [[A]], [[B]] +; IS__CGSCC_NPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] +; IS__CGSCC_NPM: if.then3: +; IS__CGSCC_NPM-NEXT: [[CALL5:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[B]], double* noalias nocapture nofree readnone undef) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: br label [[RETURN]] +; IS__CGSCC_NPM: if.end12: +; IS__CGSCC_NPM-NEXT: [[CMP13:%.*]] = icmp eq double* [[A]], [[B]] +; IS__CGSCC_NPM-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; IS__CGSCC_NPM: cond.true: +; IS__CGSCC_NPM-NEXT: br label [[COND_END:%.*]] +; IS__CGSCC_NPM: cond.false: +; IS__CGSCC_NPM-NEXT: [[CALL14:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: br label [[COND_END]] +; IS__CGSCC_NPM: cond.end: +; IS__CGSCC_NPM-NEXT: [[COND:%.*]] = phi double* [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] +; IS__CGSCC_NPM-NEXT: br label [[RETURN]] +; IS__CGSCC_NPM: return: +; IS__CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi double* [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] +; IS__CGSCC_NPM-NEXT: ret double* [[R]] ; entry: %cmp = icmp ugt double* %a, %b @@ -484,19 +556,19 @@ ; } ; define i32* @rt0(i32* %a) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@rt0 -; IS__TUNIT____-SAME: (i32* nofree noundef nonnull readonly returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt0(i32* nofree noundef nonnull readonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[A]]) #[[ATTR7:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32* [[A]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@rt0 -; IS__CGSCC____-SAME: (i32* nofree noundef nonnull readonly returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @rt0(i32* nofree noundef nonnull readonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[A]]) #[[ATTR8:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32* [[A]] +; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@rt0 +; NOT_CGSCC_OPM-SAME: (i32* nofree noundef nonnull readonly returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: entry: +; NOT_CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @rt0(i32* nofree noundef nonnull readonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[A]]) #[[ATTR10:[0-9]+]] +; NOT_CGSCC_OPM-NEXT: ret i32* [[A]] +; +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@rt0 +; IS__CGSCC_OPM-SAME: (i32* nofree noundef nonnull readonly returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @rt0(i32* nofree noundef nonnull readonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[A]]) #[[ATTR11:[0-9]+]] +; IS__CGSCC_OPM-NEXT: ret i32* [[A]] ; entry: %v = load i32, i32* %a, align 4 @@ -513,17 +585,11 @@ ; } ; define i32* @rt1(i32* %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@rt1 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32* undef -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@rt1 -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32* undef +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@rt1 +; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32* undef ; entry: %v = load i32, i32* %a, align 4 @@ -540,15 +606,22 @@ ; IS__TUNIT____-LABEL: define {{[^@]+}}@rt2_helper ; IS__TUNIT____-SAME: (i32* nofree readnone returned [[A:%.*]]) #[[ATTR1]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt2(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR6]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt2(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR9]] ; IS__TUNIT____-NEXT: ret i32* [[A]] ; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@rt2_helper -; IS__CGSCC____-SAME: (i32* nofree readnone returned [[A:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @rt2(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: ret i32* [[A]] +; IS__CGSCC_OPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@rt2_helper +; IS__CGSCC_OPM-SAME: (i32* nofree readnone returned [[A:%.*]]) #[[ATTR4:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @rt2(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: ret i32* [[A]] +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@rt2_helper +; IS__CGSCC_NPM-SAME: (i32* nofree readnone returned [[A:%.*]]) #[[ATTR2]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @rt2(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: ret i32* [[A]] ; entry: %call = call i32* @rt2(i32* %a, i32* %a) @@ -563,24 +636,37 @@ ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null ; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt2_helper(i32* noalias nofree readnone [[A]]) #[[ATTR6]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt2_helper(i32* noalias nofree readnone [[A]]) #[[ATTR9]] ; IS__TUNIT____-NEXT: br label [[IF_END]] ; IS__TUNIT____: if.end: ; IS__TUNIT____-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ] ; IS__TUNIT____-NEXT: ret i32* [[SEL]] ; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@rt2 -; IS__CGSCC____-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @rt2_helper(i32* noalias nofree readnone [[A]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[IF_END]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ] -; IS__CGSCC____-NEXT: ret i32* [[SEL]] +; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@rt2 +; IS__CGSCC_OPM-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null +; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; IS__CGSCC_OPM: if.then: +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @rt2_helper(i32* noalias nofree readnone [[A]]) #[[ATTR12:[0-9]+]] +; IS__CGSCC_OPM-NEXT: br label [[IF_END]] +; IS__CGSCC_OPM: if.end: +; IS__CGSCC_OPM-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ] +; IS__CGSCC_OPM-NEXT: ret i32* [[SEL]] +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@rt2 +; IS__CGSCC_NPM-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null +; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; IS__CGSCC_NPM: if.then: +; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @rt2_helper(i32* noalias nofree readnone [[A]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: br label [[IF_END]] +; IS__CGSCC_NPM: if.end: +; IS__CGSCC_NPM-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ] +; IS__CGSCC_NPM-NEXT: ret i32* [[SEL]] ; entry: %cmp = icmp eq i32* %a, null @@ -602,15 +688,22 @@ ; IS__TUNIT____-LABEL: define {{[^@]+}}@rt3_helper ; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR6]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR9]] ; IS__TUNIT____-NEXT: ret i32* [[B]] ; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@rt3_helper -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: ret i32* [[B]] +; IS__CGSCC_OPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@rt3_helper +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR4]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: ret i32* [[B]] +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@rt3_helper +; IS__CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: ret i32* [[B]] ; entry: %call = call i32* @rt3(i32* %a, i32* %b) @@ -625,24 +718,37 @@ ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null ; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt3_helper(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR6]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt3_helper(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR9]] ; IS__TUNIT____-NEXT: br label [[IF_END]] ; IS__TUNIT____: if.end: ; IS__TUNIT____-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ] ; IS__TUNIT____-NEXT: ret i32* [[B]] ; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@rt3 -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @rt3_helper(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[IF_END]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ] -; IS__CGSCC____-NEXT: ret i32* [[B]] +; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@rt3 +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null +; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; IS__CGSCC_OPM: if.then: +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @rt3_helper(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR12]] +; IS__CGSCC_OPM-NEXT: br label [[IF_END]] +; IS__CGSCC_OPM: if.end: +; IS__CGSCC_OPM-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ] +; IS__CGSCC_OPM-NEXT: ret i32* [[B]] +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@rt3 +; IS__CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null +; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; IS__CGSCC_NPM: if.then: +; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @rt3_helper(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: br label [[IF_END]] +; IS__CGSCC_NPM: if.end: +; IS__CGSCC_NPM-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ] +; IS__CGSCC_NPM-NEXT: ret i32* [[B]] ; entry: %cmp = icmp eq i32* %a, null @@ -669,17 +775,17 @@ declare void @unknown_fn(i32* (i32*)*) #0 define i32* @calls_unknown_fn(i32* %r) #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@calls_unknown_fn -; IS__TUNIT____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: tail call void @unknown_fn(i32* (i32*)* noundef nonnull @calls_unknown_fn) #[[ATTR8:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32* [[R]] -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@calls_unknown_fn -; IS__CGSCC____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC____-NEXT: tail call void @unknown_fn(i32* (i32*)* noundef nonnull @calls_unknown_fn) #[[ATTR9:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32* [[R]] +; NOT_CGSCC_OPM: Function Attrs: noinline nounwind uwtable +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@calls_unknown_fn +; NOT_CGSCC_OPM-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: tail call void @unknown_fn(i32* (i32*)* noundef nonnull @calls_unknown_fn) #[[ATTR11:[0-9]+]] +; NOT_CGSCC_OPM-NEXT: ret i32* [[R]] +; +; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@calls_unknown_fn +; IS__CGSCC_OPM-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR5:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: tail call void @unknown_fn(i32* (i32*)* noundef nonnull @calls_unknown_fn) #[[ATTR13:[0-9]+]] +; IS__CGSCC_OPM-NEXT: ret i32* [[R]] ; tail call void @unknown_fn(i32* (i32*)* nonnull @calls_unknown_fn) ret i32* %r @@ -700,36 +806,36 @@ ; Verify the maybe-redefined function is not annotated: ; define linkonce_odr i32* @maybe_redefined_fn(i32* %r) #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@maybe_redefined_fn -; IS__TUNIT____-SAME: (i32* [[R:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32* [[R]] -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@maybe_redefined_fn -; IS__CGSCC____-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32* [[R]] +; NOT_CGSCC_OPM: Function Attrs: noinline nounwind uwtable +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@maybe_redefined_fn +; NOT_CGSCC_OPM-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_OPM-NEXT: entry: +; NOT_CGSCC_OPM-NEXT: ret i32* [[R]] +; +; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@maybe_redefined_fn +; IS__CGSCC_OPM-SAME: (i32* [[R:%.*]]) #[[ATTR5]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: ret i32* [[R]] ; entry: ret i32* %r } define i32* @calls_maybe_redefined_fn(i32* %r) #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn -; IS__TUNIT____-SAME: (i32* returned [[R:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) #[[ATTR8]] -; IS__TUNIT____-NEXT: ret i32* [[R]] -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn -; IS__CGSCC____-SAME: (i32* returned [[R:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) #[[ATTR9]] -; IS__CGSCC____-NEXT: ret i32* [[R]] +; NOT_CGSCC_OPM: Function Attrs: noinline norecurse nounwind uwtable +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn +; NOT_CGSCC_OPM-SAME: (i32* returned [[R:%.*]]) #[[ATTR5:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: entry: +; NOT_CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) #[[ATTR11]] +; NOT_CGSCC_OPM-NEXT: ret i32* [[R]] +; +; IS__CGSCC_OPM: Function Attrs: noinline norecurse nounwind uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn +; IS__CGSCC_OPM-SAME: (i32* returned [[R:%.*]]) #[[ATTR6:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) #[[ATTR13]] +; IS__CGSCC_OPM-NEXT: ret i32* [[R]] ; entry: %call = call i32* @maybe_redefined_fn(i32* %r) @@ -749,36 +855,36 @@ ; Verify the maybe-redefined function is not annotated: ; define linkonce_odr i32* @maybe_redefined_fn2(i32* %r) #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@maybe_redefined_fn2 -; IS__TUNIT____-SAME: (i32* [[R:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32* [[R]] -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@maybe_redefined_fn2 -; IS__CGSCC____-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32* [[R]] +; NOT_CGSCC_OPM: Function Attrs: noinline nounwind uwtable +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@maybe_redefined_fn2 +; NOT_CGSCC_OPM-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_OPM-NEXT: entry: +; NOT_CGSCC_OPM-NEXT: ret i32* [[R]] +; +; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@maybe_redefined_fn2 +; IS__CGSCC_OPM-SAME: (i32* [[R:%.*]]) #[[ATTR5]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: ret i32* [[R]] ; entry: ret i32* %r } define i32* @calls_maybe_redefined_fn2(i32* %r) #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2 -; IS__TUNIT____-SAME: (i32* [[R:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) #[[ATTR8]] -; IS__TUNIT____-NEXT: ret i32* [[CALL]] -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2 -; IS__CGSCC____-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) #[[ATTR9]] -; IS__CGSCC____-NEXT: ret i32* [[CALL]] +; NOT_CGSCC_OPM: Function Attrs: noinline norecurse nounwind uwtable +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2 +; NOT_CGSCC_OPM-SAME: (i32* [[R:%.*]]) #[[ATTR5]] { +; NOT_CGSCC_OPM-NEXT: entry: +; NOT_CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) #[[ATTR11]] +; NOT_CGSCC_OPM-NEXT: ret i32* [[CALL]] +; +; IS__CGSCC_OPM: Function Attrs: noinline norecurse nounwind uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2 +; IS__CGSCC_OPM-SAME: (i32* [[R:%.*]]) #[[ATTR6]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) #[[ATTR13]] +; IS__CGSCC_OPM-NEXT: ret i32* [[CALL]] ; entry: %call = call i32* @maybe_redefined_fn2(i32* %r) @@ -796,27 +902,16 @@ ; } ; define double @select_and_phi(double %b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@select_and_phi -; IS__TUNIT____-SAME: (double returned [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CMP:%.*]] = fcmp ogt double [[B]], 0.000000e+00 -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: br label [[IF_END]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: ret double [[B]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@select_and_phi -; IS__CGSCC____-SAME: (double returned [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = fcmp ogt double [[B]], 0.000000e+00 -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: br label [[IF_END]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: ret double [[B]] +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@select_and_phi +; CHECK-SAME: (double returned [[B:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt double [[B]], 0.000000e+00 +; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; CHECK: if.then: +; CHECK-NEXT: br label [[IF_END]] +; CHECK: if.end: +; CHECK-NEXT: ret double [[B]] ; entry: %cmp = fcmp ogt double %b, 0.000000e+00 @@ -851,23 +946,36 @@ ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 0 ; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) #[[ATTR6]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) #[[ATTR9]] ; IS__TUNIT____-NEXT: br label [[IF_END]] ; IS__TUNIT____: if.end: ; IS__TUNIT____-NEXT: ret double [[B]] ; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@recursion_select_and_phi -; IS__CGSCC____-SAME: (i32 [[A:%.*]], double returned [[B:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[DEC:%.*]] = add nsw i32 [[A]], -1 -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 0 -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[IF_END]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: ret double [[B]] +; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@recursion_select_and_phi +; IS__CGSCC_OPM-SAME: (i32 [[A:%.*]], double returned [[B:%.*]]) #[[ATTR2]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[DEC:%.*]] = add nsw i32 [[A]], -1 +; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 0 +; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; IS__CGSCC_OPM: if.then: +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) #[[ATTR10]] +; IS__CGSCC_OPM-NEXT: br label [[IF_END]] +; IS__CGSCC_OPM: if.end: +; IS__CGSCC_OPM-NEXT: ret double [[B]] +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@recursion_select_and_phi +; IS__CGSCC_NPM-SAME: (i32 [[A:%.*]], double returned [[B:%.*]]) #[[ATTR2]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: [[DEC:%.*]] = add nsw i32 [[A]], -1 +; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 0 +; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; IS__CGSCC_NPM: if.then: +; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: br label [[IF_END]] +; IS__CGSCC_NPM: if.end: +; IS__CGSCC_NPM-NEXT: ret double [[B]] ; entry: %dec = add nsw i32 %a, -1 @@ -893,19 +1001,12 @@ ; } ; define double* @bitcast(i32* %b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bitcast -; IS__TUNIT____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__TUNIT____-NEXT: ret double* [[BC0]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bitcast -; IS__CGSCC____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__CGSCC____-NEXT: ret double* [[BC0]] +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@bitcast +; CHECK-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; CHECK-NEXT: ret double* [[BC0]] ; entry: %bc0 = bitcast i32* %b to double* @@ -923,43 +1024,24 @@ ; } ; define double* @bitcasts_select_and_phi(i32* %b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bitcasts_select_and_phi -; IS__TUNIT____-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* -; IS__TUNIT____-NEXT: br label [[IF_END]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: [[PHI:%.*]] = phi double* [ [[BC1]], [[IF_THEN]] ], [ [[BC0]], [[ENTRY:%.*]] ] -; IS__TUNIT____-NEXT: [[BC2:%.*]] = bitcast double* [[PHI]] to i8* -; IS__TUNIT____-NEXT: [[BC3:%.*]] = bitcast i32* [[B]] to i8* -; IS__TUNIT____-NEXT: [[CMP2:%.*]] = icmp ne double* [[BC0]], null -; IS__TUNIT____-NEXT: [[SEL:%.*]] = select i1 [[CMP2]], i8* [[BC2]], i8* [[BC3]] -; IS__TUNIT____-NEXT: [[BC4:%.*]] = bitcast i8* [[SEL]] to double* -; IS__TUNIT____-NEXT: ret double* [[BC4]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bitcasts_select_and_phi -; IS__CGSCC____-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* -; IS__CGSCC____-NEXT: br label [[IF_END]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[PHI:%.*]] = phi double* [ [[BC1]], [[IF_THEN]] ], [ [[BC0]], [[ENTRY:%.*]] ] -; IS__CGSCC____-NEXT: [[BC2:%.*]] = bitcast double* [[PHI]] to i8* -; IS__CGSCC____-NEXT: [[BC3:%.*]] = bitcast i32* [[B]] to i8* -; IS__CGSCC____-NEXT: [[CMP2:%.*]] = icmp ne double* [[BC0]], null -; IS__CGSCC____-NEXT: [[SEL:%.*]] = select i1 [[CMP2]], i8* [[BC2]], i8* [[BC3]] -; IS__CGSCC____-NEXT: [[BC4:%.*]] = bitcast i8* [[SEL]] to double* -; IS__CGSCC____-NEXT: ret double* [[BC4]] +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@bitcasts_select_and_phi +; CHECK-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; CHECK-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; CHECK: if.then: +; CHECK-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* +; CHECK-NEXT: br label [[IF_END]] +; CHECK: if.end: +; CHECK-NEXT: [[PHI:%.*]] = phi double* [ [[BC1]], [[IF_THEN]] ], [ [[BC0]], [[ENTRY:%.*]] ] +; CHECK-NEXT: [[BC2:%.*]] = bitcast double* [[PHI]] to i8* +; CHECK-NEXT: [[BC3:%.*]] = bitcast i32* [[B]] to i8* +; CHECK-NEXT: [[CMP2:%.*]] = icmp ne double* [[BC0]], null +; CHECK-NEXT: [[SEL:%.*]] = select i1 [[CMP2]], i8* [[BC2]], i8* [[BC3]] +; CHECK-NEXT: [[BC4:%.*]] = bitcast i8* [[SEL]] to double* +; CHECK-NEXT: ret double* [[BC4]] ; entry: %bc0 = bitcast i32* %b to double* @@ -992,39 +1074,22 @@ ; } ; define double* @ret_arg_arg_undef(i32* %b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_arg_arg_undef -; IS__TUNIT____-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: ret_arg0: -; IS__TUNIT____-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* -; IS__TUNIT____-NEXT: ret double* [[BC1]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_ARG1:%.*]], label [[RET_UNDEF:%.*]] -; IS__TUNIT____: ret_arg1: -; IS__TUNIT____-NEXT: ret double* [[BC0]] -; IS__TUNIT____: ret_undef: -; IS__TUNIT____-NEXT: ret double* undef -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_arg_arg_undef -; IS__CGSCC____-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: ret_arg0: -; IS__CGSCC____-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* -; IS__CGSCC____-NEXT: ret double* [[BC1]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_ARG1:%.*]], label [[RET_UNDEF:%.*]] -; IS__CGSCC____: ret_arg1: -; IS__CGSCC____-NEXT: ret double* [[BC0]] -; IS__CGSCC____: ret_undef: -; IS__CGSCC____-NEXT: ret double* undef +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@ret_arg_arg_undef +; CHECK-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; CHECK-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; CHECK-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[IF_END:%.*]] +; CHECK: ret_arg0: +; CHECK-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* +; CHECK-NEXT: ret double* [[BC1]] +; CHECK: if.end: +; CHECK-NEXT: br i1 [[CMP]], label [[RET_ARG1:%.*]], label [[RET_UNDEF:%.*]] +; CHECK: ret_arg1: +; CHECK-NEXT: ret double* [[BC0]] +; CHECK: ret_undef: +; CHECK-NEXT: ret double* undef ; entry: %bc0 = bitcast i32* %b to double* @@ -1057,39 +1122,22 @@ ; } ; define double* @ret_undef_arg_arg(i32* %b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_undef_arg_arg -; IS__TUNIT____-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_UNDEF:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: ret_undef: -; IS__TUNIT____-NEXT: ret double* undef -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[RET_ARG1:%.*]] -; IS__TUNIT____: ret_arg0: -; IS__TUNIT____-NEXT: ret double* [[BC0]] -; IS__TUNIT____: ret_arg1: -; IS__TUNIT____-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* -; IS__TUNIT____-NEXT: ret double* [[BC1]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_undef_arg_arg -; IS__CGSCC____-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_UNDEF:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: ret_undef: -; IS__CGSCC____-NEXT: ret double* undef -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[RET_ARG1:%.*]] -; IS__CGSCC____: ret_arg0: -; IS__CGSCC____-NEXT: ret double* [[BC0]] -; IS__CGSCC____: ret_arg1: -; IS__CGSCC____-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* -; IS__CGSCC____-NEXT: ret double* [[BC1]] +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@ret_undef_arg_arg +; CHECK-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; CHECK-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; CHECK-NEXT: br i1 [[CMP]], label [[RET_UNDEF:%.*]], label [[IF_END:%.*]] +; CHECK: ret_undef: +; CHECK-NEXT: ret double* undef +; CHECK: if.end: +; CHECK-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[RET_ARG1:%.*]] +; CHECK: ret_arg0: +; CHECK-NEXT: ret double* [[BC0]] +; CHECK: ret_arg1: +; CHECK-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* +; CHECK-NEXT: ret double* [[BC1]] ; entry: %bc0 = bitcast i32* %b to double* @@ -1122,37 +1170,21 @@ ; } ; define double* @ret_undef_arg_undef(i32* %b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_undef_arg_undef -; IS__TUNIT____-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_UNDEF0:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: ret_undef0: -; IS__TUNIT____-NEXT: ret double* undef -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNDEF1:%.*]] -; IS__TUNIT____: ret_arg: -; IS__TUNIT____-NEXT: ret double* [[BC0]] -; IS__TUNIT____: ret_undef1: -; IS__TUNIT____-NEXT: ret double* undef -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_undef_arg_undef -; IS__CGSCC____-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_UNDEF0:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: ret_undef0: -; IS__CGSCC____-NEXT: ret double* undef -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNDEF1:%.*]] -; IS__CGSCC____: ret_arg: -; IS__CGSCC____-NEXT: ret double* [[BC0]] -; IS__CGSCC____: ret_undef1: -; IS__CGSCC____-NEXT: ret double* undef +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@ret_undef_arg_undef +; CHECK-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; CHECK-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; CHECK-NEXT: br i1 [[CMP]], label [[RET_UNDEF0:%.*]], label [[IF_END:%.*]] +; CHECK: ret_undef0: +; CHECK-NEXT: ret double* undef +; CHECK: if.end: +; CHECK-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNDEF1:%.*]] +; CHECK: ret_arg: +; CHECK-NEXT: ret double* [[BC0]] +; CHECK: ret_undef1: +; CHECK-NEXT: ret double* undef ; entry: %bc0 = bitcast i32* %b to double* @@ -1185,29 +1217,29 @@ declare i32* @unknown(i32*) define i32* @ret_arg_or_unknown(i32* %b) #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_arg_or_unknown -; IS__TUNIT____-SAME: (i32* [[B:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] -; IS__TUNIT____: ret_arg: -; IS__TUNIT____-NEXT: ret i32* [[B]] -; IS__TUNIT____: ret_unknown: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) -; IS__TUNIT____-NEXT: ret i32* [[CALL]] -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_arg_or_unknown -; IS__CGSCC____-SAME: (i32* [[B:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] -; IS__CGSCC____: ret_arg: -; IS__CGSCC____-NEXT: ret i32* [[B]] -; IS__CGSCC____: ret_unknown: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) -; IS__CGSCC____-NEXT: ret i32* [[CALL]] +; NOT_CGSCC_OPM: Function Attrs: noinline nounwind uwtable +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@ret_arg_or_unknown +; NOT_CGSCC_OPM-SAME: (i32* [[B:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_OPM-NEXT: entry: +; NOT_CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; NOT_CGSCC_OPM-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; NOT_CGSCC_OPM: ret_arg: +; NOT_CGSCC_OPM-NEXT: ret i32* [[B]] +; NOT_CGSCC_OPM: ret_unknown: +; NOT_CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) +; NOT_CGSCC_OPM-NEXT: ret i32* [[CALL]] +; +; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ret_arg_or_unknown +; IS__CGSCC_OPM-SAME: (i32* [[B:%.*]]) #[[ATTR5]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; IS__CGSCC_OPM: ret_arg: +; IS__CGSCC_OPM-NEXT: ret i32* [[B]] +; IS__CGSCC_OPM: ret_unknown: +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) +; IS__CGSCC_OPM-NEXT: ret i32* [[CALL]] ; entry: %cmp = icmp eq i32* %b, null @@ -1222,35 +1254,35 @@ } define i32* @ret_arg_or_unknown_through_phi(i32* %b) #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi -; IS__TUNIT____-SAME: (i32* [[B:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] -; IS__TUNIT____: ret_arg: -; IS__TUNIT____-NEXT: br label [[R:%.*]] -; IS__TUNIT____: ret_unknown: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) -; IS__TUNIT____-NEXT: br label [[R]] -; IS__TUNIT____: r: -; IS__TUNIT____-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ] -; IS__TUNIT____-NEXT: ret i32* [[PHI]] -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi -; IS__CGSCC____-SAME: (i32* [[B:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] -; IS__CGSCC____: ret_arg: -; IS__CGSCC____-NEXT: br label [[R:%.*]] -; IS__CGSCC____: ret_unknown: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) -; IS__CGSCC____-NEXT: br label [[R]] -; IS__CGSCC____: r: -; IS__CGSCC____-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ] -; IS__CGSCC____-NEXT: ret i32* [[PHI]] +; NOT_CGSCC_OPM: Function Attrs: noinline nounwind uwtable +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi +; NOT_CGSCC_OPM-SAME: (i32* [[B:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_OPM-NEXT: entry: +; NOT_CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; NOT_CGSCC_OPM-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; NOT_CGSCC_OPM: ret_arg: +; NOT_CGSCC_OPM-NEXT: br label [[R:%.*]] +; NOT_CGSCC_OPM: ret_unknown: +; NOT_CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) +; NOT_CGSCC_OPM-NEXT: br label [[R]] +; NOT_CGSCC_OPM: r: +; NOT_CGSCC_OPM-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ] +; NOT_CGSCC_OPM-NEXT: ret i32* [[PHI]] +; +; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi +; IS__CGSCC_OPM-SAME: (i32* [[B:%.*]]) #[[ATTR5]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; IS__CGSCC_OPM: ret_arg: +; IS__CGSCC_OPM-NEXT: br label [[R:%.*]] +; IS__CGSCC_OPM: ret_unknown: +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) +; IS__CGSCC_OPM-NEXT: br label [[R]] +; IS__CGSCC_OPM: r: +; IS__CGSCC_OPM-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ] +; IS__CGSCC_OPM-NEXT: ret i32* [[PHI]] ; entry: %cmp = icmp eq i32* %b, null @@ -1271,21 +1303,13 @@ ; TEST inconsistent IR in dead code. ; define i32 @deadblockcall1(i32 %A) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@deadblockcall1 -; IS__TUNIT____-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 [[A]] -; IS__TUNIT____: unreachableblock: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@deadblockcall1 -; IS__CGSCC____-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 [[A]] -; IS__CGSCC____: unreachableblock: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@deadblockcall1 +; CHECK-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 [[A]] +; CHECK: unreachableblock: +; CHECK-NEXT: unreachable ; entry: ret i32 %A @@ -1297,25 +1321,15 @@ declare i32 @deadblockcall_helper(i32 returned %A); define i32 @deadblockcall2(i32 %A) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@deadblockcall2 -; IS__TUNIT____-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 [[A]] -; IS__TUNIT____: unreachableblock1: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: unreachableblock2: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@deadblockcall2 -; IS__CGSCC____-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 [[A]] -; IS__CGSCC____: unreachableblock1: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: unreachableblock2: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@deadblockcall2 +; CHECK-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 [[A]] +; CHECK: unreachableblock1: +; CHECK-NEXT: unreachable +; CHECK: unreachableblock2: +; CHECK-NEXT: unreachable ; entry: ret i32 %A @@ -1328,29 +1342,17 @@ } define i32 @deadblockphi1(i32 %A) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@deadblockphi1 -; IS__TUNIT____-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[R:%.*]] -; IS__TUNIT____: unreachableblock1: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: unreachableblock2: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: r: -; IS__TUNIT____-NEXT: ret i32 [[A]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@deadblockphi1 -; IS__CGSCC____-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[R:%.*]] -; IS__CGSCC____: unreachableblock1: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: unreachableblock2: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: r: -; IS__CGSCC____-NEXT: ret i32 [[A]] +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@deadblockphi1 +; CHECK-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: br label [[R:%.*]] +; CHECK: unreachableblock1: +; CHECK-NEXT: unreachable +; CHECK: unreachableblock2: +; CHECK-NEXT: unreachable +; CHECK: r: +; CHECK-NEXT: ret i32 [[A]] ; entry: br label %r @@ -1366,33 +1368,19 @@ } define i32 @deadblockphi2(i32 %A) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@deadblockphi2 -; IS__TUNIT____-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[R:%.*]] -; IS__TUNIT____: unreachableblock1: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: unreachableblock2: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: unreachableblock3: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: r: -; IS__TUNIT____-NEXT: ret i32 [[A]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@deadblockphi2 -; IS__CGSCC____-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[R:%.*]] -; IS__CGSCC____: unreachableblock1: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: unreachableblock2: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: unreachableblock3: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: r: -; IS__CGSCC____-NEXT: ret i32 [[A]] +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@deadblockphi2 +; CHECK-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: br label [[R:%.*]] +; CHECK: unreachableblock1: +; CHECK-NEXT: unreachable +; CHECK: unreachableblock2: +; CHECK-NEXT: unreachable +; CHECK: unreachableblock3: +; CHECK-NEXT: unreachable +; CHECK: r: +; CHECK-NEXT: ret i32 [[A]] ; entry: br label %r @@ -1413,35 +1401,35 @@ declare void @noreturn() noreturn; define i32 @deadblockphi3(i32 %A, i1 %c) #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@deadblockphi3 -; IS__TUNIT____-SAME: (i32 returned [[A:%.*]], i1 [[C:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] -; IS__TUNIT____: unreachablecall: -; IS__TUNIT____-NEXT: call void @noreturn() #[[ATTR4:[0-9]+]] -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: unreachableblock2: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: unreachableblock3: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: r: -; IS__TUNIT____-NEXT: ret i32 [[A]] -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@deadblockphi3 -; IS__CGSCC____-SAME: (i32 returned [[A:%.*]], i1 [[C:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] -; IS__CGSCC____: unreachablecall: -; IS__CGSCC____-NEXT: call void @noreturn() #[[ATTR5:[0-9]+]] -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: unreachableblock2: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: unreachableblock3: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: r: -; IS__CGSCC____-NEXT: ret i32 [[A]] +; NOT_CGSCC_OPM: Function Attrs: noinline nounwind uwtable +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@deadblockphi3 +; NOT_CGSCC_OPM-SAME: (i32 returned [[A:%.*]], i1 [[C:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_OPM-NEXT: entry: +; NOT_CGSCC_OPM-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] +; NOT_CGSCC_OPM: unreachablecall: +; NOT_CGSCC_OPM-NEXT: call void @noreturn() #[[ATTR6:[0-9]+]] +; NOT_CGSCC_OPM-NEXT: unreachable +; NOT_CGSCC_OPM: unreachableblock2: +; NOT_CGSCC_OPM-NEXT: unreachable +; NOT_CGSCC_OPM: unreachableblock3: +; NOT_CGSCC_OPM-NEXT: unreachable +; NOT_CGSCC_OPM: r: +; NOT_CGSCC_OPM-NEXT: ret i32 [[A]] +; +; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@deadblockphi3 +; IS__CGSCC_OPM-SAME: (i32 returned [[A:%.*]], i1 [[C:%.*]]) #[[ATTR5]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] +; IS__CGSCC_OPM: unreachablecall: +; IS__CGSCC_OPM-NEXT: call void @noreturn() #[[ATTR7:[0-9]+]] +; IS__CGSCC_OPM-NEXT: unreachable +; IS__CGSCC_OPM: unreachableblock2: +; IS__CGSCC_OPM-NEXT: unreachable +; IS__CGSCC_OPM: unreachableblock3: +; IS__CGSCC_OPM-NEXT: unreachable +; IS__CGSCC_OPM: r: +; IS__CGSCC_OPM-NEXT: ret i32 [[A]] ; entry: br i1 %c, label %r, label %unreachablecall @@ -1499,20 +1487,37 @@ ; We can use the return information of the weak function non_exact_4. ; FIXME: %c2 and %c3 should be replaced but not %c0 or %c1! define i32 @exact(i32* align 8 %a, i32* align 8 %b) { -; CHECK-LABEL: define {{[^@]+}}@exact -; CHECK-SAME: (i32* align 8 [[A:%.*]], i32* align 8 [[B:%.*]]) { -; CHECK-NEXT: [[C0:%.*]] = call i32 @non_exact_0() -; CHECK-NEXT: [[C1:%.*]] = call i32 @non_exact_1(i32 noundef 1) -; CHECK-NEXT: [[C2:%.*]] = call i32 @non_exact_2(i32 noundef 2) -; CHECK-NEXT: [[C3:%.*]] = call align 32 i32* @non_exact_3(i32* align 32 [[A]]) -; CHECK-NEXT: [[C4:%.*]] = call align 16 i32* @non_exact_4(i32* align 32 [[B]]) -; CHECK-NEXT: [[C3L:%.*]] = load i32, i32* [[A]], align 32 -; CHECK-NEXT: [[C4L:%.*]] = load i32, i32* [[C4]], align 16 -; CHECK-NEXT: [[ADD1:%.*]] = add i32 [[C0]], [[C1]] -; CHECK-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], 2 -; CHECK-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[C3L]] -; CHECK-NEXT: [[ADD4:%.*]] = add i32 [[ADD3]], [[C4L]] -; CHECK-NEXT: ret i32 [[ADD4]] +; NOT_CGSCC_OPM: Function Attrs: norecurse +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@exact +; NOT_CGSCC_OPM-SAME: (i32* align 8 [[A:%.*]], i32* align 8 [[B:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: [[C0:%.*]] = call i32 @non_exact_0() +; NOT_CGSCC_OPM-NEXT: [[C1:%.*]] = call i32 @non_exact_1(i32 noundef 1) +; NOT_CGSCC_OPM-NEXT: [[C2:%.*]] = call i32 @non_exact_2(i32 noundef 2) +; NOT_CGSCC_OPM-NEXT: [[C3:%.*]] = call align 32 i32* @non_exact_3(i32* align 32 [[A]]) +; NOT_CGSCC_OPM-NEXT: [[C4:%.*]] = call align 16 i32* @non_exact_4(i32* align 32 [[B]]) +; NOT_CGSCC_OPM-NEXT: [[C3L:%.*]] = load i32, i32* [[A]], align 32 +; NOT_CGSCC_OPM-NEXT: [[C4L:%.*]] = load i32, i32* [[C4]], align 16 +; NOT_CGSCC_OPM-NEXT: [[ADD1:%.*]] = add i32 [[C0]], [[C1]] +; NOT_CGSCC_OPM-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], 2 +; NOT_CGSCC_OPM-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[C3L]] +; NOT_CGSCC_OPM-NEXT: [[ADD4:%.*]] = add i32 [[ADD3]], [[C4L]] +; NOT_CGSCC_OPM-NEXT: ret i32 [[ADD4]] +; +; IS__CGSCC_OPM: Function Attrs: norecurse +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@exact +; IS__CGSCC_OPM-SAME: (i32* align 8 [[A:%.*]], i32* align 8 [[B:%.*]]) #[[ATTR8:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: [[C0:%.*]] = call i32 @non_exact_0() +; IS__CGSCC_OPM-NEXT: [[C1:%.*]] = call i32 @non_exact_1(i32 noundef 1) +; IS__CGSCC_OPM-NEXT: [[C2:%.*]] = call i32 @non_exact_2(i32 noundef 2) +; IS__CGSCC_OPM-NEXT: [[C3:%.*]] = call align 32 i32* @non_exact_3(i32* align 32 [[A]]) +; IS__CGSCC_OPM-NEXT: [[C4:%.*]] = call align 16 i32* @non_exact_4(i32* align 32 [[B]]) +; IS__CGSCC_OPM-NEXT: [[C3L:%.*]] = load i32, i32* [[A]], align 32 +; IS__CGSCC_OPM-NEXT: [[C4L:%.*]] = load i32, i32* [[C4]], align 16 +; IS__CGSCC_OPM-NEXT: [[ADD1:%.*]] = add i32 [[C0]], [[C1]] +; IS__CGSCC_OPM-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], 2 +; IS__CGSCC_OPM-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[C3L]] +; IS__CGSCC_OPM-NEXT: [[ADD4:%.*]] = add i32 [[ADD3]], [[C4L]] +; IS__CGSCC_OPM-NEXT: ret i32 [[ADD4]] ; %c0 = call i32 @non_exact_0() %c1 = call i32 @non_exact_1(i32 1) @@ -1530,43 +1535,28 @@ @G = external global i8 define i32* @ret_const() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_const -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* bitcast (i8* @G to i32*) -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_const -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* bitcast (i8* @G to i32*) +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@ret_const +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i32* bitcast (i8* @G to i32*) ; %bc = bitcast i8* @G to i32* ret i32* %bc } define i32* @use_const() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@use_const -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* bitcast (i8* @G to i32*) -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@use_const -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* bitcast (i8* @G to i32*) +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@use_const +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i32* bitcast (i8* @G to i32*) ; %c = call i32* @ret_const() ret i32* %c } define i32* @dont_use_const() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@dont_use_const -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* bitcast (i8* @G to i32*) -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@dont_use_const -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* bitcast (i8* @G to i32*) +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@dont_use_const +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i32* bitcast (i8* @G to i32*) ; %c = musttail call i32* @ret_const() ret i32* %c @@ -1617,25 +1607,47 @@ attributes #0 = { noinline nounwind uwtable } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } ; IS__TUNIT____: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } -; IS__TUNIT____: attributes #[[ATTR2]] = { argmemonly nofree noinline nosync nounwind readonly uwtable } -; IS__TUNIT____: attributes #[[ATTR3]] = { noinline nounwind uwtable } -; IS__TUNIT____: attributes #[[ATTR4]] = { noreturn } -; IS__TUNIT____: attributes #[[ATTR5:[0-9]+]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR6]] = { nofree nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR7]] = { nofree nosync nounwind readonly } -; IS__TUNIT____: attributes #[[ATTR8]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR9:[0-9]+]] = { nounwind readnone } +; IS__TUNIT____: attributes #[[ATTR2]] = { nofree noinline norecurse nosync nounwind readnone uwtable } +; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree noinline nosync nounwind readonly uwtable } +; IS__TUNIT____: attributes #[[ATTR4]] = { noinline nounwind uwtable } +; IS__TUNIT____: attributes #[[ATTR5]] = { noinline norecurse nounwind uwtable } +; IS__TUNIT____: attributes #[[ATTR6]] = { noreturn } +; IS__TUNIT____: attributes #[[ATTR7]] = { norecurse } +; IS__TUNIT____: attributes #[[ATTR8:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR9]] = { nofree nosync nounwind readnone } +; IS__TUNIT____: attributes #[[ATTR10]] = { nofree nosync nounwind readonly } +; IS__TUNIT____: attributes #[[ATTR11]] = { nounwind } +; IS__TUNIT____: attributes #[[ATTR12:[0-9]+]] = { nounwind readnone } +;. +; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree noinline nosync nounwind readnone uwtable } +; IS__CGSCC_OPM: attributes #[[ATTR3]] = { argmemonly nofree noinline nosync nounwind readonly uwtable } +; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nofree noinline norecurse nosync nounwind readnone uwtable } +; IS__CGSCC_OPM: attributes #[[ATTR5]] = { noinline nounwind uwtable } +; IS__CGSCC_OPM: attributes #[[ATTR6]] = { noinline norecurse nounwind uwtable } +; IS__CGSCC_OPM: attributes #[[ATTR7]] = { noreturn } +; IS__CGSCC_OPM: attributes #[[ATTR8]] = { norecurse } +; IS__CGSCC_OPM: attributes #[[ATTR9:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR10]] = { nofree nosync nounwind readnone } +; IS__CGSCC_OPM: attributes #[[ATTR11]] = { nofree nosync nounwind readonly } +; IS__CGSCC_OPM: attributes #[[ATTR12]] = { nofree norecurse nosync nounwind readnone } +; IS__CGSCC_OPM: attributes #[[ATTR13]] = { nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR14:[0-9]+]] = { nounwind readnone } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { nofree noinline nosync nounwind readnone uwtable } -; IS__CGSCC____: attributes #[[ATTR3]] = { argmemonly nofree noinline nosync nounwind readonly uwtable } -; IS__CGSCC____: attributes #[[ATTR4]] = { noinline nounwind uwtable } -; IS__CGSCC____: attributes #[[ATTR5]] = { noreturn } -; IS__CGSCC____: attributes #[[ATTR6:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR7]] = { nofree nosync nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR8]] = { nofree nosync nounwind readonly } -; IS__CGSCC____: attributes #[[ATTR9]] = { nounwind } +; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree noinline nosync nounwind readnone uwtable } +; IS__CGSCC_NPM: attributes #[[ATTR3]] = { argmemonly nofree noinline nosync nounwind readonly uwtable } +; IS__CGSCC_NPM: attributes #[[ATTR4]] = { noinline nounwind uwtable } +; IS__CGSCC_NPM: attributes #[[ATTR5]] = { noinline norecurse nounwind uwtable } +; IS__CGSCC_NPM: attributes #[[ATTR6]] = { noreturn } +; IS__CGSCC_NPM: attributes #[[ATTR7]] = { norecurse } +; IS__CGSCC_NPM: attributes #[[ATTR8:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR9]] = { nofree nosync nounwind readnone } +; IS__CGSCC_NPM: attributes #[[ATTR10]] = { nofree nosync nounwind readonly } +; IS__CGSCC_NPM: attributes #[[ATTR11]] = { nounwind } +; IS__CGSCC_NPM: attributes #[[ATTR12:[0-9]+]] = { nounwind readnone } ;. diff --git a/llvm/test/Transforms/Attributor/undefined_behavior.ll b/llvm/test/Transforms/Attributor/undefined_behavior.ll --- a/llvm/test/Transforms/Attributor/undefined_behavior.ll +++ b/llvm/test/Transforms/Attributor/undefined_behavior.ll @@ -13,30 +13,20 @@ ; -- Load tests -- define void @load_wholly_unreachable() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@load_wholly_unreachable -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@load_wholly_unreachable -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@load_wholly_unreachable +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: unreachable ; %a = load i32, i32* null ret void } define void @loads_wholly_unreachable() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@loads_wholly_unreachable -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@loads_wholly_unreachable -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@loads_wholly_unreachable +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: unreachable ; %a = load i32, i32* null %b = load i32, i32* null @@ -45,23 +35,14 @@ define void @load_single_bb_unreachable(i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@load_single_bb_unreachable -; IS__TUNIT____-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@load_single_bb_unreachable -; IS__CGSCC____-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@load_single_bb_unreachable +; CHECK-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; CHECK: t: +; CHECK-NEXT: unreachable +; CHECK: e: +; CHECK-NEXT: ret void ; br i1 %cond, label %t, label %e t: @@ -74,15 +55,10 @@ ; Note that while the load is removed (because it's unused), the block ; is not changed to unreachable define void @load_null_pointer_is_defined() null_pointer_is_valid { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind null_pointer_is_valid readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@load_null_pointer_is_defined -; IS__TUNIT____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@load_null_pointer_is_defined -; IS__CGSCC____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@load_null_pointer_is_defined +; CHECK-SAME: () #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: ret void ; %a = load i32, i32* null ret void @@ -98,15 +74,10 @@ } define void @load_null_propagated() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@load_null_propagated -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@load_null_propagated -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@load_null_propagated +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: unreachable ; %ptr = call i32* @ret_null() %a = load i32, i32* %ptr @@ -116,55 +87,35 @@ ; -- Store tests -- define void @store_wholly_unreachable() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@store_wholly_unreachable -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@store_wholly_unreachable -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@store_wholly_unreachable +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: unreachable ; store i32 5, i32* null ret void } define void @store_wholly_unreachable_volatile() { -; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@store_wholly_unreachable_volatile -; IS__TUNIT____-SAME: () #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: store volatile i32 5, i32* null, align 4294967296 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@store_wholly_unreachable_volatile -; IS__CGSCC____-SAME: () #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: store volatile i32 5, i32* null, align 4294967296 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@store_wholly_unreachable_volatile +; CHECK-SAME: () #[[ATTR2:[0-9]+]] { +; CHECK-NEXT: store volatile i32 5, i32* null, align 4294967296 +; CHECK-NEXT: ret void ; store volatile i32 5, i32* null ret void } define void @store_single_bb_unreachable(i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@store_single_bb_unreachable -; IS__TUNIT____-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@store_single_bb_unreachable -; IS__CGSCC____-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@store_single_bb_unreachable +; CHECK-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; CHECK: t: +; CHECK-NEXT: unreachable +; CHECK: e: +; CHECK-NEXT: ret void ; br i1 %cond, label %t, label %e t: @@ -175,17 +126,11 @@ } define void @store_null_pointer_is_defined() null_pointer_is_valid { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind null_pointer_is_valid willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@store_null_pointer_is_defined -; IS__TUNIT____-SAME: () #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: store i32 5, i32* null, align 4294967296 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@store_null_pointer_is_defined -; IS__CGSCC____-SAME: () #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 5, i32* null, align 4294967296 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@store_null_pointer_is_defined +; CHECK-SAME: () #[[ATTR3:[0-9]+]] { +; CHECK-NEXT: store i32 5, i32* null, align 4294967296 +; CHECK-NEXT: ret void ; store i32 5, i32* null ret void @@ -195,15 +140,10 @@ ; ATTRIBUTOR-LABEL: @store_null_propagated( ; ATTRIBUTOR-NEXT: unreachable ; -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@store_null_propagated -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@store_null_propagated -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@store_null_propagated +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: unreachable ; %ptr = call i32* @ret_null() store i32 5, i32* %ptr @@ -213,38 +153,24 @@ ; -- AtomicRMW tests -- define void @atomicrmw_wholly_unreachable() { -; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomicrmw_wholly_unreachable -; IS__TUNIT____-SAME: () #[[ATTR2]] { -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomicrmw_wholly_unreachable -; IS__CGSCC____-SAME: () #[[ATTR2]] { -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@atomicrmw_wholly_unreachable +; CHECK-SAME: () #[[ATTR2]] { +; CHECK-NEXT: unreachable ; %a = atomicrmw add i32* null, i32 1 acquire ret void } define void @atomicrmw_single_bb_unreachable(i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomicrmw_single_bb_unreachable -; IS__TUNIT____-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomicrmw_single_bb_unreachable -; IS__CGSCC____-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@atomicrmw_single_bb_unreachable +; CHECK-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; CHECK: t: +; CHECK-NEXT: unreachable +; CHECK: e: +; CHECK-NEXT: ret void ; br i1 %cond, label %t, label %e t: @@ -255,17 +181,11 @@ } define void @atomicrmw_null_pointer_is_defined() null_pointer_is_valid { -; IS__TUNIT____: Function Attrs: nofree nounwind null_pointer_is_valid willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomicrmw_null_pointer_is_defined -; IS__TUNIT____-SAME: () #[[ATTR4:[0-9]+]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = atomicrmw add i32* null, i32 1 acquire, align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind null_pointer_is_valid willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomicrmw_null_pointer_is_defined -; IS__CGSCC____-SAME: () #[[ATTR4:[0-9]+]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = atomicrmw add i32* null, i32 1 acquire, align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nounwind null_pointer_is_valid willreturn +; CHECK-LABEL: define {{[^@]+}}@atomicrmw_null_pointer_is_defined +; CHECK-SAME: () #[[ATTR4:[0-9]+]] { +; CHECK-NEXT: [[A:%.*]] = atomicrmw add i32* null, i32 1 acquire, align 4 +; CHECK-NEXT: ret void ; %a = atomicrmw add i32* null, i32 1 acquire ret void @@ -275,15 +195,10 @@ ; ATTRIBUTOR-LABEL: @atomicrmw_null_propagated( ; ATTRIBUTOR-NEXT: unreachable ; -; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomicrmw_null_propagated -; IS__TUNIT____-SAME: () #[[ATTR2]] { -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomicrmw_null_propagated -; IS__CGSCC____-SAME: () #[[ATTR2]] { -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@atomicrmw_null_propagated +; CHECK-SAME: () #[[ATTR2]] { +; CHECK-NEXT: unreachable ; %ptr = call i32* @ret_null() %a = atomicrmw add i32* %ptr, i32 1 acquire @@ -293,38 +208,24 @@ ; -- AtomicCmpXchg tests -- define void @atomiccmpxchg_wholly_unreachable() { -; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomiccmpxchg_wholly_unreachable -; IS__TUNIT____-SAME: () #[[ATTR2]] { -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomiccmpxchg_wholly_unreachable -; IS__CGSCC____-SAME: () #[[ATTR2]] { -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@atomiccmpxchg_wholly_unreachable +; CHECK-SAME: () #[[ATTR2]] { +; CHECK-NEXT: unreachable ; %a = cmpxchg i32* null, i32 2, i32 3 acq_rel monotonic ret void } define void @atomiccmpxchg_single_bb_unreachable(i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomiccmpxchg_single_bb_unreachable -; IS__TUNIT____-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomiccmpxchg_single_bb_unreachable -; IS__CGSCC____-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@atomiccmpxchg_single_bb_unreachable +; CHECK-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { +; CHECK-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; CHECK: t: +; CHECK-NEXT: unreachable +; CHECK: e: +; CHECK-NEXT: ret void ; br i1 %cond, label %t, label %e t: @@ -335,17 +236,11 @@ } define void @atomiccmpxchg_null_pointer_is_defined() null_pointer_is_valid { -; IS__TUNIT____: Function Attrs: nofree nounwind null_pointer_is_valid willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomiccmpxchg_null_pointer_is_defined -; IS__TUNIT____-SAME: () #[[ATTR4]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = cmpxchg i32* null, i32 2, i32 3 acq_rel monotonic, align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind null_pointer_is_valid willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomiccmpxchg_null_pointer_is_defined -; IS__CGSCC____-SAME: () #[[ATTR4]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = cmpxchg i32* null, i32 2, i32 3 acq_rel monotonic, align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nounwind null_pointer_is_valid willreturn +; CHECK-LABEL: define {{[^@]+}}@atomiccmpxchg_null_pointer_is_defined +; CHECK-SAME: () #[[ATTR4]] { +; CHECK-NEXT: [[A:%.*]] = cmpxchg i32* null, i32 2, i32 3 acq_rel monotonic, align 4 +; CHECK-NEXT: ret void ; %a = cmpxchg i32* null, i32 2, i32 3 acq_rel monotonic ret void @@ -355,15 +250,10 @@ ; ATTRIBUTOR-LABEL: @atomiccmpxchg_null_propagated( ; ATTRIBUTOR-NEXT: unreachable ; -; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomiccmpxchg_null_propagated -; IS__TUNIT____-SAME: () #[[ATTR2]] { -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomiccmpxchg_null_propagated -; IS__CGSCC____-SAME: () #[[ATTR2]] { -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@atomiccmpxchg_null_propagated +; CHECK-SAME: () #[[ATTR2]] { +; CHECK-NEXT: unreachable ; %ptr = call i32* @ret_null() %a = cmpxchg i32* %ptr, i32 2, i32 3 acq_rel monotonic @@ -375,23 +265,14 @@ ; Note: The unreachable on %t and %e is _not_ from AAUndefinedBehavior define i32 @cond_br_on_undef() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cond_br_on_undef -; IS__TUNIT____-SAME: () #[[ATTR5:[0-9]+]] { -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cond_br_on_undef -; IS__CGSCC____-SAME: () #[[ATTR5:[0-9]+]] { -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@cond_br_on_undef +; CHECK-SAME: () #[[ATTR5:[0-9]+]] { +; CHECK-NEXT: unreachable +; CHECK: t: +; CHECK-NEXT: unreachable +; CHECK: e: +; CHECK-NEXT: unreachable ; br i1 undef, label %t, label %e t: @@ -404,31 +285,18 @@ ; Valid branch - verify that this is not converted ; to unreachable. define void @cond_br_on_undef2(i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cond_br_on_undef2 -; IS__TUNIT____-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[T1:%.*]], label [[E1:%.*]] -; IS__TUNIT____: t1: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: t2: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e2: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e1: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cond_br_on_undef2 -; IS__CGSCC____-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[T1:%.*]], label [[E1:%.*]] -; IS__CGSCC____: t1: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: t2: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e2: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e1: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@cond_br_on_undef2 +; CHECK-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: br i1 [[COND]], label [[T1:%.*]], label [[E1:%.*]] +; CHECK: t1: +; CHECK-NEXT: unreachable +; CHECK: t2: +; CHECK-NEXT: unreachable +; CHECK: e2: +; CHECK-NEXT: unreachable +; CHECK: e1: +; CHECK-NEXT: ret void ; br i1 %cond, label %t1, label %e1 t1: @@ -442,37 +310,23 @@ } define i1 @ret_undef() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_undef -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i1 undef -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_undef -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 undef +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@ret_undef +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i1 undef ; ret i1 undef } define void @cond_br_on_undef_interproc() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc -; IS__TUNIT____-SAME: () #[[ATTR5]] { -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc -; IS__CGSCC____-SAME: () #[[ATTR5]] { -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc +; CHECK-SAME: () #[[ATTR5]] { +; CHECK-NEXT: unreachable +; CHECK: t: +; CHECK-NEXT: unreachable +; CHECK: e: +; CHECK-NEXT: unreachable ; %cond = call i1 @ret_undef() br i1 %cond, label %t, label %e @@ -483,23 +337,14 @@ } define i1 @ret_undef2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_undef2 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: br i1 true, label [[T:%.*]], label [[E:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: ret i1 undef -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_undef2 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: br i1 true, label [[T:%.*]], label [[E:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i1 undef -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@ret_undef2 +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: br i1 true, label [[T:%.*]], label [[E:%.*]] +; CHECK: t: +; CHECK-NEXT: ret i1 undef +; CHECK: e: +; CHECK-NEXT: unreachable ; br i1 true, label %t, label %e t: @@ -510,23 +355,14 @@ ; More complicated interproc deduction of undef define void @cond_br_on_undef_interproc2() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc2 -; IS__TUNIT____-SAME: () #[[ATTR5]] { -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc2 -; IS__CGSCC____-SAME: () #[[ATTR5]] { -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc2 +; CHECK-SAME: () #[[ATTR5]] { +; CHECK-NEXT: unreachable +; CHECK: t: +; CHECK-NEXT: unreachable +; CHECK: e: +; CHECK-NEXT: unreachable ; %cond = call i1 @ret_undef2() br i1 %cond, label %t, label %e @@ -539,23 +375,14 @@ ; Branch on undef that depends on propagation of ; undef of a previous instruction. define i32 @cond_br_on_undef3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cond_br_on_undef3 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: br label [[T:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: ret i32 1 -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cond_br_on_undef3 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: br label [[T:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i32 1 -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@cond_br_on_undef3 +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: br label [[T:%.*]] +; CHECK: t: +; CHECK-NEXT: ret i32 1 +; CHECK: e: +; CHECK-NEXT: unreachable ; %cond = icmp ne i32 1, undef br i1 %cond, label %t, label %e @@ -568,23 +395,14 @@ ; Branch on undef because of uninitialized value. ; FIXME: Currently it doesn't propagate the undef. define i32 @cond_br_on_undef_uninit() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cond_br_on_undef_uninit -; IS__TUNIT____-SAME: () #[[ATTR5]] { -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cond_br_on_undef_uninit -; IS__CGSCC____-SAME: () #[[ATTR5]] { -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@cond_br_on_undef_uninit +; CHECK-SAME: () #[[ATTR5]] { +; CHECK-NEXT: unreachable +; CHECK: t: +; CHECK-NEXT: unreachable +; CHECK: e: +; CHECK-NEXT: unreachable ; %alloc = alloca i1 %cond = load i1, i1* %alloc @@ -623,15 +441,10 @@ } define i32 @foo() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 1 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 1 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@foo +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i32 1 ; %X = call i32 @callee(i1 false, i32* null) ret i32 %X @@ -642,67 +455,41 @@ ; Tests for argument position define void @arg_nonnull_1(i32* nonnull %a) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_1 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_1 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@arg_nonnull_1 +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6:[0-9]+]] { +; CHECK-NEXT: store i32 0, i32* [[A]], align 4 +; CHECK-NEXT: ret void ; store i32 0, i32* %a ret void } define void @arg_nonnull_1_noundef_1(i32* nonnull noundef %a) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_1_noundef_1 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6]] { -; IS__TUNIT____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_1_noundef_1 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6]] { -; IS__CGSCC____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@arg_nonnull_1_noundef_1 +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6]] { +; CHECK-NEXT: store i32 0, i32* [[A]], align 4 +; CHECK-NEXT: ret void ; store i32 0, i32* %a ret void } define void @arg_nonnull_12(i32* nonnull %a, i32* nonnull %b, i32* %c) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_12 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { -; IS__TUNIT____-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null -; IS__TUNIT____-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: br label [[RET:%.*]] -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: store i32 1, i32* [[B]], align 4 -; IS__TUNIT____-NEXT: br label [[RET]] -; IS__TUNIT____: ret: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_12 -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { -; IS__CGSCC____-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null -; IS__CGSCC____-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: br label [[RET:%.*]] -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: store i32 1, i32* [[B]], align 4 -; IS__CGSCC____-NEXT: br label [[RET]] -; IS__CGSCC____: ret: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@arg_nonnull_12 +; CHECK-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { +; CHECK-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null +; CHECK-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] +; CHECK: t: +; CHECK-NEXT: store i32 0, i32* [[A]], align 4 +; CHECK-NEXT: br label [[RET:%.*]] +; CHECK: f: +; CHECK-NEXT: store i32 1, i32* [[B]], align 4 +; CHECK-NEXT: br label [[RET]] +; CHECK: ret: +; CHECK-NEXT: ret void ; %d = icmp eq i32* %c, null br i1 %d, label %t, label %f @@ -717,33 +504,19 @@ } define void @arg_nonnull_12_noundef_2(i32* nonnull %a, i32* noundef nonnull %b, i32* %c) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_12_noundef_2 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree noundef nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { -; IS__TUNIT____-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null -; IS__TUNIT____-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: br label [[RET:%.*]] -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: store i32 1, i32* [[B]], align 4 -; IS__TUNIT____-NEXT: br label [[RET]] -; IS__TUNIT____: ret: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_12_noundef_2 -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree noundef nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { -; IS__CGSCC____-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null -; IS__CGSCC____-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: br label [[RET:%.*]] -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: store i32 1, i32* [[B]], align 4 -; IS__CGSCC____-NEXT: br label [[RET]] -; IS__CGSCC____: ret: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@arg_nonnull_12_noundef_2 +; CHECK-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree noundef nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { +; CHECK-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null +; CHECK-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] +; CHECK: t: +; CHECK-NEXT: store i32 0, i32* [[A]], align 4 +; CHECK-NEXT: br label [[RET:%.*]] +; CHECK: f: +; CHECK-NEXT: store i32 1, i32* [[B]], align 4 +; CHECK-NEXT: br label [[RET]] +; CHECK: ret: +; CHECK-NEXT: ret void ; %d = icmp eq i32* %c, null br i1 %d, label %t, label %f @@ -759,30 +532,20 @@ ; Pass null directly to argument with nonnull attribute define void @arg_nonnull_violation1_1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_violation1_1 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_violation1_1 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@arg_nonnull_violation1_1 +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: unreachable ; call void @arg_nonnull_1(i32* null) ret void } define void @arg_nonnull_violation1_2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_violation1_2 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_violation1_2 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@arg_nonnull_violation1_2 +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: unreachable ; call void @arg_nonnull_1_noundef_1(i32* null) ret void @@ -790,15 +553,10 @@ ; A case that depends on value simplification define void @arg_nonnull_violation2_1(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_violation2_1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_violation2_1 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@arg_nonnull_violation2_1 +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: unreachable ; %null = getelementptr i32, i32* null, i32 0 %mustnull = select i1 %c, i32* null, i32* %null @@ -807,15 +565,10 @@ } define void @arg_nonnull_violation2_2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_violation2_2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_violation2_2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@arg_nonnull_violation2_2 +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: unreachable ; %null = getelementptr i32, i32* null, i32 0 %mustnull = select i1 %c, i32* null, i32* %null @@ -825,33 +578,19 @@ ; Cases for single and multiple violation at a callsite define void @arg_nonnull_violation3_1(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_violation3_1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7:[0-9]+]] -; IS__TUNIT____-NEXT: call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR7]] -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: ret: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_violation3_1 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7:[0-9]+]] -; IS__CGSCC____-NEXT: call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR7]] -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: ret: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@arg_nonnull_violation3_1 +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CHECK: t: +; CHECK-NEXT: call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7:[0-9]+]] +; CHECK-NEXT: call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR7]] +; CHECK-NEXT: unreachable +; CHECK: f: +; CHECK-NEXT: unreachable +; CHECK: ret: +; CHECK-NEXT: ret void ; %ptr = alloca i32 br i1 %c, label %t, label %f @@ -872,33 +611,19 @@ } define void @arg_nonnull_violation3_2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_violation3_2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7]] -; IS__TUNIT____-NEXT: call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR7]] -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: ret: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_violation3_2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR7]] -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: ret: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@arg_nonnull_violation3_2 +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CHECK: t: +; CHECK-NEXT: call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7]] +; CHECK-NEXT: call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR7]] +; CHECK-NEXT: unreachable +; CHECK: f: +; CHECK-NEXT: unreachable +; CHECK: ret: +; CHECK-NEXT: ret void ; %ptr = alloca i32 br i1 %c, label %t, label %f @@ -921,35 +646,20 @@ ; Tests for returned position define nonnull i32* @returned_nonnnull(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@returned_nonnnull -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ -; IS__TUNIT____-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__TUNIT____-NEXT: i32 1, label [[ONONE:%.*]] -; IS__TUNIT____-NEXT: ] -; IS__TUNIT____: onzero: -; IS__TUNIT____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: ret i32* [[PTR]] -; IS__TUNIT____: onone: -; IS__TUNIT____-NEXT: ret i32* null -; IS__TUNIT____: ondefault: -; IS__TUNIT____-NEXT: ret i32* undef -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@returned_nonnnull -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ -; IS__CGSCC____-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__CGSCC____-NEXT: i32 1, label [[ONONE:%.*]] -; IS__CGSCC____-NEXT: ] -; IS__CGSCC____: onzero: -; IS__CGSCC____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: ret i32* [[PTR]] -; IS__CGSCC____: onone: -; IS__CGSCC____-NEXT: ret i32* null -; IS__CGSCC____: ondefault: -; IS__CGSCC____-NEXT: ret i32* undef +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@returned_nonnnull +; CHECK-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ +; CHECK-NEXT: i32 0, label [[ONZERO:%.*]] +; CHECK-NEXT: i32 1, label [[ONONE:%.*]] +; CHECK-NEXT: ] +; CHECK: onzero: +; CHECK-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; CHECK-NEXT: ret i32* [[PTR]] +; CHECK: onone: +; CHECK-NEXT: ret i32* null +; CHECK: ondefault: +; CHECK-NEXT: ret i32* undef ; switch i32 %c, label %ondefault [ i32 0, label %onzero i32 1, label %onone ] @@ -963,35 +673,20 @@ } define noundef i32* @returned_noundef(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@returned_noundef -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ -; IS__TUNIT____-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__TUNIT____-NEXT: i32 1, label [[ONONE:%.*]] -; IS__TUNIT____-NEXT: ] -; IS__TUNIT____: onzero: -; IS__TUNIT____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: ret i32* [[PTR]] -; IS__TUNIT____: onone: -; IS__TUNIT____-NEXT: ret i32* null -; IS__TUNIT____: ondefault: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@returned_noundef -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ -; IS__CGSCC____-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__CGSCC____-NEXT: i32 1, label [[ONONE:%.*]] -; IS__CGSCC____-NEXT: ] -; IS__CGSCC____: onzero: -; IS__CGSCC____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: ret i32* [[PTR]] -; IS__CGSCC____: onone: -; IS__CGSCC____-NEXT: ret i32* null -; IS__CGSCC____: ondefault: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@returned_noundef +; CHECK-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ +; CHECK-NEXT: i32 0, label [[ONZERO:%.*]] +; CHECK-NEXT: i32 1, label [[ONONE:%.*]] +; CHECK-NEXT: ] +; CHECK: onzero: +; CHECK-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; CHECK-NEXT: ret i32* [[PTR]] +; CHECK: onone: +; CHECK-NEXT: ret i32* null +; CHECK: ondefault: +; CHECK-NEXT: unreachable ; switch i32 %c, label %ondefault [ i32 0, label %onzero i32 1, label %onone ] @@ -1005,35 +700,20 @@ } define nonnull noundef i32* @returned_nonnnull_noundef(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@returned_nonnnull_noundef -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ -; IS__TUNIT____-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__TUNIT____-NEXT: i32 1, label [[ONONE:%.*]] -; IS__TUNIT____-NEXT: ] -; IS__TUNIT____: onzero: -; IS__TUNIT____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: ret i32* [[PTR]] -; IS__TUNIT____: onone: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: ondefault: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@returned_nonnnull_noundef -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ -; IS__CGSCC____-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__CGSCC____-NEXT: i32 1, label [[ONONE:%.*]] -; IS__CGSCC____-NEXT: ] -; IS__CGSCC____: onzero: -; IS__CGSCC____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: ret i32* [[PTR]] -; IS__CGSCC____: onone: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: ondefault: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@returned_nonnnull_noundef +; CHECK-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ +; CHECK-NEXT: i32 0, label [[ONZERO:%.*]] +; CHECK-NEXT: i32 1, label [[ONONE:%.*]] +; CHECK-NEXT: ] +; CHECK: onzero: +; CHECK-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; CHECK-NEXT: ret i32* [[PTR]] +; CHECK: onone: +; CHECK-NEXT: unreachable +; CHECK: ondefault: +; CHECK-NEXT: unreachable ; switch i32 %c, label %ondefault [ i32 0, label %onzero i32 1, label %onone ] @@ -1047,15 +727,10 @@ } define noundef i32 @returned_nonnnull_noundef_int() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@returned_nonnnull_noundef_int -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@returned_nonnnull_noundef_int -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@returned_nonnnull_noundef_int +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i32 0 ; ret i32 0 } @@ -1082,70 +757,50 @@ } define i32 @argument_noundef1(i32 noundef %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@argument_noundef1 -; IS__TUNIT____-SAME: (i32 noundef returned [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 [[C]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@argument_noundef1 -; IS__CGSCC____-SAME: (i32 noundef returned [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 [[C]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@argument_noundef1 +; CHECK-SAME: (i32 noundef returned [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: ret i32 [[C]] ; ret i32 %c } define i32 @violate_noundef_nonpointer() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@violate_noundef_nonpointer -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 undef -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@violate_noundef_nonpointer -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 undef +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@violate_noundef_nonpointer +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i32 undef ; %ret = call i32 @argument_noundef1(i32 undef) ret i32 %ret } define i32* @argument_noundef2(i32* noundef %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@argument_noundef2 -; IS__TUNIT____-SAME: (i32* nofree noundef readnone returned "no-capture-maybe-returned" [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* [[C]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@argument_noundef2 -; IS__CGSCC____-SAME: (i32* nofree noundef readnone returned "no-capture-maybe-returned" [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* [[C]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@argument_noundef2 +; CHECK-SAME: (i32* nofree noundef readnone returned "no-capture-maybe-returned" [[C:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: ret i32* [[C]] ; ret i32* %c } define i32* @violate_noundef_pointer() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@violate_noundef_pointer -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* undef -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@violate_noundef_pointer -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* undef +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@violate_noundef_pointer +; CHECK-SAME: () #[[ATTR0]] { +; CHECK-NEXT: ret i32* undef ; %ret = call i32* @argument_noundef2(i32* undef) ret i32* %ret } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind null_pointer_is_valid readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nosync nounwind null_pointer_is_valid willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR4]] = { nofree nounwind null_pointer_is_valid willreturn } -; IS__TUNIT____: attributes #[[ATTR5]] = { nofree noreturn nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR6]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR2]] = { nofree norecurse nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind null_pointer_is_valid willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR4]] = { nofree norecurse nounwind null_pointer_is_valid willreturn } +; IS__TUNIT____: attributes #[[ATTR5]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } ; IS__TUNIT____: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn writeonly } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/value-simplify-instances.ll b/llvm/test/Transforms/Attributor/value-simplify-instances.ll --- a/llvm/test/Transforms/Attributor/value-simplify-instances.ll +++ b/llvm/test/Transforms/Attributor/value-simplify-instances.ll @@ -15,17 +15,11 @@ ; CHECK: @[[G3:[a-zA-Z0-9_$"\\.-]+]] = private global i1 undef ;. define internal i1 @recursive_inst_comparator(i1* %a, i1* %b) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_inst_comparator -; IS__TUNIT____-SAME: (i1* noalias nofree readnone [[A:%.*]], i1* noalias nofree readnone [[B:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[B]] -; IS__TUNIT____-NEXT: ret i1 [[CMP]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_inst_comparator -; IS__CGSCC____-SAME: (i1* noalias nofree readnone [[A:%.*]], i1* noalias nofree readnone [[B:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[B]] -; IS__CGSCC____-NEXT: ret i1 [[CMP]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@recursive_inst_comparator +; CHECK-SAME: (i1* noalias nofree readnone [[A:%.*]], i1* noalias nofree readnone [[B:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[B]] +; CHECK-NEXT: ret i1 [[CMP]] ; %cmp = icmp eq i1* %a, %b ret i1 %cmp @@ -37,7 +31,7 @@ ; IS__TUNIT_OPM-NEXT: [[A:%.*]] = call i1* @geti1Ptr() ; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT_OPM: t: -; IS__TUNIT_OPM-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[P]]) #[[ATTR4:[0-9]+]] +; IS__TUNIT_OPM-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[P]]) #[[ATTR6:[0-9]+]] ; IS__TUNIT_OPM-NEXT: ret i1 [[R1]] ; IS__TUNIT_OPM: f: ; IS__TUNIT_OPM-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, i1* nofree [[A]]) @@ -48,7 +42,7 @@ ; IS__TUNIT_NPM-NEXT: [[A:%.*]] = call i1* @geti1Ptr() ; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT_NPM: t: -; IS__TUNIT_NPM-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[A]]) #[[ATTR4:[0-9]+]] +; IS__TUNIT_NPM-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[A]]) #[[ATTR6:[0-9]+]] ; IS__TUNIT_NPM-NEXT: ret i1 [[R1]] ; IS__TUNIT_NPM: f: ; IS__TUNIT_NPM-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, i1* nofree [[A]]) @@ -59,7 +53,7 @@ ; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i1* @geti1Ptr() ; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__CGSCC_OPM: t: -; IS__CGSCC_OPM-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[P]]) +; IS__CGSCC_OPM-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[P]]) #[[ATTR7:[0-9]+]] ; IS__CGSCC_OPM-NEXT: ret i1 [[R1]] ; IS__CGSCC_OPM: f: ; IS__CGSCC_OPM-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, i1* nofree [[A]]) @@ -70,7 +64,7 @@ ; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i1* @geti1Ptr() ; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__CGSCC_NPM: t: -; IS__CGSCC_NPM-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[A]]) +; IS__CGSCC_NPM-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[A]]) #[[ATTR7:[0-9]+]] ; IS__CGSCC_NPM-NEXT: ret i1 [[R1]] ; IS__CGSCC_NPM: f: ; IS__CGSCC_NPM-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true) @@ -88,13 +82,20 @@ ; FIXME: This should *not* return true. define i1 @recursive_inst_generator_caller(i1 %c) { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_inst_generator_caller -; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) { -; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_generator(i1 [[C]], i1* undef) -; NOT_CGSCC_NPM-NEXT: ret i1 [[CALL]] +; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_inst_generator_caller +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) { +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_generator(i1 [[C]], i1* undef) +; IS__TUNIT____-NEXT: ret i1 [[CALL]] ; +; IS__CGSCC_OPM: Function Attrs: norecurse +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@recursive_inst_generator_caller +; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR1:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_generator(i1 [[C]], i1* undef) +; IS__CGSCC_OPM-NEXT: ret i1 [[CALL]] +; +; IS__CGSCC_NPM: Function Attrs: norecurse ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_inst_generator_caller -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) { +; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_generator(i1 [[C]]) ; IS__CGSCC_NPM-NEXT: ret i1 [[CALL]] ; @@ -138,17 +139,29 @@ ; Make sure we do *not* return true. define internal i1 @recursive_alloca_compare(i1 %c, i1* %p) { -; CHECK: Function Attrs: nofree nosync nounwind readnone -; CHECK-LABEL: define {{[^@]+}}@recursive_alloca_compare -; CHECK-SAME: (i1 [[C:%.*]], i1* noalias nofree nonnull readnone [[P:%.*]]) #[[ATTR1:[0-9]+]] { -; CHECK-NEXT: [[A:%.*]] = alloca i1, align 1 -; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; CHECK: t: -; CHECK-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[P]] -; CHECK-NEXT: ret i1 [[CMP]] -; CHECK: f: -; CHECK-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 noundef true, i1* noalias nofree noundef nonnull readnone dereferenceable(1) [[A]]) #[[ATTR1]] -; CHECK-NEXT: ret i1 [[CALL]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_alloca_compare +; IS__TUNIT____-SAME: (i1 [[C:%.*]], i1* noalias nofree nonnull readnone [[P:%.*]]) #[[ATTR1:[0-9]+]] { +; IS__TUNIT____-NEXT: [[A:%.*]] = alloca i1, align 1 +; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__TUNIT____: t: +; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[P]] +; IS__TUNIT____-NEXT: ret i1 [[CMP]] +; IS__TUNIT____: f: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 noundef true, i1* noalias nofree noundef nonnull readnone dereferenceable(1) [[A]]) #[[ATTR1]] +; IS__TUNIT____-NEXT: ret i1 [[CALL]] +; +; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone +; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_alloca_compare +; IS__CGSCC____-SAME: (i1 [[C:%.*]], i1* noalias nofree nonnull readnone [[P:%.*]]) #[[ATTR2:[0-9]+]] { +; IS__CGSCC____-NEXT: [[A:%.*]] = alloca i1, align 1 +; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC____: t: +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[P]] +; IS__CGSCC____-NEXT: ret i1 [[CMP]] +; IS__CGSCC____: f: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 noundef true, i1* noalias nofree noundef nonnull readnone dereferenceable(1) [[A]]) #[[ATTR2]] +; IS__CGSCC____-NEXT: ret i1 [[CALL]] ; %a = alloca i1 br i1 %c, label %t, label %f @@ -162,16 +175,16 @@ ; FIXME: This should *not* return true. define i1 @recursive_alloca_compare_caller(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] { ; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 [[C]], i1* undef) #[[ATTR1]] ; IS__TUNIT____-NEXT: ret i1 [[CALL]] ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 [[C]], i1* undef) #[[ATTR4:[0-9]+]] +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR3:[0-9]+]] { +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 [[C]], i1* undef) #[[ATTR7:[0-9]+]] ; IS__CGSCC____-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_alloca_compare(i1 %c, i1* undef) @@ -180,19 +193,33 @@ ; Make sure we do *not* simplify this to return 0 or 1, return 42 is ok though. define internal i8 @recursive_alloca_load_return(i1 %c, i8* %p, i8 %v) { -; CHECK: Function Attrs: argmemonly nofree nosync nounwind -; CHECK-LABEL: define {{[^@]+}}@recursive_alloca_load_return -; CHECK-SAME: (i1 [[C:%.*]], i8* nocapture nofree nonnull readonly [[P:%.*]], i8 noundef [[V:%.*]]) #[[ATTR2:[0-9]+]] { -; CHECK-NEXT: [[A:%.*]] = alloca i8, align 1 -; CHECK-NEXT: store i8 [[V]], i8* [[A]], align 1 -; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; CHECK: t: -; CHECK-NEXT: store i8 0, i8* [[A]], align 1 -; CHECK-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 -; CHECK-NEXT: ret i8 [[L]] -; CHECK: f: -; CHECK-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 noundef true, i8* noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[A]], i8 noundef 1) #[[ATTR3:[0-9]+]] -; CHECK-NEXT: ret i8 [[CALL]] +; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind +; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_alloca_load_return +; IS__TUNIT____-SAME: (i1 [[C:%.*]], i8* nocapture nofree nonnull readonly [[P:%.*]], i8 noundef [[V:%.*]]) #[[ATTR3:[0-9]+]] { +; IS__TUNIT____-NEXT: [[A:%.*]] = alloca i8, align 1 +; IS__TUNIT____-NEXT: store i8 [[V]], i8* [[A]], align 1 +; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__TUNIT____: t: +; IS__TUNIT____-NEXT: store i8 0, i8* [[A]], align 1 +; IS__TUNIT____-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 +; IS__TUNIT____-NEXT: ret i8 [[L]] +; IS__TUNIT____: f: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 noundef true, i8* noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[A]], i8 noundef 1) #[[ATTR4:[0-9]+]] +; IS__TUNIT____-NEXT: ret i8 [[CALL]] +; +; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind +; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_alloca_load_return +; IS__CGSCC____-SAME: (i1 [[C:%.*]], i8* nocapture nofree nonnull readonly [[P:%.*]], i8 noundef [[V:%.*]]) #[[ATTR4:[0-9]+]] { +; IS__CGSCC____-NEXT: [[A:%.*]] = alloca i8, align 1 +; IS__CGSCC____-NEXT: store i8 [[V]], i8* [[A]], align 1 +; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC____: t: +; IS__CGSCC____-NEXT: store i8 0, i8* [[A]], align 1 +; IS__CGSCC____-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 +; IS__CGSCC____-NEXT: ret i8 [[L]] +; IS__CGSCC____: f: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 noundef true, i8* noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[A]], i8 noundef 1) #[[ATTR5:[0-9]+]] +; IS__CGSCC____-NEXT: ret i8 [[CALL]] ; %a = alloca i8 store i8 %v, i8* %a @@ -207,16 +234,16 @@ } define i8 @recursive_alloca_load_return_caller(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_alloca_load_return_caller -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 [[C]], i8* undef, i8 noundef 42) #[[ATTR3]] +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 [[C]], i8* undef, i8 noundef 42) #[[ATTR4]] ; IS__TUNIT____-NEXT: ret i8 [[CALL]] ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_alloca_load_return_caller -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 [[C]], i8* undef, i8 noundef 42) #[[ATTR5:[0-9]+]] +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 [[C]], i8* undef, i8 noundef 42) #[[ATTR8:[0-9]+]] ; IS__CGSCC____-NEXT: ret i8 [[CALL]] ; %call = call i8 @recursive_alloca_load_return(i1 %c, i8* undef, i8 42) @@ -229,19 +256,33 @@ ; Make sure we do *not* return true. define internal i1 @recursive_alloca_compare_global1(i1 %c) { -; CHECK: Function Attrs: nofree nosync nounwind -; CHECK-LABEL: define {{[^@]+}}@recursive_alloca_compare_global1 -; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; CHECK-NEXT: [[A:%.*]] = alloca i1, align 1 -; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; CHECK: t: -; CHECK-NEXT: [[P:%.*]] = load i1*, i1** @G1, align 8 -; CHECK-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[P]] -; CHECK-NEXT: ret i1 [[CMP]] -; CHECK: f: -; CHECK-NEXT: store i1* [[A]], i1** @G1, align 8 -; CHECK-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 noundef true) #[[ATTR3]] -; CHECK-NEXT: ret i1 [[CALL]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind +; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_alloca_compare_global1 +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { +; IS__TUNIT____-NEXT: [[A:%.*]] = alloca i1, align 1 +; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__TUNIT____: t: +; IS__TUNIT____-NEXT: [[P:%.*]] = load i1*, i1** @G1, align 8 +; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[P]] +; IS__TUNIT____-NEXT: ret i1 [[CMP]] +; IS__TUNIT____: f: +; IS__TUNIT____-NEXT: store i1* [[A]], i1** @G1, align 8 +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 noundef true) #[[ATTR4]] +; IS__TUNIT____-NEXT: ret i1 [[CALL]] +; +; IS__CGSCC____: Function Attrs: nofree nosync nounwind +; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_alloca_compare_global1 +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR5]] { +; IS__CGSCC____-NEXT: [[A:%.*]] = alloca i1, align 1 +; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC____: t: +; IS__CGSCC____-NEXT: [[P:%.*]] = load i1*, i1** @G1, align 8 +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[P]] +; IS__CGSCC____-NEXT: ret i1 [[CMP]] +; IS__CGSCC____: f: +; IS__CGSCC____-NEXT: store i1* [[A]], i1** @G1, align 8 +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 noundef true) #[[ATTR5]] +; IS__CGSCC____-NEXT: ret i1 [[CALL]] ; %a = alloca i1 br i1 %c, label %t, label %f @@ -257,16 +298,16 @@ ; FIXME: This should *not* return true. define i1 @recursive_alloca_compare_caller_global1(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind ; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 [[C]]) #[[ATTR3]] +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR5:[0-9]+]] { +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 [[C]]) #[[ATTR4]] ; IS__TUNIT____-NEXT: ret i1 [[CALL]] ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind ; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global1 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 [[C]]) #[[ATTR5]] +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR6:[0-9]+]] { +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 [[C]]) #[[ATTR8]] ; IS__CGSCC____-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_alloca_compare_global1(i1 %c) @@ -274,19 +315,33 @@ } define internal i1 @recursive_alloca_compare_global2(i1 %c) { -; CHECK: Function Attrs: nofree nosync nounwind -; CHECK-LABEL: define {{[^@]+}}@recursive_alloca_compare_global2 -; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; CHECK-NEXT: [[A:%.*]] = alloca i1, align 1 -; CHECK-NEXT: [[P:%.*]] = load i1*, i1** @G2, align 8 -; CHECK-NEXT: store i1* [[A]], i1** @G2, align 8 -; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; CHECK: t: -; CHECK-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[P]] -; CHECK-NEXT: ret i1 [[CMP]] -; CHECK: f: -; CHECK-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 noundef true) #[[ATTR3]] -; CHECK-NEXT: ret i1 [[CALL]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind +; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_alloca_compare_global2 +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { +; IS__TUNIT____-NEXT: [[A:%.*]] = alloca i1, align 1 +; IS__TUNIT____-NEXT: [[P:%.*]] = load i1*, i1** @G2, align 8 +; IS__TUNIT____-NEXT: store i1* [[A]], i1** @G2, align 8 +; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__TUNIT____: t: +; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[P]] +; IS__TUNIT____-NEXT: ret i1 [[CMP]] +; IS__TUNIT____: f: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 noundef true) #[[ATTR4]] +; IS__TUNIT____-NEXT: ret i1 [[CALL]] +; +; IS__CGSCC____: Function Attrs: nofree nosync nounwind +; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_alloca_compare_global2 +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR5]] { +; IS__CGSCC____-NEXT: [[A:%.*]] = alloca i1, align 1 +; IS__CGSCC____-NEXT: [[P:%.*]] = load i1*, i1** @G2, align 8 +; IS__CGSCC____-NEXT: store i1* [[A]], i1** @G2, align 8 +; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC____: t: +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[P]] +; IS__CGSCC____-NEXT: ret i1 [[CMP]] +; IS__CGSCC____: f: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 noundef true) #[[ATTR5]] +; IS__CGSCC____-NEXT: ret i1 [[CALL]] ; %a = alloca i1 %p = load i1*, i1** @G2 @@ -302,16 +357,16 @@ ; FIXME: This should *not* return true. define i1 @recursive_alloca_compare_caller_global2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind ; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 [[C]]) #[[ATTR3]] +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR5]] { +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 [[C]]) #[[ATTR4]] ; IS__TUNIT____-NEXT: ret i1 [[CALL]] ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind ; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 [[C]]) #[[ATTR5]] +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR6]] { +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 [[C]]) #[[ATTR8]] ; IS__CGSCC____-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_alloca_compare_global2(i1 %c) @@ -319,18 +374,31 @@ } define internal i1 @recursive_inst_compare_global3(i1 %c) { ; -; CHECK: Function Attrs: nofree nosync nounwind -; CHECK-LABEL: define {{[^@]+}}@recursive_inst_compare_global3 -; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; CHECK-NEXT: [[P:%.*]] = load i1, i1* @G3, align 1 -; CHECK-NEXT: store i1 [[C]], i1* @G3, align 1 -; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; CHECK: t: -; CHECK-NEXT: [[CMP:%.*]] = icmp eq i1 [[C]], [[P]] -; CHECK-NEXT: ret i1 [[CMP]] -; CHECK: f: -; CHECK-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 noundef true) #[[ATTR3]] -; CHECK-NEXT: ret i1 [[CALL]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind +; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_inst_compare_global3 +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { +; IS__TUNIT____-NEXT: [[P:%.*]] = load i1, i1* @G3, align 1 +; IS__TUNIT____-NEXT: store i1 [[C]], i1* @G3, align 1 +; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__TUNIT____: t: +; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i1 [[C]], [[P]] +; IS__TUNIT____-NEXT: ret i1 [[CMP]] +; IS__TUNIT____: f: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 noundef true) #[[ATTR4]] +; IS__TUNIT____-NEXT: ret i1 [[CALL]] +; +; IS__CGSCC____: Function Attrs: nofree nosync nounwind +; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_inst_compare_global3 +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR5]] { +; IS__CGSCC____-NEXT: [[P:%.*]] = load i1, i1* @G3, align 1 +; IS__CGSCC____-NEXT: store i1 [[C]], i1* @G3, align 1 +; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC____: t: +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i1 [[C]], [[P]] +; IS__CGSCC____-NEXT: ret i1 [[CMP]] +; IS__CGSCC____: f: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 noundef true) #[[ATTR5]] +; IS__CGSCC____-NEXT: ret i1 [[CALL]] ; %p = load i1, i1* @G3 store i1 %c, i1* @G3 @@ -345,32 +413,37 @@ ; FIXME: This should *not* return true. define i1 @recursive_inst_compare_caller_global3(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind ; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_inst_compare_caller_global3 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 [[C]]) #[[ATTR3]] +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR5]] { +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 [[C]]) #[[ATTR4]] ; IS__TUNIT____-NEXT: ret i1 [[CALL]] ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind ; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_inst_compare_caller_global3 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 [[C]]) #[[ATTR5]] +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR6]] { +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 [[C]]) #[[ATTR8]] ; IS__CGSCC____-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_inst_compare_global3(i1 %c) ret i1 %call } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind } -; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nosync nounwind } -; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { nounwind readnone } +; IS__TUNIT____: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone } +; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind } +; IS__TUNIT____: attributes #[[ATTR4]] = { nofree nosync nounwind } +; IS__TUNIT____: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind } +; IS__TUNIT____: attributes #[[ATTR6:[0-9]+]] = { nounwind readnone } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind } -; IS__CGSCC____: attributes #[[ATTR3]] = { nofree nosync nounwind } -; IS__CGSCC____: attributes #[[ATTR4]] = { nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR5]] = { nounwind } +; IS__CGSCC____: attributes #[[ATTR1:[0-9]+]] = { norecurse } +; IS__CGSCC____: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } +; IS__CGSCC____: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind readnone } +; IS__CGSCC____: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind } +; IS__CGSCC____: attributes #[[ATTR5]] = { nofree nosync nounwind } +; IS__CGSCC____: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind } +; IS__CGSCC____: attributes #[[ATTR7]] = { nounwind readnone } +; IS__CGSCC____: attributes #[[ATTR8]] = { nounwind } ;. diff --git a/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll b/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll --- a/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll +++ b/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll @@ -57,19 +57,12 @@ ; CHECK: @[[GLOBAL:[a-zA-Z0-9_$"\\.-]+]] = internal global [[STRUCT_STY:%.*]] zeroinitializer, align 8 ;. define void @write_arg(i32* %p, i32 %v) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@write_arg -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: store i32 [[V]], i32* [[P]], align 4, !tbaa [[TBAA3:![0-9]+]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_arg -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: store i32 [[V]], i32* [[P]], align 4, !tbaa [[TBAA3:![0-9]+]] -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@write_arg +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: store i32 [[V]], i32* [[P]], align 4, !tbaa [[TBAA3:![0-9]+]] +; CHECK-NEXT: ret void ; entry: store i32 %v, i32* %p, align 4, !tbaa !3 @@ -81,7 +74,7 @@ ; CHECK-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CALL:%.*]] = call i32 (...) @random() -; CHECK-NEXT: store i32 [[CALL]], i32* [[P]], align 4, !tbaa [[TBAA3:![0-9]+]] +; CHECK-NEXT: store i32 [[CALL]], i32* [[P]], align 4, !tbaa [[TBAA3]] ; CHECK-NEXT: ret void ; entry: @@ -116,16 +109,16 @@ ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR11:[0-9]+]] +; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR14:[0-9]+]] ; IS__TUNIT_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 ; IS__TUNIT_OPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 ; IS__TUNIT_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 ; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR5:[0-9]+]] +; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR15:[0-9]+]] ; IS__TUNIT_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR5]] +; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR15]] ; IS__TUNIT_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR5]] +; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR15]] ; IS__TUNIT_OPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 ; IS__TUNIT_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]] ; IS__TUNIT_OPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 @@ -143,7 +136,7 @@ ; IS__TUNIT_OPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 ; IS__TUNIT_OPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]] ; IS__TUNIT_OPM-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR11]] +; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR14]] ; IS__TUNIT_OPM-NEXT: ret void ; ; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn @@ -152,16 +145,16 @@ ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR9:[0-9]+]] +; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR11:[0-9]+]] ; IS__TUNIT_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 ; IS__TUNIT_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 ; IS__TUNIT_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 ; IS__TUNIT_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR4:[0-9]+]] +; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR12:[0-9]+]] ; IS__TUNIT_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR4]] +; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR12]] ; IS__TUNIT_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR4]] +; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR12]] ; IS__TUNIT_NPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 ; IS__TUNIT_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]] ; IS__TUNIT_NPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 @@ -179,7 +172,7 @@ ; IS__TUNIT_NPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 ; IS__TUNIT_NPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]] ; IS__TUNIT_NPM-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR9]] +; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR11]] ; IS__TUNIT_NPM-NEXT: ret void ; ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn @@ -386,7 +379,7 @@ ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500 ; IS__TUNIT_OPM-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32* -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(524) [[I22]], i32 noundef 0) #[[ATTR6:[0-9]+]] +; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(524) [[I22]], i32 noundef 0) #[[ATTR16:[0-9]+]] ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND28:%.*]] ; IS__TUNIT_OPM: for.cond28: ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ] @@ -412,7 +405,7 @@ ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]]) #[[ATTR9]] +; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]]) #[[ATTR11]] ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] ; IS__TUNIT_NPM: for.cond: ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] @@ -465,7 +458,7 @@ ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500 ; IS__TUNIT_NPM-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32* -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(524) [[I22]], i32 noundef 0) #[[ATTR4]] +; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(524) [[I22]], i32 noundef 0) #[[ATTR12]] ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND28:%.*]] ; IS__TUNIT_NPM: for.cond28: ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ] @@ -482,7 +475,7 @@ ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP20:![0-9]+]] ; IS__TUNIT_NPM: for.end38: ; IS__TUNIT_NPM-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I24]]) #[[ATTR9]] +; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I24]]) #[[ATTR11]] ; IS__TUNIT_NPM-NEXT: ret void ; ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2() { @@ -762,16 +755,23 @@ ; } ; define i32 @local_alloca_simplifiable_3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3 -; IS__TUNIT____-SAME: () #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: store i32 1, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: br label [[SPLIT:%.*]] -; IS__TUNIT____: split: -; IS__TUNIT____-NEXT: store i32 2, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: [[L:%.*]] = load i32, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: ret i32 [[L]] +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3 +; IS__TUNIT_OPM-SAME: () #[[ATTR3:[0-9]+]] { +; IS__TUNIT_OPM-NEXT: [[A:%.*]] = alloca i32, align 4 +; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[A]], align 4 +; IS__TUNIT_OPM-NEXT: br label [[SPLIT:%.*]] +; IS__TUNIT_OPM: split: +; IS__TUNIT_OPM-NEXT: store i32 2, i32* [[A]], align 4 +; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* [[A]], align 4 +; IS__TUNIT_OPM-NEXT: ret i32 [[L]] +; +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3 +; IS__TUNIT_NPM-SAME: () #[[ATTR3:[0-9]+]] { +; IS__TUNIT_NPM-NEXT: br label [[SPLIT:%.*]] +; IS__TUNIT_NPM: split: +; IS__TUNIT_NPM-NEXT: ret i32 2 ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3 @@ -805,9 +805,9 @@ ; } ; define i32 @local_alloca_simplifiable_4() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_4 -; IS__TUNIT____-SAME: () #[[ATTR3]] { +; IS__TUNIT____-SAME: () #[[ATTR3:[0-9]+]] { ; IS__TUNIT____-NEXT: ret i32 undef ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn @@ -833,7 +833,7 @@ ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = alloca i32, align 4 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]] +; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR14]] ; IS__TUNIT_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 ; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] ; IS__TUNIT_OPM: cond.true: @@ -842,7 +842,7 @@ ; IS__TUNIT_OPM-NEXT: br label [[COND_END]] ; IS__TUNIT_OPM: cond.end: ; IS__TUNIT_OPM-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR11]] +; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR14]] ; IS__TUNIT_OPM-NEXT: ret i32 5 ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn @@ -851,7 +851,7 @@ ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: [[L:%.*]] = alloca i32, align 4 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]] +; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]] ; IS__TUNIT_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 ; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] ; IS__TUNIT_NPM: cond.true: @@ -860,7 +860,7 @@ ; IS__TUNIT_NPM-NEXT: br label [[COND_END]] ; IS__TUNIT_NPM: cond.end: ; IS__TUNIT_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR9]] +; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR11]] ; IS__TUNIT_NPM-NEXT: ret i32 5 ; ; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn @@ -937,7 +937,7 @@ ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = alloca i32, align 4 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]] +; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR14]] ; IS__TUNIT_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 ; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] ; IS__TUNIT_OPM: cond.true: @@ -946,7 +946,7 @@ ; IS__TUNIT_OPM-NEXT: br label [[COND_END]] ; IS__TUNIT_OPM: cond.end: ; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR11]] +; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR14]] ; IS__TUNIT_OPM-NEXT: ret i32 5 ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn @@ -955,7 +955,7 @@ ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: [[L:%.*]] = alloca i32, align 4 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]] +; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]] ; IS__TUNIT_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 ; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] ; IS__TUNIT_NPM: cond.true: @@ -964,7 +964,7 @@ ; IS__TUNIT_NPM-NEXT: br label [[COND_END]] ; IS__TUNIT_NPM: cond.end: ; IS__TUNIT_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR9]] +; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR11]] ; IS__TUNIT_NPM-NEXT: ret i32 5 ; ; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn @@ -1044,13 +1044,13 @@ ; } ; define void @static_global_simplifiable_1(%struct.S* noalias sret(%struct.S) align 4 %agg.result) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1 -; IS__TUNIT_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR5]] { +; IS__TUNIT_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR5:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR5]] -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR5]] -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR5]] +; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR15]] +; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR15]] +; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR15]] ; IS__TUNIT_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 ; IS__TUNIT_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] ; IS__TUNIT_OPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 @@ -1069,13 +1069,13 @@ ; IS__TUNIT_OPM-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]] ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1 -; IS__TUNIT_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4]] { +; IS__TUNIT_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR4]] -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR4]] -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR4]] +; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR12]] +; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR12]] +; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR12]] ; IS__TUNIT_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 ; IS__TUNIT_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] ; IS__TUNIT_NPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 @@ -1194,9 +1194,9 @@ ; } ; define void @static_global_simplifiable_2() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind writeonly +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind writeonly ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2 -; IS__TUNIT_OPM-SAME: () #[[ATTR6]] { +; IS__TUNIT_OPM-SAME: () #[[ATTR6:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] ; IS__TUNIT_OPM: for.cond: @@ -1245,7 +1245,7 @@ ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP23:![0-9]+]] ; IS__TUNIT_OPM: for.end23: -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(524) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR6]] +; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(524) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR16]] ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND25:%.*]] ; IS__TUNIT_OPM: for.cond25: ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ] @@ -1263,7 +1263,7 @@ ; IS__TUNIT_OPM: for.end35: ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2 ; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -1314,7 +1314,7 @@ ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP23:![0-9]+]] ; IS__TUNIT_NPM: for.end23: -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(524) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR4]] +; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(524) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR12]] ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND25:%.*]] ; IS__TUNIT_NPM: for.cond25: ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ] @@ -1577,26 +1577,19 @@ ; return Flag3; ; } define i32 @static_global_simplifiable_3() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_3 -; IS__TUNIT_OPM-SAME: () #[[ATTR4]] { +; IS__TUNIT_OPM-SAME: () #[[ATTR7:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]] ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]] ; IS__TUNIT_OPM-NEXT: ret i32 [[I]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_3 -; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]] -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]] -; IS__TUNIT_NPM-NEXT: ret i32 [[I]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@static_global_simplifiable_3 -; IS__CGSCC____-SAME: () #[[ATTR5:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]] -; IS__CGSCC____-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]] -; IS__CGSCC____-NEXT: ret i32 [[I]] +; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_3 +; NOT_TUNIT_OPM-SAME: () #[[ATTR5:[0-9]+]] { +; NOT_TUNIT_OPM-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]] +; NOT_TUNIT_OPM-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]] +; NOT_TUNIT_OPM-NEXT: ret i32 [[I]] ; store i32 1, i32* @Flag3, align 4, !tbaa !3 %i = load i32, i32* @Flag3, align 4, !tbaa !3 @@ -1621,9 +1614,9 @@ ; } ; define void @noalias_arg_simplifiable_1(%struct.S* noalias sret(%struct.S) align 4 %agg.result, %struct.S* byval(%struct.S) align 8 %s) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1 -; IS__TUNIT_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR1]] { +; IS__TUNIT_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR8:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 ; IS__TUNIT_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] @@ -1632,11 +1625,11 @@ ; IS__TUNIT_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 ; IS__TUNIT_OPM-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]] ; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR5]] +; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR15]] ; IS__TUNIT_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR5]] +; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR15]] ; IS__TUNIT_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR5]] +; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR15]] ; IS__TUNIT_OPM-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]] ; IS__TUNIT_OPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 @@ -1671,9 +1664,9 @@ ; IS__TUNIT_OPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]] ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1 -; IS__TUNIT_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR1]] { +; IS__TUNIT_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR6:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 ; IS__TUNIT_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] @@ -1682,11 +1675,11 @@ ; IS__TUNIT_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 ; IS__TUNIT_NPM-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]] ; IS__TUNIT_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR4]] +; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR12]] ; IS__TUNIT_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR4]] +; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR12]] ; IS__TUNIT_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR4]] +; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR12]] ; IS__TUNIT_NPM-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]] ; IS__TUNIT_NPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 @@ -1884,9 +1877,9 @@ ; } ; define void @noalias_arg_simplifiable_2(i8* %Bytes) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2 -; IS__TUNIT_OPM-SAME: (i8* nocapture nofree [[BYTES:%.*]]) #[[ATTR2]] { +; IS__TUNIT_OPM-SAME: (i8* nocapture nofree [[BYTES:%.*]]) #[[ATTR9:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] ; IS__TUNIT_OPM: for.cond: @@ -1944,7 +1937,7 @@ ; IS__TUNIT_OPM-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA19]] ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500 ; IS__TUNIT_OPM-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32* -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 [[I21]], i32 noundef 0) #[[ATTR6]] +; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 [[I21]], i32 noundef 0) #[[ATTR16]] ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND27:%.*]] ; IS__TUNIT_OPM: for.cond27: ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ] @@ -1964,9 +1957,9 @@ ; IS__TUNIT_OPM: for.end37: ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2 -; IS__TUNIT_NPM-SAME: (i8* nocapture nofree [[BYTES:%.*]]) #[[ATTR2]] { +; IS__TUNIT_NPM-SAME: (i8* nocapture nofree [[BYTES:%.*]]) #[[ATTR5]] { ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] ; IS__TUNIT_NPM: for.cond: @@ -2024,7 +2017,7 @@ ; IS__TUNIT_NPM-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA19]] ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500 ; IS__TUNIT_NPM-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32* -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 [[I21]], i32 noundef 0) #[[ATTR4]] +; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 [[I21]], i32 noundef 0) #[[ATTR12]] ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND27:%.*]] ; IS__TUNIT_NPM: for.cond27: ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ] @@ -2310,39 +2303,39 @@ ; } ; define i32 @local_alloca_not_simplifiable_1() { -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[X:%.*]] = alloca i32, align 4 -; IS__TUNIT_OPM-NEXT: [[Y:%.*]] = alloca i32, align 4 -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]] -; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR11]] -; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]] -; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]] -; IS__TUNIT_OPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8* -; IS__TUNIT_OPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]]) -; IS__TUNIT_OPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]]) -; IS__TUNIT_OPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]] -; IS__TUNIT_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0 -; IS__TUNIT_OPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1 -; IS__TUNIT_OPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]] -; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]] -; IS__TUNIT_OPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]] -; IS__TUNIT_OPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]]) -; IS__TUNIT_OPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) -; IS__TUNIT_OPM-NEXT: ret i32 [[ADD1]] +; IS________OPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: [[X:%.*]] = alloca i32, align 4 +; IS________OPM-NEXT: [[Y:%.*]] = alloca i32, align 4 +; IS________OPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8* +; IS________OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR14:[0-9]+]] +; IS________OPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8* +; IS________OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR14]] +; IS________OPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]] +; IS________OPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]] +; IS________OPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8* +; IS________OPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]]) +; IS________OPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]]) +; IS________OPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]] +; IS________OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0 +; IS________OPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1 +; IS________OPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]] +; IS________OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]] +; IS________OPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]] +; IS________OPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8* +; IS________OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]]) +; IS________OPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8* +; IS________OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) +; IS________OPM-NEXT: ret i32 [[ADD1]] ; ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: [[X:%.*]] = alloca i32, align 4 ; IS__TUNIT_NPM-NEXT: [[Y:%.*]] = alloca i32, align 4 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]] +; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]] ; IS__TUNIT_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR9]] +; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR11]] ; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]] ; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]] ; IS__TUNIT_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8* @@ -2360,31 +2353,6 @@ ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) ; IS__TUNIT_NPM-NEXT: ret i32 [[ADD1]] ; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[X:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: [[Y:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR14]] -; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR14]] -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]] -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]] -; IS__CGSCC_OPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8* -; IS__CGSCC_OPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]]) -; IS__CGSCC_OPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]]) -; IS__CGSCC_OPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]] -; IS__CGSCC_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0 -; IS__CGSCC_OPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1 -; IS__CGSCC_OPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]] -; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]] -; IS__CGSCC_OPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]] -; IS__CGSCC_OPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]]) -; IS__CGSCC_OPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) -; IS__CGSCC_OPM-NEXT: ret i32 [[ADD1]] -; ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: [[X:%.*]] = alloca i32, align 4 @@ -2437,7 +2405,7 @@ ; We could simplify these if we separate accessed bins wrt. alignment (here mod 4). define i32 @unknown_access_mixed_simplifiable(i32 %arg1, i32 %arg2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@unknown_access_mixed_simplifiable ; IS__TUNIT____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR3]] { ; IS__TUNIT____-NEXT: entry: @@ -2494,7 +2462,7 @@ ; The access to bc4b could go anywhere, nothing is simplifiable. define i32 @unknown_access_mixed_not_simplifiable(i32 %arg1, i32 %arg2, i32 %arg3) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@unknown_access_mixed_not_simplifiable ; IS__TUNIT____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR3]] { ; IS__TUNIT____-NEXT: entry: @@ -2575,26 +2543,19 @@ ; } ; define i32 @global_not_simplifiable_1(i32 %cnd) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readonly willreturn +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@global_not_simplifiable_1 -; IS__TUNIT_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR7:[0-9]+]] { +; IS__TUNIT_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR10:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]] ; IS__TUNIT_OPM-NEXT: ret i32 [[I]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@global_not_simplifiable_1 -; IS__TUNIT_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]] -; IS__TUNIT_NPM-NEXT: ret i32 [[I]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@global_not_simplifiable_1 -; IS__CGSCC____-SAME: (i32 [[CND:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]] -; IS__CGSCC____-NEXT: ret i32 [[I]] +; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@global_not_simplifiable_1 +; NOT_TUNIT_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_TUNIT_OPM-NEXT: entry: +; NOT_TUNIT_OPM-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]] +; NOT_TUNIT_OPM-NEXT: ret i32 [[I]] ; entry: %i = load i32, i32* @Flag0, align 4, !tbaa !3 @@ -2678,173 +2639,130 @@ ; ; FIXME: We could replace these loads. define i32 @write_read_global() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_global -; IS__TUNIT_OPM-SAME: () #[[ATTR4]] { +; IS__TUNIT_OPM-SAME: () #[[ATTR7]] { ; IS__TUNIT_OPM-NEXT: store i32 7, i32* @Gint1, align 4 ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4 ; IS__TUNIT_OPM-NEXT: ret i32 [[L]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_read_global -; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: store i32 7, i32* @Gint1, align 4 -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4 -; IS__TUNIT_NPM-NEXT: ret i32 [[L]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_read_global -; IS__CGSCC____-SAME: () #[[ATTR5]] { -; IS__CGSCC____-NEXT: store i32 7, i32* @Gint1, align 4 -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_global +; NOT_TUNIT_OPM-SAME: () #[[ATTR5]] { +; NOT_TUNIT_OPM-NEXT: store i32 7, i32* @Gint1, align 4 +; NOT_TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4 +; NOT_TUNIT_OPM-NEXT: ret i32 [[L]] ; store i32 7, i32* @Gint1 %l = load i32, i32* @Gint1 ret i32 %l } define void @write_global() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_global ; IS__TUNIT_OPM-SAME: () #[[ATTR5]] { ; IS__TUNIT_OPM-NEXT: store i32 7, i32* @Gint2, align 4 ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_global -; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: store i32 7, i32* @Gint2, align 4 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_global -; IS__CGSCC____-SAME: () #[[ATTR4:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 7, i32* @Gint2, align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@write_global +; NOT_TUNIT_OPM-SAME: () #[[ATTR4:[0-9]+]] { +; NOT_TUNIT_OPM-NEXT: store i32 7, i32* @Gint2, align 4 +; NOT_TUNIT_OPM-NEXT: ret void ; store i32 7, i32* @Gint2 ret void } define i32 @read_global() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readonly willreturn +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@read_global -; IS__TUNIT_OPM-SAME: () #[[ATTR7]] { +; IS__TUNIT_OPM-SAME: () #[[ATTR10]] { ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4 ; IS__TUNIT_OPM-NEXT: ret i32 [[L]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@read_global -; IS__TUNIT_NPM-SAME: () #[[ATTR5]] { -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4 -; IS__TUNIT_NPM-NEXT: ret i32 [[L]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@read_global -; IS__CGSCC____-SAME: () #[[ATTR7]] { -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@read_global +; NOT_TUNIT_OPM-SAME: () #[[ATTR7]] { +; NOT_TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4 +; NOT_TUNIT_OPM-NEXT: ret i32 [[L]] ; %l = load i32, i32* @Gint2 ret i32 %l } ; FIXME: We could replace these loads. define i32 @write_read_static_global() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_static_global -; IS__TUNIT_OPM-SAME: () #[[ATTR4]] { +; IS__TUNIT_OPM-SAME: () #[[ATTR7]] { ; IS__TUNIT_OPM-NEXT: store i32 7, i32* @Gstatic_int1, align 4 ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4 ; IS__TUNIT_OPM-NEXT: ret i32 [[L]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_read_static_global -; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: store i32 7, i32* @Gstatic_int1, align 4 -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4 -; IS__TUNIT_NPM-NEXT: ret i32 [[L]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_read_static_global -; IS__CGSCC____-SAME: () #[[ATTR5]] { -; IS__CGSCC____-NEXT: store i32 7, i32* @Gstatic_int1, align 4 -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_static_global +; NOT_TUNIT_OPM-SAME: () #[[ATTR5]] { +; NOT_TUNIT_OPM-NEXT: store i32 7, i32* @Gstatic_int1, align 4 +; NOT_TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4 +; NOT_TUNIT_OPM-NEXT: ret i32 [[L]] ; store i32 7, i32* @Gstatic_int1 %l = load i32, i32* @Gstatic_int1 ret i32 %l } define void @write_static_global() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_static_global ; IS__TUNIT_OPM-SAME: () #[[ATTR5]] { ; IS__TUNIT_OPM-NEXT: store i32 7, i32* @Gstatic_int2, align 4 ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_static_global -; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: store i32 7, i32* @Gstatic_int2, align 4 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_static_global -; IS__CGSCC____-SAME: () #[[ATTR4]] { -; IS__CGSCC____-NEXT: store i32 7, i32* @Gstatic_int2, align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@write_static_global +; NOT_TUNIT_OPM-SAME: () #[[ATTR4]] { +; NOT_TUNIT_OPM-NEXT: store i32 7, i32* @Gstatic_int2, align 4 +; NOT_TUNIT_OPM-NEXT: ret void ; store i32 7, i32* @Gstatic_int2 ret void } define i32 @read_static_global() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readonly willreturn +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@read_static_global -; IS__TUNIT_OPM-SAME: () #[[ATTR7]] { +; IS__TUNIT_OPM-SAME: () #[[ATTR10]] { ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4 ; IS__TUNIT_OPM-NEXT: ret i32 [[L]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@read_static_global -; IS__TUNIT_NPM-SAME: () #[[ATTR5]] { -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4 -; IS__TUNIT_NPM-NEXT: ret i32 [[L]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@read_static_global -; IS__CGSCC____-SAME: () #[[ATTR7]] { -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@read_static_global +; NOT_TUNIT_OPM-SAME: () #[[ATTR7]] { +; NOT_TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4 +; NOT_TUNIT_OPM-NEXT: ret i32 [[L]] ; %l = load i32, i32* @Gstatic_int2 ret i32 %l } define i32 @write_read_static_undef_global() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_static_undef_global ; IS__TUNIT_OPM-SAME: () #[[ATTR5]] { ; IS__TUNIT_OPM-NEXT: ret i32 7 ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_read_static_undef_global -; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: ret i32 7 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_read_static_undef_global -; IS__CGSCC____-SAME: () #[[ATTR4]] { -; IS__CGSCC____-NEXT: ret i32 7 +; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_static_undef_global +; NOT_TUNIT_OPM-SAME: () #[[ATTR4]] { +; NOT_TUNIT_OPM-NEXT: ret i32 7 ; store i32 7, i32* @Gstatic_undef_int1 %l = load i32, i32* @Gstatic_undef_int1 ret i32 %l } define void @write_static_undef_global() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_static_undef_global ; IS__TUNIT_OPM-SAME: () #[[ATTR5]] { ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_static_undef_global ; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { ; IS__TUNIT_NPM-NEXT: ret void @@ -2859,7 +2777,7 @@ ret void } define i32 @read_static_undef_global() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@read_static_undef_global ; IS__TUNIT____-SAME: () #[[ATTR3]] { ; IS__TUNIT____-NEXT: ret i32 7 @@ -2874,7 +2792,7 @@ } define i32 @single_read_of_static_global() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@single_read_of_static_global ; IS__TUNIT____-SAME: () #[[ATTR3]] { ; IS__TUNIT____-NEXT: ret i32 0 @@ -2889,9 +2807,9 @@ } define i8 @phi_store() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@phi_store -; IS__TUNIT_OPM-SAME: () #[[ATTR8:[0-9]+]] { +; IS__TUNIT_OPM-SAME: () #[[ATTR11:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: [[A:%.*]] = alloca i16, align 2 ; IS__TUNIT_OPM-NEXT: [[B:%.*]] = bitcast i16* [[A]] to i8* @@ -2908,7 +2826,7 @@ ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i8, i8* [[S]], align 1 ; IS__TUNIT_OPM-NEXT: ret i8 [[L]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@phi_store ; IS__TUNIT_NPM-SAME: () #[[ATTR3]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -2985,77 +2903,41 @@ ; FIXME: This function returns 1. define i8 @phi_no_store_1() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@phi_no_store_1 -; IS__TUNIT_OPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_OPM: loop: -; IS__TUNIT_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__TUNIT_OPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 -; IS__TUNIT_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 -; IS__TUNIT_OPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 -; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] -; IS__TUNIT_OPM-NEXT: ret i8 [[ADD]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@phi_no_store_1 -; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_NPM: loop: -; IS__TUNIT_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 -; IS__TUNIT_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 -; IS__TUNIT_NPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 -; IS__TUNIT_NPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] -; IS__TUNIT_NPM-NEXT: ret i8 [[ADD]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@phi_no_store_1 -; IS__CGSCC_OPM-SAME: () #[[ATTR9:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_OPM: loop: -; IS__CGSCC_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; IS__CGSCC_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__CGSCC_OPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 -; IS__CGSCC_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 -; IS__CGSCC_OPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 -; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] -; IS__CGSCC_OPM-NEXT: ret i8 [[ADD]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@phi_no_store_1 -; IS__CGSCC_NPM-SAME: () #[[ATTR5]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_NPM: loop: -; IS__CGSCC_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; IS__CGSCC_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__CGSCC_NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 -; IS__CGSCC_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 -; IS__CGSCC_NPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 -; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] -; IS__CGSCC_NPM-NEXT: ret i8 [[ADD]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind +; IS________OPM-LABEL: define {{[^@]+}}@phi_no_store_1 +; IS________OPM-SAME: () #[[ATTR9:[0-9]+]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: br label [[LOOP:%.*]] +; IS________OPM: loop: +; IS________OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] +; IS________OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; IS________OPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 +; IS________OPM-NEXT: [[O]] = add nsw i8 [[I]], 1 +; IS________OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 +; IS________OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; IS________OPM: end: +; IS________OPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 +; IS________OPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 +; IS________OPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] +; IS________OPM-NEXT: ret i8 [[ADD]] +; +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; IS________NPM-LABEL: define {{[^@]+}}@phi_no_store_1 +; IS________NPM-SAME: () #[[ATTR5]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: br label [[LOOP:%.*]] +; IS________NPM: loop: +; IS________NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] +; IS________NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; IS________NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 +; IS________NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 +; IS________NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 +; IS________NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; IS________NPM: end: +; IS________NPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 +; IS________NPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 +; IS________NPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] +; IS________NPM-NEXT: ret i8 [[ADD]] ; entry: %b = bitcast i32* @a1 to i8* @@ -3079,73 +2961,39 @@ ; FIXME: This function returns 1. define i8 @phi_no_store_2() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@phi_no_store_2 -; IS__TUNIT_OPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_OPM: loop: -; IS__TUNIT_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ] -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__TUNIT_OPM-NEXT: store i8 1, i8* [[P]], align 2 -; IS__TUNIT_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2 -; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = add i8 [[L21]], 0 -; IS__TUNIT_OPM-NEXT: ret i8 [[ADD]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@phi_no_store_2 -; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_NPM: loop: -; IS__TUNIT_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: store i8 1, i8* [[P]], align 2 -; IS__TUNIT_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2 -; IS__TUNIT_NPM-NEXT: [[ADD:%.*]] = add i8 [[L21]], 0 -; IS__TUNIT_NPM-NEXT: ret i8 [[ADD]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@phi_no_store_2 -; IS__CGSCC_OPM-SAME: () #[[ATTR9]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_OPM: loop: -; IS__CGSCC_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ] -; IS__CGSCC_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__CGSCC_OPM-NEXT: store i8 1, i8* [[P]], align 2 -; IS__CGSCC_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2 -; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = add i8 [[L21]], 0 -; IS__CGSCC_OPM-NEXT: ret i8 [[ADD]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@phi_no_store_2 -; IS__CGSCC_NPM-SAME: () #[[ATTR5]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_NPM: loop: -; IS__CGSCC_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ] -; IS__CGSCC_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__CGSCC_NPM-NEXT: store i8 1, i8* [[P]], align 2 -; IS__CGSCC_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2 -; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = add i8 [[L21]], 0 -; IS__CGSCC_NPM-NEXT: ret i8 [[ADD]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind +; IS________OPM-LABEL: define {{[^@]+}}@phi_no_store_2 +; IS________OPM-SAME: () #[[ATTR9]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: br label [[LOOP:%.*]] +; IS________OPM: loop: +; IS________OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ] +; IS________OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; IS________OPM-NEXT: store i8 1, i8* [[P]], align 2 +; IS________OPM-NEXT: [[O]] = add nsw i8 [[I]], 1 +; IS________OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 +; IS________OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; IS________OPM: end: +; IS________OPM-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2 +; IS________OPM-NEXT: [[ADD:%.*]] = add i8 [[L21]], 0 +; IS________OPM-NEXT: ret i8 [[ADD]] +; +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; IS________NPM-LABEL: define {{[^@]+}}@phi_no_store_2 +; IS________NPM-SAME: () #[[ATTR5]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: br label [[LOOP:%.*]] +; IS________NPM: loop: +; IS________NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ] +; IS________NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; IS________NPM-NEXT: store i8 1, i8* [[P]], align 2 +; IS________NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 +; IS________NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 +; IS________NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; IS________NPM: end: +; IS________NPM-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2 +; IS________NPM-NEXT: [[ADD:%.*]] = add i8 [[L21]], 0 +; IS________NPM-NEXT: ret i8 [[ADD]] ; entry: %b = bitcast i32* @a2 to i8* @@ -3168,7 +3016,7 @@ } define i8 @phi_no_store_3() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind writeonly +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind writeonly ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@phi_no_store_3 ; IS__TUNIT_OPM-SAME: () #[[ATTR6]] { ; IS__TUNIT_OPM-NEXT: entry: @@ -3182,19 +3030,19 @@ ; IS__TUNIT_OPM: end: ; IS__TUNIT_OPM-NEXT: ret i8 1 ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@phi_no_store_3 -; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_NPM: loop: -; IS__TUNIT_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: ret i8 1 +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS________NPM-LABEL: define {{[^@]+}}@phi_no_store_3 +; IS________NPM-SAME: () #[[ATTR4]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: br label [[LOOP:%.*]] +; IS________NPM: loop: +; IS________NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ] +; IS________NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; IS________NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 +; IS________NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 +; IS________NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; IS________NPM: end: +; IS________NPM-NEXT: ret i8 1 ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind writeonly ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@phi_no_store_3 @@ -3210,20 +3058,6 @@ ; IS__CGSCC_OPM: end: ; IS__CGSCC_OPM-NEXT: ret i8 1 ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@phi_no_store_3 -; IS__CGSCC_NPM-SAME: () #[[ATTR4]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_NPM: loop: -; IS__CGSCC_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ] -; IS__CGSCC_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__CGSCC_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret i8 1 -; entry: %b = bitcast i32* @a3 to i8* %s30 = getelementptr i8, i8* %b, i64 3 @@ -3247,26 +3081,19 @@ } define i8 @cast_and_load_1() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@cast_and_load_1 -; IS__TUNIT_OPM-SAME: () #[[ATTR4]] { +; IS__TUNIT_OPM-SAME: () #[[ATTR7]] { ; IS__TUNIT_OPM-NEXT: store i32 42, i32* @bytes1, align 4 ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4 ; IS__TUNIT_OPM-NEXT: ret i8 [[L]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@cast_and_load_1 -; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: store i32 42, i32* @bytes1, align 4 -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4 -; IS__TUNIT_NPM-NEXT: ret i8 [[L]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cast_and_load_1 -; IS__CGSCC____-SAME: () #[[ATTR5]] { -; IS__CGSCC____-NEXT: store i32 42, i32* @bytes1, align 4 -; IS__CGSCC____-NEXT: [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4 -; IS__CGSCC____-NEXT: ret i8 [[L]] +; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@cast_and_load_1 +; NOT_TUNIT_OPM-SAME: () #[[ATTR5]] { +; NOT_TUNIT_OPM-NEXT: store i32 42, i32* @bytes1, align 4 +; NOT_TUNIT_OPM-NEXT: [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4 +; NOT_TUNIT_OPM-NEXT: ret i8 [[L]] ; store i32 42, i32* @bytes1 %bc = bitcast i32* @bytes1 to i8* @@ -3275,26 +3102,19 @@ } define i64 @cast_and_load_2() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@cast_and_load_2 -; IS__TUNIT_OPM-SAME: () #[[ATTR4]] { +; IS__TUNIT_OPM-SAME: () #[[ATTR7]] { ; IS__TUNIT_OPM-NEXT: store i32 42, i32* @bytes2, align 4 ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4 ; IS__TUNIT_OPM-NEXT: ret i64 [[L]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@cast_and_load_2 -; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: store i32 42, i32* @bytes2, align 4 -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4 -; IS__TUNIT_NPM-NEXT: ret i64 [[L]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cast_and_load_2 -; IS__CGSCC____-SAME: () #[[ATTR5]] { -; IS__CGSCC____-NEXT: store i32 42, i32* @bytes2, align 4 -; IS__CGSCC____-NEXT: [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4 -; IS__CGSCC____-NEXT: ret i64 [[L]] +; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@cast_and_load_2 +; NOT_TUNIT_OPM-SAME: () #[[ATTR5]] { +; NOT_TUNIT_OPM-NEXT: store i32 42, i32* @bytes2, align 4 +; NOT_TUNIT_OPM-NEXT: [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4 +; NOT_TUNIT_OPM-NEXT: ret i64 [[L]] ; store i32 42, i32* @bytes2 %bc = bitcast i32* @bytes2 to i64* @@ -3303,20 +3123,35 @@ } define void @recursive_load_store(i64 %N, i32 %v) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_load_store -; IS__TUNIT____-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT____: for.cond: -; IS__TUNIT____-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__TUNIT____-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], [[N]] -; IS__TUNIT____-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_END:%.*]] -; IS__TUNIT____: for.body: -; IS__TUNIT____-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__TUNIT____-NEXT: br label [[FOR_COND]] -; IS__TUNIT____: for.end: -; IS__TUNIT____-NEXT: ret void +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind writeonly +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@recursive_load_store +; IS__TUNIT_OPM-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR6]] { +; IS__TUNIT_OPM-NEXT: entry: +; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] +; IS__TUNIT_OPM: for.cond: +; IS__TUNIT_OPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; IS__TUNIT_OPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], [[N]] +; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_END:%.*]] +; IS__TUNIT_OPM: for.body: +; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; IS__TUNIT_OPM-NEXT: br label [[FOR_COND]] +; IS__TUNIT_OPM: for.end: +; IS__TUNIT_OPM-NEXT: ret void +; +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind writeonly +; IS________NPM-LABEL: define {{[^@]+}}@recursive_load_store +; IS________NPM-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR8:[0-9]+]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: br label [[FOR_COND:%.*]] +; IS________NPM: for.cond: +; IS________NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; IS________NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], [[N]] +; IS________NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_END:%.*]] +; IS________NPM: for.body: +; IS________NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; IS________NPM-NEXT: br label [[FOR_COND]] +; IS________NPM: for.end: +; IS________NPM-NEXT: ret void ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind writeonly ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@recursive_load_store @@ -3333,21 +3168,6 @@ ; IS__CGSCC_OPM: for.end: ; IS__CGSCC_OPM-NEXT: ret void ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_load_store -; IS__CGSCC_NPM-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_NPM: for.cond: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], [[N]] -; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_END:%.*]] -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND]] -; IS__CGSCC_NPM: for.end: -; IS__CGSCC_NPM-NEXT: ret void -; entry: store i32 %v, i32* @rec_storage br label %for.cond @@ -3373,28 +3193,27 @@ ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@round_trip_malloc ; IS__TUNIT_OPM-SAME: (i32 [[X:%.*]]) { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR12:[0-9]+]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR17:[0-9]+]] ; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* ; IS__TUNIT_OPM-NEXT: store i32 [[X]], i32* [[TMP0]], align 4 ; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 ; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = bitcast i32* [[TMP0]] to i8* -; IS__TUNIT_OPM-NEXT: call void @free(i8* noundef [[TMP2]]) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: call void @free(i8* noundef [[TMP2]]) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: ret i32 [[TMP1]] ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@round_trip_malloc -; IS__TUNIT_NPM-SAME: (i32 [[X:%.*]]) { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32* -; IS__TUNIT_NPM-NEXT: store i32 [[X]], i32* [[TMP1]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4 -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP2]] +; IS________NPM-LABEL: define {{[^@]+}}@round_trip_malloc +; IS________NPM-SAME: (i32 [[X:%.*]]) { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 +; IS________NPM-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32* +; IS________NPM-NEXT: store i32 [[X]], i32* [[TMP1]], align 4 +; IS________NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4 +; IS________NPM-NEXT: ret i32 [[TMP2]] ; -; IS__CGSCC_OPM: Function Attrs: norecurse ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@round_trip_malloc -; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR11:[0-9]+]] { +; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) { ; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR11]] +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR11:[0-9]+]] ; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* ; IS__CGSCC_OPM-NEXT: store i32 [[X]], i32* [[TMP0]], align 4 ; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 @@ -3402,15 +3221,6 @@ ; IS__CGSCC_OPM-NEXT: call void @free(i8* noundef [[TMP2]]) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: ret i32 [[TMP1]] ; -; IS__CGSCC_NPM: Function Attrs: norecurse -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@round_trip_malloc -; IS__CGSCC_NPM-SAME: (i32 returned [[X:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32* -; IS__CGSCC_NPM-NEXT: store i32 [[X]], i32* [[TMP1]], align 4 -; IS__CGSCC_NPM-NEXT: ret i32 [[X]] -; entry: %call = call noalias i8* @malloc(i64 4) norecurse %0 = bitcast i8* %call to i32* @@ -3424,21 +3234,19 @@ define dso_local i32 @round_trip_malloc_constant() { ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@round_trip_malloc_constant() { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* ; IS__TUNIT_OPM-NEXT: store i32 7, i32* [[TMP0]], align 4 ; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 ; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = bitcast i32* [[TMP0]] to i8* -; IS__TUNIT_OPM-NEXT: call void @free(i8* noundef [[TMP2]]) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: call void @free(i8* noundef [[TMP2]]) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: ret i32 [[TMP1]] ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@round_trip_malloc_constant() { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: ret i32 7 +; IS________NPM-LABEL: define {{[^@]+}}@round_trip_malloc_constant() { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: ret i32 7 ; -; IS__CGSCC_OPM: Function Attrs: norecurse -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@round_trip_malloc_constant -; IS__CGSCC_OPM-SAME: () #[[ATTR11]] { +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@round_trip_malloc_constant() { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* @@ -3448,12 +3256,6 @@ ; IS__CGSCC_OPM-NEXT: call void @free(i8* noundef [[TMP2]]) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: ret i32 [[TMP1]] ; -; IS__CGSCC_NPM: Function Attrs: norecurse -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@round_trip_malloc_constant -; IS__CGSCC_NPM-SAME: () #[[ATTR9]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: ret i32 7 -; entry: %call = call noalias i8* @malloc(i64 4) norecurse %0 = bitcast i8* %call to i32* @@ -3472,7 +3274,7 @@ ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@conditional_malloc ; IS__TUNIT_OPM-SAME: (i32 [[X:%.*]]) { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* ; IS__TUNIT_OPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 ; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] @@ -3483,23 +3285,22 @@ ; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 ; IS__TUNIT_OPM-NEXT: ret i32 [[TMP1]] ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@conditional_malloc -; IS__TUNIT_NPM-SAME: (i32 [[X:%.*]]) { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32* -; IS__TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__TUNIT_NPM: if.then: -; IS__TUNIT_NPM-NEXT: store i32 [[X]], i32* [[TMP1]], align 4 -; IS__TUNIT_NPM-NEXT: br label [[IF_END]] -; IS__TUNIT_NPM: if.end: -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4 -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP2]] +; IS________NPM-LABEL: define {{[^@]+}}@conditional_malloc +; IS________NPM-SAME: (i32 [[X:%.*]]) { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 +; IS________NPM-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32* +; IS________NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 +; IS________NPM-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; IS________NPM: if.then: +; IS________NPM-NEXT: store i32 [[X]], i32* [[TMP1]], align 4 +; IS________NPM-NEXT: br label [[IF_END]] +; IS________NPM: if.end: +; IS________NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4 +; IS________NPM-NEXT: ret i32 [[TMP2]] ; -; IS__CGSCC_OPM: Function Attrs: norecurse ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@conditional_malloc -; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR11]] { +; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* @@ -3512,20 +3313,6 @@ ; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 ; IS__CGSCC_OPM-NEXT: ret i32 [[TMP1]] ; -; IS__CGSCC_NPM: Function Attrs: norecurse -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@conditional_malloc -; IS__CGSCC_NPM-SAME: (i32 returned [[X:%.*]]) #[[ATTR9]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32* -; IS__CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC_NPM: if.then: -; IS__CGSCC_NPM-NEXT: store i32 [[X]], i32* [[TMP1]], align 4 -; IS__CGSCC_NPM-NEXT: br label [[IF_END]] -; IS__CGSCC_NPM: if.end: -; IS__CGSCC_NPM-NEXT: ret i32 [[X]] -; entry: %call = call noalias i8* @malloc(i64 4) norecurse %0 = bitcast i8* %call to i32* @@ -3545,25 +3332,24 @@ ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@round_trip_calloc ; IS__TUNIT_OPM-SAME: (i32 [[X:%.*]]) { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 4, i64 noundef 1) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 4, i64 noundef 1) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* ; IS__TUNIT_OPM-NEXT: store i32 [[X]], i32* [[TMP0]], align 4 ; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 ; IS__TUNIT_OPM-NEXT: ret i32 [[TMP1]] ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@round_trip_calloc -; IS__TUNIT_NPM-SAME: (i32 [[X:%.*]]) { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* [[TMP0]], i8 0, i64 4, i1 false) -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32* -; IS__TUNIT_NPM-NEXT: store i32 [[X]], i32* [[TMP1]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4 -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP2]] +; IS________NPM-LABEL: define {{[^@]+}}@round_trip_calloc +; IS________NPM-SAME: (i32 [[X:%.*]]) { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 +; IS________NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* [[TMP0]], i8 0, i64 4, i1 false) +; IS________NPM-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32* +; IS________NPM-NEXT: store i32 [[X]], i32* [[TMP1]], align 4 +; IS________NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4 +; IS________NPM-NEXT: ret i32 [[TMP2]] ; -; IS__CGSCC_OPM: Function Attrs: norecurse ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@round_trip_calloc -; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR11]] { +; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 4, i64 noundef 1) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* @@ -3571,17 +3357,6 @@ ; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 ; IS__CGSCC_OPM-NEXT: ret i32 [[TMP1]] ; -; IS__CGSCC_NPM: Function Attrs: norecurse -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@round_trip_calloc -; IS__CGSCC_NPM-SAME: (i32 [[X:%.*]]) #[[ATTR9]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* [[TMP0]], i8 0, i64 4, i1 false) -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32* -; IS__CGSCC_NPM-NEXT: store i32 [[X]], i32* [[TMP1]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4 -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP2]] -; entry: %call = call noalias i8* @calloc(i64 4, i64 1) norecurse %0 = bitcast i8* %call to i32* @@ -3593,24 +3368,22 @@ define dso_local i32 @round_trip_calloc_constant() { ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@round_trip_calloc_constant() { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 4, i64 noundef 1) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 4, i64 noundef 1) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* ; IS__TUNIT_OPM-NEXT: store i32 11, i32* [[TMP0]], align 4 ; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 ; IS__TUNIT_OPM-NEXT: ret i32 [[TMP1]] ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@round_trip_calloc_constant() { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* [[TMP0]], i8 0, i64 4, i1 false) -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32* -; IS__TUNIT_NPM-NEXT: store i32 11, i32* [[TMP1]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4 -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP2]] +; IS________NPM-LABEL: define {{[^@]+}}@round_trip_calloc_constant() { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 +; IS________NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* [[TMP0]], i8 0, i64 4, i1 false) +; IS________NPM-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32* +; IS________NPM-NEXT: store i32 11, i32* [[TMP1]], align 4 +; IS________NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4 +; IS________NPM-NEXT: ret i32 [[TMP2]] ; -; IS__CGSCC_OPM: Function Attrs: norecurse -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@round_trip_calloc_constant -; IS__CGSCC_OPM-SAME: () #[[ATTR11]] { +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@round_trip_calloc_constant() { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 4, i64 noundef 1) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* @@ -3618,17 +3391,6 @@ ; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 ; IS__CGSCC_OPM-NEXT: ret i32 [[TMP1]] ; -; IS__CGSCC_NPM: Function Attrs: norecurse -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@round_trip_calloc_constant -; IS__CGSCC_NPM-SAME: () #[[ATTR9]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* [[TMP0]], i8 0, i64 4, i1 false) -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32* -; IS__CGSCC_NPM-NEXT: store i32 11, i32* [[TMP1]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4 -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP2]] -; entry: %call = call noalias i8* @calloc(i64 4, i64 1) norecurse %0 = bitcast i8* %call to i32* @@ -3643,7 +3405,7 @@ ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@conditional_calloc ; IS__TUNIT_OPM-SAME: (i32 [[X:%.*]]) { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 1, i64 noundef 4) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 1, i64 noundef 4) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* ; IS__TUNIT_OPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 ; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] @@ -3653,27 +3415,26 @@ ; IS__TUNIT_OPM: if.end: ; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 ; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = bitcast i32* [[TMP0]] to i8* -; IS__TUNIT_OPM-NEXT: call void @free(i8* [[TMP2]]) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: call void @free(i8* [[TMP2]]) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: ret i32 [[TMP1]] ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@conditional_calloc -; IS__TUNIT_NPM-SAME: (i32 [[X:%.*]]) { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* [[TMP0]], i8 0, i64 4, i1 false) -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32* -; IS__TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] -; IS__TUNIT_NPM: if.then: -; IS__TUNIT_NPM-NEXT: store i32 [[X]], i32* [[TMP1]], align 4 -; IS__TUNIT_NPM-NEXT: br label [[IF_END]] -; IS__TUNIT_NPM: if.end: -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4 -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP2]] +; IS________NPM-LABEL: define {{[^@]+}}@conditional_calloc +; IS________NPM-SAME: (i32 [[X:%.*]]) { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 +; IS________NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* [[TMP0]], i8 0, i64 4, i1 false) +; IS________NPM-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32* +; IS________NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 +; IS________NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; IS________NPM: if.then: +; IS________NPM-NEXT: store i32 [[X]], i32* [[TMP1]], align 4 +; IS________NPM-NEXT: br label [[IF_END]] +; IS________NPM: if.end: +; IS________NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4 +; IS________NPM-NEXT: ret i32 [[TMP2]] ; -; IS__CGSCC_OPM: Function Attrs: norecurse ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@conditional_calloc -; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR11]] { +; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 1, i64 noundef 4) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* @@ -3688,22 +3449,6 @@ ; IS__CGSCC_OPM-NEXT: call void @free(i8* [[TMP2]]) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: ret i32 [[TMP1]] ; -; IS__CGSCC_NPM: Function Attrs: norecurse -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@conditional_calloc -; IS__CGSCC_NPM-SAME: (i32 [[X:%.*]]) #[[ATTR9]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* [[TMP0]], i8 0, i64 4, i1 false) -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32* -; IS__CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] -; IS__CGSCC_NPM: if.then: -; IS__CGSCC_NPM-NEXT: store i32 [[X]], i32* [[TMP1]], align 4 -; IS__CGSCC_NPM-NEXT: br label [[IF_END]] -; IS__CGSCC_NPM: if.end: -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4 -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP2]] -; entry: %call = call noalias i8* @calloc(i64 1, i64 4) norecurse %0 = bitcast i8* %call to i32* @@ -3725,7 +3470,7 @@ ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@conditional_calloc_zero ; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 1, i64 noundef 4) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 1, i64 noundef 4) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* ; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] ; IS__TUNIT_OPM: if.then: @@ -3734,23 +3479,22 @@ ; IS__TUNIT_OPM: if.end: ; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 ; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = bitcast i32* [[TMP0]] to i8* -; IS__TUNIT_OPM-NEXT: call void @free(i8* [[TMP2]]) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: call void @free(i8* [[TMP2]]) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: ret i32 [[TMP1]] ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@conditional_calloc_zero -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* [[TMP0]], i8 0, i64 4, i1 false) -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] -; IS__TUNIT_NPM: if.then: -; IS__TUNIT_NPM-NEXT: br label [[IF_END]] -; IS__TUNIT_NPM: if.end: -; IS__TUNIT_NPM-NEXT: ret i32 0 +; IS________NPM-LABEL: define {{[^@]+}}@conditional_calloc_zero +; IS________NPM-SAME: (i1 [[C:%.*]]) { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 +; IS________NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* [[TMP0]], i8 0, i64 4, i1 false) +; IS________NPM-NEXT: br i1 [[C]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; IS________NPM: if.then: +; IS________NPM-NEXT: br label [[IF_END]] +; IS________NPM: if.end: +; IS________NPM-NEXT: ret i32 0 ; -; IS__CGSCC_OPM: Function Attrs: norecurse ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@conditional_calloc_zero -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR11]] { +; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 1, i64 noundef 4) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* @@ -3764,18 +3508,6 @@ ; IS__CGSCC_OPM-NEXT: call void @free(i8* [[TMP2]]) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: ret i32 [[TMP1]] ; -; IS__CGSCC_NPM: Function Attrs: norecurse -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@conditional_calloc_zero -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* [[TMP0]], i8 0, i64 4, i1 false) -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] -; IS__CGSCC_NPM: if.then: -; IS__CGSCC_NPM-NEXT: br label [[IF_END]] -; IS__CGSCC_NPM: if.end: -; IS__CGSCC_NPM-NEXT: ret i32 0 -; entry: %call = call noalias i8* @calloc(i64 1, i64 4) norecurse %0 = bitcast i8* %call to i32* @@ -3797,7 +3529,7 @@ ; IS__TUNIT_OPM-SAME: (i32 [[S:%.*]]) { ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: [[CONV:%.*]] = sext i32 [[S]] to i64 -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* ; IS__TUNIT_OPM-NEXT: ret i32* [[TMP0]] ; @@ -3805,25 +3537,23 @@ ; IS__TUNIT_NPM-SAME: (i32 [[S:%.*]]) { ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: [[CONV:%.*]] = sext i32 [[S]] to i64 -; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) #[[ATTR10:[0-9]+]] +; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) #[[ATTR13:[0-9]+]] ; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* ; IS__TUNIT_NPM-NEXT: ret i32* [[TMP0]] ; -; IS__CGSCC_OPM: Function Attrs: norecurse ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@malloc_like -; IS__CGSCC_OPM-SAME: (i32 [[S:%.*]]) #[[ATTR11]] { +; IS__CGSCC_OPM-SAME: (i32 [[S:%.*]]) { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[CONV:%.*]] = sext i32 [[S]] to i64 ; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* ; IS__CGSCC_OPM-NEXT: ret i32* [[TMP0]] ; -; IS__CGSCC_NPM: Function Attrs: norecurse ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@malloc_like -; IS__CGSCC_NPM-SAME: (i32 [[S:%.*]]) #[[ATTR9]] { +; IS__CGSCC_NPM-SAME: (i32 [[S:%.*]]) { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: [[CONV:%.*]] = sext i32 [[S]] to i64 -; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) #[[ATTR9:[0-9]+]] ; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32* ; IS__CGSCC_NPM-NEXT: ret i32* [[TMP0]] ; @@ -3838,26 +3568,25 @@ ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@round_trip_malloc_like ; IS__TUNIT_OPM-SAME: (i32 [[X:%.*]]) { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32* @malloc_like(i32 noundef 4) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32* @malloc_like(i32 noundef 4) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: store i32 [[X]], i32* [[CALL]], align 4 ; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4 ; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8* -; IS__TUNIT_OPM-NEXT: call void @free(i8* noundef [[TMP1]]) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: call void @free(i8* noundef [[TMP1]]) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: ret i32 [[TMP0]] ; ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@round_trip_malloc_like ; IS__TUNIT_NPM-SAME: (i32 [[X:%.*]]) { ; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @malloc_like(i32 noundef 4) #[[ATTR10]] +; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @malloc_like(i32 noundef 4) #[[ATTR13]] ; IS__TUNIT_NPM-NEXT: store i32 [[X]], i32* [[CALL]], align 4 ; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4 ; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8* -; IS__TUNIT_NPM-NEXT: call void @free(i8* noundef [[TMP1]]) #[[ATTR10]] +; IS__TUNIT_NPM-NEXT: call void @free(i8* noundef [[TMP1]]) #[[ATTR13]] ; IS__TUNIT_NPM-NEXT: ret i32 [[TMP0]] ; -; IS__CGSCC_OPM: Function Attrs: norecurse ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@round_trip_malloc_like -; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR11]] { +; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @malloc_like(i32 noundef 4) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: store i32 [[X]], i32* [[CALL]], align 4 @@ -3866,9 +3595,8 @@ ; IS__CGSCC_OPM-NEXT: call void @free(i8* noundef [[TMP1]]) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: ret i32 [[TMP0]] ; -; IS__CGSCC_NPM: Function Attrs: norecurse ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@round_trip_malloc_like -; IS__CGSCC_NPM-SAME: (i32 [[X:%.*]]) #[[ATTR9]] { +; IS__CGSCC_NPM-SAME: (i32 [[X:%.*]]) { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @malloc_like(i32 noundef 4) #[[ATTR9]] ; IS__CGSCC_NPM-NEXT: store i32 [[X]], i32* [[CALL]], align 4 @@ -3890,26 +3618,25 @@ ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@round_trip_unknown_alloc ; IS__TUNIT_OPM-SAME: (i32 [[X:%.*]]) { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32* @unknown_alloc(i32 noundef 4) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32* @unknown_alloc(i32 noundef 4) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: store i32 [[X]], i32* [[CALL]], align 4 ; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4 ; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8* -; IS__TUNIT_OPM-NEXT: call void @free(i8* noundef [[TMP1]]) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: call void @free(i8* noundef [[TMP1]]) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: ret i32 [[TMP0]] ; ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@round_trip_unknown_alloc ; IS__TUNIT_NPM-SAME: (i32 [[X:%.*]]) { ; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @unknown_alloc(i32 noundef 4) #[[ATTR10]] +; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @unknown_alloc(i32 noundef 4) #[[ATTR13]] ; IS__TUNIT_NPM-NEXT: store i32 [[X]], i32* [[CALL]], align 4 ; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4 ; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8* -; IS__TUNIT_NPM-NEXT: call void @free(i8* noundef [[TMP1]]) #[[ATTR10]] +; IS__TUNIT_NPM-NEXT: call void @free(i8* noundef [[TMP1]]) #[[ATTR13]] ; IS__TUNIT_NPM-NEXT: ret i32 [[TMP0]] ; -; IS__CGSCC_OPM: Function Attrs: norecurse ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@round_trip_unknown_alloc -; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR11]] { +; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @unknown_alloc(i32 noundef 4) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: store i32 [[X]], i32* [[CALL]], align 4 @@ -3918,9 +3645,8 @@ ; IS__CGSCC_OPM-NEXT: call void @free(i8* noundef [[TMP1]]) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: ret i32 [[TMP0]] ; -; IS__CGSCC_NPM: Function Attrs: norecurse ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@round_trip_unknown_alloc -; IS__CGSCC_NPM-SAME: (i32 [[X:%.*]]) #[[ATTR9]] { +; IS__CGSCC_NPM-SAME: (i32 [[X:%.*]]) { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @unknown_alloc(i32 noundef 4) #[[ATTR9]] ; IS__CGSCC_NPM-NEXT: store i32 [[X]], i32* [[CALL]], align 4 @@ -3944,7 +3670,7 @@ ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@conditional_unknown_alloc ; IS__TUNIT_OPM-SAME: (i32 [[X:%.*]]) { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i32* @unknown_alloc(i32 noundef 4) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noalias i32* @unknown_alloc(i32 noundef 4) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 ; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] ; IS__TUNIT_OPM: if.then: @@ -3953,13 +3679,13 @@ ; IS__TUNIT_OPM: if.end: ; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4 ; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8* -; IS__TUNIT_OPM-NEXT: call void @free(i8* [[TMP1]]) #[[ATTR12]] +; IS__TUNIT_OPM-NEXT: call void @free(i8* [[TMP1]]) #[[ATTR17]] ; IS__TUNIT_OPM-NEXT: ret i32 [[TMP0]] ; ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@conditional_unknown_alloc ; IS__TUNIT_NPM-SAME: (i32 [[X:%.*]]) { ; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call noalias i32* @unknown_alloc(i32 noundef 4) #[[ATTR10]] +; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call noalias i32* @unknown_alloc(i32 noundef 4) #[[ATTR13]] ; IS__TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 ; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] ; IS__TUNIT_NPM: if.then: @@ -3968,12 +3694,11 @@ ; IS__TUNIT_NPM: if.end: ; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4 ; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8* -; IS__TUNIT_NPM-NEXT: call void @free(i8* [[TMP1]]) #[[ATTR10]] +; IS__TUNIT_NPM-NEXT: call void @free(i8* [[TMP1]]) #[[ATTR13]] ; IS__TUNIT_NPM-NEXT: ret i32 [[TMP0]] ; -; IS__CGSCC_OPM: Function Attrs: norecurse ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@conditional_unknown_alloc -; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR11]] { +; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call noalias i32* @unknown_alloc(i32 noundef 4) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 @@ -3987,9 +3712,8 @@ ; IS__CGSCC_OPM-NEXT: call void @free(i8* [[TMP1]]) #[[ATTR11]] ; IS__CGSCC_OPM-NEXT: ret i32 [[TMP0]] ; -; IS__CGSCC_NPM: Function Attrs: norecurse ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@conditional_unknown_alloc -; IS__CGSCC_NPM-SAME: (i32 [[X:%.*]]) #[[ATTR9]] { +; IS__CGSCC_NPM-SAME: (i32 [[X:%.*]]) { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call noalias i32* @unknown_alloc(i32 noundef 4) #[[ATTR9]] ; IS__CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 @@ -4038,7 +3762,7 @@ ; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = bitcast i8* [[SRC2]] to double** ; IS__TUNIT_OPM-NEXT: store double* [[SRC]], double** [[TMP1]], align 8 ; IS__TUNIT_OPM-NEXT: store i8* [[CALL]], i8** bitcast (%struct.STy** getelementptr inbounds ([[STRUCT_STY]], %struct.STy* @global, i64 0, i32 2) to i8**), align 8 -; IS__TUNIT_OPM-NEXT: call fastcc void @nested_memory_callee() #[[ATTR13:[0-9]+]] +; IS__TUNIT_OPM-NEXT: call fastcc void @nested_memory_callee() #[[ATTR18:[0-9]+]] ; IS__TUNIT_OPM-NEXT: ret void ; ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test_nested_memory @@ -4054,11 +3778,12 @@ ; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = bitcast i8* [[SRC2]] to double** ; IS__TUNIT_NPM-NEXT: store double* [[SRC]], double** [[TMP2]], align 8 ; IS__TUNIT_NPM-NEXT: store i8* [[TMP1]], i8** bitcast (%struct.STy** getelementptr inbounds ([[STRUCT_STY]], %struct.STy* @global, i64 0, i32 2) to i8**), align 8 -; IS__TUNIT_NPM-NEXT: call fastcc void @nested_memory_callee() #[[ATTR11:[0-9]+]] +; IS__TUNIT_NPM-NEXT: call fastcc void @nested_memory_callee() #[[ATTR14:[0-9]+]] ; IS__TUNIT_NPM-NEXT: ret void ; +; IS__CGSCC_OPM: Function Attrs: norecurse ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_nested_memory -; IS__CGSCC_OPM-SAME: (float* nocapture nofree writeonly [[DST:%.*]], double* nocapture nofree readonly [[SRC:%.*]]) { +; IS__CGSCC_OPM-SAME: (float* nocapture nofree writeonly [[DST:%.*]], double* nocapture nofree readonly [[SRC:%.*]]) #[[ATTR11]] { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[LOCAL:%.*]] = alloca [[STRUCT_STY:%.*]], align 8 ; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = bitcast %struct.STy* [[LOCAL]] to i8* @@ -4073,8 +3798,9 @@ ; IS__CGSCC_OPM-NEXT: call fastcc void @nested_memory_callee() #[[ATTR16]] ; IS__CGSCC_OPM-NEXT: ret void ; +; IS__CGSCC_NPM: Function Attrs: norecurse ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_nested_memory -; IS__CGSCC_NPM-SAME: (float* nocapture nofree writeonly [[DST:%.*]], double* nocapture nofree readonly [[SRC:%.*]]) { +; IS__CGSCC_NPM-SAME: (float* nocapture nofree writeonly [[DST:%.*]], double* nocapture nofree readonly [[SRC:%.*]]) #[[ATTR9]] { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: [[LOCAL:%.*]] = alloca [[STRUCT_STY:%.*]], align 8 ; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = bitcast %struct.STy* [[LOCAL]] to i8* @@ -4106,23 +3832,23 @@ } define internal fastcc void @nested_memory_callee(%struct.STy* nocapture readonly %S) nofree norecurse nounwind uwtable { -; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@nested_memory_callee -; IS__TUNIT_OPM-SAME: () #[[ATTR9:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = load %struct.STy*, %struct.STy** getelementptr inbounds ([[STRUCT_STY:%.*]], %struct.STy* @global, i64 0, i32 2), align 8 -; IS__TUNIT_OPM-NEXT: [[SRC:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP0]], i64 0, i32 1 -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load double*, double** [[SRC]], align 8 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = load double, double* [[TMP1]], align 8 -; IS__TUNIT_OPM-NEXT: [[CONV:%.*]] = fptrunc double [[TMP2]] to float -; IS__TUNIT_OPM-NEXT: [[DST:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP0]], i64 0, i32 0 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = load float*, float** [[DST]], align 8 -; IS__TUNIT_OPM-NEXT: store float [[CONV]], float* [[TMP3]], align 4 -; IS__TUNIT_OPM-NEXT: ret void +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind uwtable willreturn +; IS________OPM-LABEL: define {{[^@]+}}@nested_memory_callee +; IS________OPM-SAME: () #[[ATTR12:[0-9]+]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: [[TMP0:%.*]] = load %struct.STy*, %struct.STy** getelementptr inbounds ([[STRUCT_STY:%.*]], %struct.STy* @global, i64 0, i32 2), align 8 +; IS________OPM-NEXT: [[SRC:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP0]], i64 0, i32 1 +; IS________OPM-NEXT: [[TMP1:%.*]] = load double*, double** [[SRC]], align 8 +; IS________OPM-NEXT: [[TMP2:%.*]] = load double, double* [[TMP1]], align 8 +; IS________OPM-NEXT: [[CONV:%.*]] = fptrunc double [[TMP2]] to float +; IS________OPM-NEXT: [[DST:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP0]], i64 0, i32 0 +; IS________OPM-NEXT: [[TMP3:%.*]] = load float*, float** [[DST]], align 8 +; IS________OPM-NEXT: store float [[CONV]], float* [[TMP3]], align 4 +; IS________OPM-NEXT: ret void ; ; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@nested_memory_callee -; IS__TUNIT_NPM-SAME: () #[[ATTR7:[0-9]+]] { +; IS__TUNIT_NPM-SAME: () #[[ATTR9:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load %struct.STy*, %struct.STy** getelementptr inbounds ([[STRUCT_STY:%.*]], %struct.STy* @global, i64 0, i32 2), align 8 ; IS__TUNIT_NPM-NEXT: [[SRC:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP0]], i64 0, i32 1 @@ -4134,20 +3860,6 @@ ; IS__TUNIT_NPM-NEXT: store float [[CONV]], float* [[TMP3]], align 4 ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nested_memory_callee -; IS__CGSCC_OPM-SAME: () #[[ATTR12:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = load %struct.STy*, %struct.STy** getelementptr inbounds ([[STRUCT_STY:%.*]], %struct.STy* @global, i64 0, i32 2), align 8 -; IS__CGSCC_OPM-NEXT: [[SRC:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP0]], i64 0, i32 1 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load double*, double** [[SRC]], align 8 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = load double, double* [[TMP1]], align 8 -; IS__CGSCC_OPM-NEXT: [[CONV:%.*]] = fptrunc double [[TMP2]] to float -; IS__CGSCC_OPM-NEXT: [[DST:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP0]], i64 0, i32 0 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = load float*, float** [[DST]], align 8 -; IS__CGSCC_OPM-NEXT: store float [[CONV]], float* [[TMP3]], align 4 -; IS__CGSCC_OPM-NEXT: ret void -; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind uwtable willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@nested_memory_callee ; IS__CGSCC_NPM-SAME: () #[[ATTR10:[0-9]+]] { @@ -4180,48 +3892,48 @@ ; Make sure the access %1 is not forwarded to the loads %2 and %3 as the indices are ; varying and the accesses thus not "exact". This used to simplify %cmp12 to true. define hidden void @no_propagation_of_unknown_index_access(i32* %in, i32* %out, i32 %idx) #0 { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@no_propagation_of_unknown_index_access -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly [[IN:%.*]], i32* nocapture nofree writeonly [[OUT:%.*]], i32 [[IDX:%.*]]) #[[ATTR10:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[BUF:%.*]] = alloca [128 x i32], align 16 -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = bitcast [128 x i32]* [[BUF]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]]) -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_OPM: for.cond: -; IS__TUNIT_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 128 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND4:%.*]] -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: [[IDXPROM:%.*]] = sext i32 [[I_0]] to i64 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[IN]], i64 [[IDXPROM]] -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[ARRAYIDX]], align 4 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM]] -; IS__TUNIT_OPM-NEXT: store i32 [[TMP1]], i32* [[ARRAYIDX2]], align 4 -; IS__TUNIT_OPM-NEXT: [[INC]] = add nsw i32 [[I_0]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[TBAA10]] -; IS__TUNIT_OPM: for.cond4: -; IS__TUNIT_OPM-NEXT: [[I3_0:%.*]] = phi i32 [ 0, [[FOR_COND_CLEANUP]] ], [ [[INC16:%.*]], [[FOR_BODY7:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[CMP5:%.*]] = icmp slt i32 [[I3_0]], 128 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP5]], label [[FOR_BODY7]], label [[FOR_COND_CLEANUP6:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup6: -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]]) -; IS__TUNIT_OPM-NEXT: ret void -; IS__TUNIT_OPM: for.body7: -; IS__TUNIT_OPM-NEXT: [[IDXPROM8:%.*]] = sext i32 [[I3_0]] to i64 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM8]] -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARRAYIDX9]], align 4 -; IS__TUNIT_OPM-NEXT: [[IDXPROM10:%.*]] = sext i32 [[IDX]] to i64 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX11:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM10]] -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[ARRAYIDX11]], align 4 -; IS__TUNIT_OPM-NEXT: [[CMP12:%.*]] = icmp sle i32 [[TMP2]], [[TMP3]] -; IS__TUNIT_OPM-NEXT: [[CONV:%.*]] = zext i1 [[CMP12]] to i32 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX14:%.*]] = getelementptr inbounds i32, i32* [[OUT]], i64 [[IDXPROM8]] -; IS__TUNIT_OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX14]], align 4 -; IS__TUNIT_OPM-NEXT: [[INC16]] = add nsw i32 [[I3_0]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND4]], !llvm.loop [[TBAA12]] +; IS________OPM: Function Attrs: argmemonly nofree nosync nounwind +; IS________OPM-LABEL: define {{[^@]+}}@no_propagation_of_unknown_index_access +; IS________OPM-SAME: (i32* nocapture nofree readonly [[IN:%.*]], i32* nocapture nofree writeonly [[OUT:%.*]], i32 [[IDX:%.*]]) #[[ATTR13:[0-9]+]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: [[BUF:%.*]] = alloca [128 x i32], align 16 +; IS________OPM-NEXT: [[TMP0:%.*]] = bitcast [128 x i32]* [[BUF]] to i8* +; IS________OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]]) +; IS________OPM-NEXT: br label [[FOR_COND:%.*]] +; IS________OPM: for.cond: +; IS________OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ] +; IS________OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 128 +; IS________OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] +; IS________OPM: for.cond.cleanup: +; IS________OPM-NEXT: br label [[FOR_COND4:%.*]] +; IS________OPM: for.body: +; IS________OPM-NEXT: [[IDXPROM:%.*]] = sext i32 [[I_0]] to i64 +; IS________OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[IN]], i64 [[IDXPROM]] +; IS________OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[ARRAYIDX]], align 4 +; IS________OPM-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM]] +; IS________OPM-NEXT: store i32 [[TMP1]], i32* [[ARRAYIDX2]], align 4 +; IS________OPM-NEXT: [[INC]] = add nsw i32 [[I_0]], 1 +; IS________OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP10:![0-9]+]] +; IS________OPM: for.cond4: +; IS________OPM-NEXT: [[I3_0:%.*]] = phi i32 [ 0, [[FOR_COND_CLEANUP]] ], [ [[INC16:%.*]], [[FOR_BODY7:%.*]] ] +; IS________OPM-NEXT: [[CMP5:%.*]] = icmp slt i32 [[I3_0]], 128 +; IS________OPM-NEXT: br i1 [[CMP5]], label [[FOR_BODY7]], label [[FOR_COND_CLEANUP6:%.*]] +; IS________OPM: for.cond.cleanup6: +; IS________OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]]) +; IS________OPM-NEXT: ret void +; IS________OPM: for.body7: +; IS________OPM-NEXT: [[IDXPROM8:%.*]] = sext i32 [[I3_0]] to i64 +; IS________OPM-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM8]] +; IS________OPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARRAYIDX9]], align 4 +; IS________OPM-NEXT: [[IDXPROM10:%.*]] = sext i32 [[IDX]] to i64 +; IS________OPM-NEXT: [[ARRAYIDX11:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM10]] +; IS________OPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[ARRAYIDX11]], align 4 +; IS________OPM-NEXT: [[CMP12:%.*]] = icmp sle i32 [[TMP2]], [[TMP3]] +; IS________OPM-NEXT: [[CONV:%.*]] = zext i1 [[CMP12]] to i32 +; IS________OPM-NEXT: [[ARRAYIDX14:%.*]] = getelementptr inbounds i32, i32* [[OUT]], i64 [[IDXPROM8]] +; IS________OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX14]], align 4 +; IS________OPM-NEXT: [[INC16]] = add nsw i32 [[I3_0]], 1 +; IS________OPM-NEXT: br label [[FOR_COND4]], !llvm.loop [[LOOP12:![0-9]+]] ; ; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@no_propagation_of_unknown_index_access @@ -4229,7 +3941,7 @@ ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: [[BUF:%.*]] = alloca [128 x i32], align 16 ; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = bitcast [128 x i32]* [[BUF]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]]) #[[ATTR9]] +; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]]) #[[ATTR11]] ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] ; IS__TUNIT_NPM: for.cond: ; IS__TUNIT_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ] @@ -4250,7 +3962,7 @@ ; IS__TUNIT_NPM-NEXT: [[CMP5:%.*]] = icmp slt i32 [[I3_0]], 128 ; IS__TUNIT_NPM-NEXT: br i1 [[CMP5]], label [[FOR_BODY7]], label [[FOR_COND_CLEANUP6:%.*]] ; IS__TUNIT_NPM: for.cond.cleanup6: -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]]) #[[ATTR9]] +; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]]) #[[ATTR11]] ; IS__TUNIT_NPM-NEXT: ret void ; IS__TUNIT_NPM: for.body7: ; IS__TUNIT_NPM-NEXT: [[IDXPROM8:%.*]] = sext i32 [[I3_0]] to i64 @@ -4266,49 +3978,6 @@ ; IS__TUNIT_NPM-NEXT: [[INC16]] = add nsw i32 [[I3_0]], 1 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND4]], !llvm.loop [[TBAA12]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@no_propagation_of_unknown_index_access -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readonly [[IN:%.*]], i32* nocapture nofree writeonly [[OUT:%.*]], i32 [[IDX:%.*]]) #[[ATTR13:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[BUF:%.*]] = alloca [128 x i32], align 16 -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = bitcast [128 x i32]* [[BUF]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]]) -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_OPM: for.cond: -; IS__CGSCC_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 128 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND4:%.*]] -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: [[IDXPROM:%.*]] = sext i32 [[I_0]] to i64 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[IN]], i64 [[IDXPROM]] -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[ARRAYIDX]], align 4 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM]] -; IS__CGSCC_OPM-NEXT: store i32 [[TMP1]], i32* [[ARRAYIDX2]], align 4 -; IS__CGSCC_OPM-NEXT: [[INC]] = add nsw i32 [[I_0]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[TBAA10]] -; IS__CGSCC_OPM: for.cond4: -; IS__CGSCC_OPM-NEXT: [[I3_0:%.*]] = phi i32 [ 0, [[FOR_COND_CLEANUP]] ], [ [[INC16:%.*]], [[FOR_BODY7:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[CMP5:%.*]] = icmp slt i32 [[I3_0]], 128 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP5]], label [[FOR_BODY7]], label [[FOR_COND_CLEANUP6:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup6: -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]]) -; IS__CGSCC_OPM-NEXT: ret void -; IS__CGSCC_OPM: for.body7: -; IS__CGSCC_OPM-NEXT: [[IDXPROM8:%.*]] = sext i32 [[I3_0]] to i64 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM8]] -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARRAYIDX9]], align 4 -; IS__CGSCC_OPM-NEXT: [[IDXPROM10:%.*]] = sext i32 [[IDX]] to i64 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX11:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM10]] -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[ARRAYIDX11]], align 4 -; IS__CGSCC_OPM-NEXT: [[CMP12:%.*]] = icmp sle i32 [[TMP2]], [[TMP3]] -; IS__CGSCC_OPM-NEXT: [[CONV:%.*]] = zext i1 [[CMP12]] to i32 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX14:%.*]] = getelementptr inbounds i32, i32* [[OUT]], i64 [[IDXPROM8]] -; IS__CGSCC_OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX14]], align 4 -; IS__CGSCC_OPM-NEXT: [[INC16]] = add nsw i32 [[I3_0]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND4]], !llvm.loop [[TBAA12]] -; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@no_propagation_of_unknown_index_access ; IS__CGSCC_NPM-SAME: (i32* nocapture nofree readonly [[IN:%.*]], i32* nocapture nofree writeonly [[OUT:%.*]], i32 [[IDX:%.*]]) #[[ATTR1]] { @@ -4435,33 +4104,41 @@ !30 = distinct !{!30, !17} !31 = distinct !{!31, !17} ;. -; IS__TUNIT_OPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } ; IS__TUNIT_OPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } ; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind } -; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__TUNIT_OPM: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR6]] = { nofree nosync nounwind writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR7]] = { nofree nosync nounwind readonly willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR8]] = { nofree nosync nounwind readnone } -; IS__TUNIT_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind uwtable willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR10]] = { argmemonly nofree nosync nounwind } -; IS__TUNIT_OPM: attributes #[[ATTR11]] = { willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR12]] = { norecurse } -; IS__TUNIT_OPM: attributes #[[ATTR13]] = { nounwind } +; IS__TUNIT_OPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind writeonly } +; IS__TUNIT_OPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR8]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind } +; IS__TUNIT_OPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind readnone } +; IS__TUNIT_OPM: attributes #[[ATTR12]] = { nofree norecurse nosync nounwind uwtable willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR13]] = { argmemonly nofree nosync nounwind } +; IS__TUNIT_OPM: attributes #[[ATTR14]] = { willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR15]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes #[[ATTR16]] = { nofree nosync nounwind writeonly } +; IS__TUNIT_OPM: attributes #[[ATTR17]] = { norecurse } +; IS__TUNIT_OPM: attributes #[[ATTR18]] = { nounwind } ;. -; IS__TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } ; IS__TUNIT_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } ; IS__TUNIT_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_NPM: attributes #[[ATTR5]] = { nofree nosync nounwind readonly willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR6]] = { nofree nosync nounwind writeonly } -; IS__TUNIT_NPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind uwtable willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR8:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } -; IS__TUNIT_NPM: attributes #[[ATTR9]] = { willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR10]] = { norecurse } -; IS__TUNIT_NPM: attributes #[[ATTR11]] = { nounwind } +; IS__TUNIT_NPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__TUNIT_NPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind writeonly } +; IS__TUNIT_NPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind uwtable willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR10:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; IS__TUNIT_NPM: attributes #[[ATTR11]] = { willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR12]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_NPM: attributes #[[ATTR13]] = { norecurse } +; IS__TUNIT_NPM: attributes #[[ATTR14]] = { nounwind } ;. ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind 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 @@ -54,59 +54,36 @@ ; TEST 2 : Simplify return value define i32 @return0() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@return0 -; IS__TUNIT____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@return0 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@return0 +; CHECK-SAME: () #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: ret i32 0 ; ret i32 0 } define i32 @return1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@return1 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32 1 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@return1 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 1 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@return1 +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i32 1 ; ret i32 1 } define i32 @test2_1(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2_1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] -; IS__TUNIT____: if.true: -; IS__TUNIT____-NEXT: [[RET0:%.*]] = add i32 0, 1 -; IS__TUNIT____-NEXT: br label [[END:%.*]] -; IS__TUNIT____: if.false: -; IS__TUNIT____-NEXT: br label [[END]] -; IS__TUNIT____: end: -; IS__TUNIT____-NEXT: [[RET:%.*]] = phi i32 [ [[RET0]], [[IF_TRUE]] ], [ 1, [[IF_FALSE]] ] -; IS__TUNIT____-NEXT: ret i32 1 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2_1 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] -; IS__CGSCC____: if.true: -; IS__CGSCC____-NEXT: [[RET0:%.*]] = add i32 0, 1 -; IS__CGSCC____-NEXT: br label [[END:%.*]] -; IS__CGSCC____: if.false: -; IS__CGSCC____-NEXT: br label [[END]] -; IS__CGSCC____: end: -; IS__CGSCC____-NEXT: [[RET:%.*]] = phi i32 [ [[RET0]], [[IF_TRUE]] ], [ 1, [[IF_FALSE]] ] -; IS__CGSCC____-NEXT: ret i32 1 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test2_1 +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] +; CHECK: if.true: +; CHECK-NEXT: [[RET0:%.*]] = add i32 0, 1 +; CHECK-NEXT: br label [[END:%.*]] +; CHECK: if.false: +; CHECK-NEXT: br label [[END]] +; CHECK: end: +; CHECK-NEXT: [[RET:%.*]] = phi i32 [ [[RET0]], [[IF_TRUE]] ], [ 1, [[IF_FALSE]] ] +; CHECK-NEXT: ret i32 1 ; br i1 %c, label %if.true, label %if.false if.true: @@ -126,15 +103,10 @@ define i32 @test2_2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2_2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32 1 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2_2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 1 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test2_2 +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret i32 1 ; %ret = tail call i32 @test2_1(i1 %c) ret i32 %ret @@ -225,23 +197,14 @@ } define i32 @ipccp1(i32 %a) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp1 -; IS__TUNIT____-SAME: (i32 returned [[A:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: br i1 true, label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: ret i32 [[A]] -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp1 -; IS__CGSCC____-SAME: (i32 returned [[A:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: br i1 true, label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i32 [[A]] -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@ipccp1 +; CHECK-SAME: (i32 returned [[A:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: br i1 true, label [[T:%.*]], label [[F:%.*]] +; CHECK: t: +; CHECK-NEXT: ret i32 [[A]] +; CHECK: f: +; CHECK-NEXT: unreachable ; br i1 true, label %t, label %f t: @@ -270,15 +233,10 @@ } define i1 @ipccp2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp2 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 true -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp2 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 true +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@ipccp2 +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i1 true ; %r = call i1 @ipccp2i(i1 true) ret i1 %r @@ -303,15 +261,10 @@ } define i1 @ipccp2b() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp2b -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 true -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp2b -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 true +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@ipccp2b +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i1 true ; %r = call i1 @ipccp2ib(i1 true) ret i1 %r @@ -337,15 +290,10 @@ } define i32 @ipccp3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp3 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32 7 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp3 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 7 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@ipccp3 +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i32 7 ; %r = call i32 @ipccp3i(i32 7) ret i32 %r @@ -388,23 +336,14 @@ } define i32 @ipccp4(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp4 -; 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]] -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp4 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: br label [[F]] -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@ipccp4 +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CHECK: t: +; CHECK-NEXT: br label [[F]] +; CHECK: f: +; CHECK-NEXT: ret i32 0 ; br i1 %c, label %t, label %f t: @@ -418,7 +357,7 @@ ; Do not touch complicated arguments (for now) %struct.X = type { i8* } define internal i32* @test_inalloca(i32* inalloca(i32) %a) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_inalloca ; IS__TUNIT____-SAME: (i32* noalias nofree nonnull returned writeonly inalloca(i32) dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { ; IS__TUNIT____-NEXT: ret i32* [[A]] @@ -431,11 +370,17 @@ ret i32* %a } define i32* @complicated_args_inalloca(i32* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@complicated_args_inalloca -; IS__TUNIT____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call nonnull dereferenceable(4) i32* @test_inalloca(i32* noalias nofree writeonly inalloca(i32) "no-capture-maybe-returned" [[ARG]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: ret i32* [[CALL]] +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_inalloca +; IS__TUNIT_OPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] { +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call nonnull dereferenceable(4) i32* @test_inalloca(i32* noalias nofree writeonly inalloca(i32) "no-capture-maybe-returned" [[ARG]]) #[[ATTR5:[0-9]+]] +; IS__TUNIT_OPM-NEXT: ret i32* [[CALL]] +; +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_inalloca +; IS__TUNIT_NPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] { +; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call nonnull dereferenceable(4) i32* @test_inalloca(i32* noalias nofree writeonly inalloca(i32) "no-capture-maybe-returned" [[ARG]]) #[[ATTR4:[0-9]+]] +; IS__TUNIT_NPM-NEXT: ret i32* [[CALL]] ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@complicated_args_inalloca @@ -447,15 +392,10 @@ } define internal i32* @test_preallocated(i32* preallocated(i32) %a) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_preallocated -; IS__TUNIT____-SAME: (i32* noalias nofree noundef nonnull returned writeonly preallocated(i32) align 4294967296 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32* [[A]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_preallocated -; IS__CGSCC____-SAME: (i32* noalias nofree noundef nonnull returned writeonly preallocated(i32) align 4294967296 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32* [[A]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test_preallocated +; CHECK-SAME: (i32* noalias nofree noundef nonnull returned writeonly preallocated(i32) align 4294967296 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret i32* [[A]] ; ret i32* %a } @@ -463,27 +403,27 @@ ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_preallocated ; IS__TUNIT_OPM-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR5:[0-9]+]] -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noundef nonnull align 4294967296 dereferenceable(4) i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 4294967296 null) #[[ATTR1]] [ "preallocated"(token [[C]]) ] +; IS__TUNIT_OPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR6:[0-9]+]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noundef nonnull align 4294967296 dereferenceable(4) i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 4294967296 null) #[[ATTR5]] [ "preallocated"(token [[C]]) ] ; IS__TUNIT_OPM-NEXT: ret i32* [[CALL]] ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_preallocated ; IS__TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR4:[0-9]+]] -; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call noundef nonnull align 4294967296 dereferenceable(4) i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 4294967296 null) #[[ATTR1]] [ "preallocated"(token [[C]]) ] +; IS__TUNIT_NPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR5:[0-9]+]] +; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call noundef nonnull align 4294967296 dereferenceable(4) i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 4294967296 null) #[[ATTR4]] [ "preallocated"(token [[C]]) ] ; IS__TUNIT_NPM-NEXT: ret i32* [[CALL]] ; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_preallocated -; IS__CGSCC_OPM-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR5:[0-9]+]] +; IS__CGSCC_OPM-SAME: () #[[ATTR2:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR6:[0-9]+]] ; IS__CGSCC_OPM-NEXT: ret i32* null ; -; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_preallocated -; IS__CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR4:[0-9]+]] +; IS__CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR5:[0-9]+]] ; IS__CGSCC_NPM-NEXT: ret i32* null ; %c = call token @llvm.call.preallocated.setup(i32 1) @@ -493,7 +433,7 @@ define internal void @test_sret(%struct.X* sret(%struct.X) %a, %struct.X** %b) { ; -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_sret ; IS__TUNIT____-SAME: (%struct.X* noalias nofree noundef nonnull writeonly sret([[STRUCT_X:%.*]]) align 4294967296 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 @@ -501,7 +441,7 @@ ; ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__CGSCC____-LABEL: define {{[^@]+}}@test_sret -; IS__CGSCC____-SAME: (%struct.X* noalias nofree noundef nonnull writeonly sret([[STRUCT_X:%.*]]) align 4294967296 dereferenceable(8) [[A:%.*]], %struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR2:[0-9]+]] { +; IS__CGSCC____-SAME: (%struct.X* noalias nofree noundef nonnull writeonly sret([[STRUCT_X:%.*]]) align 4294967296 dereferenceable(8) [[A:%.*]], %struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR3:[0-9]+]] { ; IS__CGSCC____-NEXT: store %struct.X* [[A]], %struct.X** [[B]], align 8 ; IS__CGSCC____-NEXT: ret void ; @@ -512,15 +452,21 @@ define void @complicated_args_sret(%struct.X** %b) { ; ; -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@complicated_args_sret -; IS__TUNIT____-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly sret([[STRUCT_X:%.*]]) align 4294967296 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) #[[ATTR3:[0-9]+]] -; IS__TUNIT____-NEXT: ret void +; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_sret +; 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 4294967296 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) #[[ATTR7:[0-9]+]] +; IS__TUNIT_OPM-NEXT: ret void +; +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_sret +; 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 4294967296 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) #[[ATTR6:[0-9]+]] +; IS__TUNIT_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__CGSCC____-LABEL: define {{[^@]+}}@complicated_args_sret -; IS__CGSCC____-SAME: (%struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR2]] { +; IS__CGSCC____-SAME: (%struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR3]] { ; IS__CGSCC____-NEXT: unreachable ; call void @test_sret(%struct.X* sret(%struct.X) null, %struct.X** %b) @@ -536,15 +482,10 @@ ret %struct.X* %a } define %struct.X* @complicated_args_nest() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@complicated_args_nest -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret %struct.X* null -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@complicated_args_nest -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret %struct.X* null +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@complicated_args_nest +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret %struct.X* null ; %call = call %struct.X* @test_nest(%struct.X* null) ret %struct.X* %call @@ -552,14 +493,14 @@ @S = external global %struct.X define internal void @test_byval(%struct.X* byval(%struct.X) %a) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test_byval ; IS__TUNIT_OPM-SAME: (%struct.X* noalias nocapture nofree noundef nonnull writeonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR2]] { ; IS__TUNIT_OPM-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A]], i32 0, i32 0 ; IS__TUNIT_OPM-NEXT: store i8* null, i8** [[G0]], align 8 ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test_byval ; IS__TUNIT_NPM-SAME: (i8* [[TMP0:%.*]]) #[[ATTR2]] { ; IS__TUNIT_NPM-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8 @@ -571,7 +512,7 @@ ; ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_byval -; IS__CGSCC_OPM-SAME: (%struct.X* noalias nocapture nofree noundef nonnull writeonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR2]] { +; IS__CGSCC_OPM-SAME: (%struct.X* noalias nocapture nofree noundef nonnull writeonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR3]] { ; IS__CGSCC_OPM-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A]], i32 0, i32 0 ; IS__CGSCC_OPM-NEXT: store i8* null, i8** [[G0]], align 8 ; IS__CGSCC_OPM-NEXT: ret void @@ -589,24 +530,24 @@ ret void } define void @complicated_args_byval() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_byval -; IS__TUNIT_OPM-SAME: () #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: call void @test_byval(%struct.X* nocapture nofree noundef nonnull readonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) @S) #[[ATTR3]] +; IS__TUNIT_OPM-SAME: () #[[ATTR3:[0-9]+]] { +; IS__TUNIT_OPM-NEXT: call void @test_byval(%struct.X* nocapture nofree noundef nonnull readonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) @S) #[[ATTR7]] ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_byval -; IS__TUNIT_NPM-SAME: () #[[ATTR3]] { +; IS__TUNIT_NPM-SAME: () #[[ATTR3:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: [[S_CAST:%.*]] = bitcast %struct.X* @S to i8** ; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i8*, i8** [[S_CAST]], align 8 -; IS__TUNIT_NPM-NEXT: call void @test_byval(i8* [[TMP1]]) #[[ATTR3]] +; IS__TUNIT_NPM-NEXT: call void @test_byval(i8* [[TMP1]]) #[[ATTR6]] ; IS__TUNIT_NPM-NEXT: ret void ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_byval ; IS__CGSCC_OPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: call void @test_byval(%struct.X* noalias nocapture nofree noundef nonnull readnone byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) @S) #[[ATTR6:[0-9]+]] +; IS__CGSCC_OPM-NEXT: call void @test_byval(%struct.X* noalias nocapture nofree noundef nonnull readnone byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) @S) #[[ATTR7:[0-9]+]] ; IS__CGSCC_OPM-NEXT: ret void ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn @@ -679,30 +620,30 @@ } 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:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_OPM: for.cond: -; IS__TUNIT_OPM-NEXT: [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[J_0]], 30 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]] -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: switch i32 [[J_0]], label [[SW_EPILOG]] [ -; IS__TUNIT_OPM-NEXT: i32 1, label [[SW_BB:%.*]] -; IS__TUNIT_OPM-NEXT: ] -; IS__TUNIT_OPM: sw.bb: -; IS__TUNIT_OPM-NEXT: br label [[SW_EPILOG]] -; IS__TUNIT_OPM: sw.epilog: -; IS__TUNIT_OPM-NEXT: [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ] -; IS__TUNIT_OPM-NEXT: store i32 [[X_0]], i32* [[P]], align 4 -; IS__TUNIT_OPM-NEXT: [[INC]] = add nsw i32 [[J_0]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND]] -; IS__TUNIT_OPM: for.end: -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; IS________OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly +; IS________OPM-LABEL: define {{[^@]+}}@fixpoint_changed +; IS________OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR4:[0-9]+]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: br label [[FOR_COND:%.*]] +; IS________OPM: for.cond: +; IS________OPM-NEXT: [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ] +; IS________OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[J_0]], 30 +; IS________OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]] +; IS________OPM: for.body: +; IS________OPM-NEXT: switch i32 [[J_0]], label [[SW_EPILOG]] [ +; IS________OPM-NEXT: i32 1, label [[SW_BB:%.*]] +; IS________OPM-NEXT: ] +; IS________OPM: sw.bb: +; IS________OPM-NEXT: br label [[SW_EPILOG]] +; IS________OPM: sw.epilog: +; IS________OPM-NEXT: [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ] +; IS________OPM-NEXT: store i32 [[X_0]], i32* [[P]], align 4 +; IS________OPM-NEXT: [[INC]] = add nsw i32 [[J_0]], 1 +; IS________OPM-NEXT: br label [[FOR_COND]] +; IS________OPM: for.end: +; IS________OPM-NEXT: ret void +; +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fixpoint_changed ; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR2]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -725,32 +666,9 @@ ; IS__TUNIT_NPM: for.end: ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fixpoint_changed -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_OPM: for.cond: -; IS__CGSCC_OPM-NEXT: [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[J_0]], 30 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]] -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: switch i32 [[J_0]], label [[SW_EPILOG]] [ -; IS__CGSCC_OPM-NEXT: i32 1, label [[SW_BB:%.*]] -; IS__CGSCC_OPM-NEXT: ] -; IS__CGSCC_OPM: sw.bb: -; IS__CGSCC_OPM-NEXT: br label [[SW_EPILOG]] -; IS__CGSCC_OPM: sw.epilog: -; IS__CGSCC_OPM-NEXT: [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ] -; IS__CGSCC_OPM-NEXT: store i32 [[X_0]], i32* [[P]], align 4 -; IS__CGSCC_OPM-NEXT: [[INC]] = add nsw i32 [[J_0]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]] -; IS__CGSCC_OPM: for.end: -; IS__CGSCC_OPM-NEXT: ret void -; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fixpoint_changed -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR2]] { +; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR3]] { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] ; IS__CGSCC_NPM: for.cond: @@ -799,85 +717,55 @@ ; Check we merge undef and a constant properly. define i8 @caller0() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller0 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 49 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller0 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 49 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@caller0 +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i8 49 ; %c = call i8 @callee(i8 undef) ret i8 %c } define i8 @caller1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller1 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 49 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller1 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 49 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@caller1 +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i8 49 ; %c = call i8 @callee(i8 undef) ret i8 %c } define i8 @caller2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller2 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 49 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller2 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 49 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@caller2 +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i8 49 ; %c = call i8 @callee(i8 undef) ret i8 %c } define i8 @caller_middle() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller_middle -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 49 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller_middle -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 49 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@caller_middle +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i8 49 ; %c = call i8 @callee(i8 42) ret i8 %c } define i8 @caller3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller3 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 49 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller3 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 49 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@caller3 +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i8 49 ; %c = call i8 @callee(i8 undef) ret i8 %c } define i8 @caller4() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller4 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 49 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller4 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 49 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@caller4 +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i8 49 ; %c = call i8 @callee(i8 undef) ret i8 %c @@ -893,21 +781,21 @@ } define void @user_as3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@user_as3 -; IS__TUNIT____-SAME: () #[[ATTR3]] { +; IS__TUNIT____-SAME: () #[[ATTR3:[0-9]+]] { ; IS__TUNIT____-NEXT: store i32 0, i32 addrspace(3)* @ConstAS3Ptr, align 4 ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@user_as3 -; IS__CGSCC_OPM-SAME: () #[[ATTR4:[0-9]+]] { +; IS__CGSCC_OPM-SAME: () #[[ATTR5:[0-9]+]] { ; IS__CGSCC_OPM-NEXT: store i32 0, i32 addrspace(3)* @ConstAS3Ptr, align 4 ; IS__CGSCC_OPM-NEXT: ret void ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@user_as3 -; IS__CGSCC_NPM-SAME: () #[[ATTR3:[0-9]+]] { +; IS__CGSCC_NPM-SAME: () #[[ATTR4:[0-9]+]] { ; IS__CGSCC_NPM-NEXT: store i32 0, i32 addrspace(3)* @ConstAS3Ptr, align 4 ; IS__CGSCC_NPM-NEXT: ret void ; @@ -916,7 +804,7 @@ ret void } define void @user() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly +; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@user ; IS__TUNIT____-SAME: () #[[ATTR3]] { ; IS__TUNIT____-NEXT: store i32 0, i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*), align 4 @@ -924,13 +812,13 @@ ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@user -; IS__CGSCC_OPM-SAME: () #[[ATTR4]] { +; IS__CGSCC_OPM-SAME: () #[[ATTR5]] { ; IS__CGSCC_OPM-NEXT: store i32 0, i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*), align 4 ; IS__CGSCC_OPM-NEXT: ret void ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@user -; IS__CGSCC_NPM-SAME: () #[[ATTR3]] { +; IS__CGSCC_NPM-SAME: () #[[ATTR4]] { ; IS__CGSCC_NPM-NEXT: store i32 0, i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*), align 4 ; IS__CGSCC_NPM-NEXT: ret void ; @@ -941,15 +829,10 @@ define i1 @test_merge_with_undef_values_ptr(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 false -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 false +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret i1 false ; %r1 = call i1 @undef_then_null(i1 %c, i32* undef, i32* undef) ret i1 %r1 @@ -976,15 +859,10 @@ } define i1 @test_merge_with_undef_values(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_merge_with_undef_values -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 false -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_merge_with_undef_values -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 false +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test_merge_with_undef_values +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret i1 false ; %r1 = call i1 @undef_then_1(i1 %c, i32 undef, i32 undef) ret i1 %r1 @@ -1012,15 +890,10 @@ } define i32 @test_select(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_select -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32 42 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_select -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 42 +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test_select +; CHECK-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret i32 42 ; %call = call i32 @select(i1 1, i32 42, i32 %c) ret i32 %call @@ -1037,15 +910,10 @@ } define i1 @icmp() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@icmp -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 true -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@icmp -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 true +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@icmp +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i1 true ; %c = icmp eq i8* null, null ret i1 %c @@ -1097,7 +965,7 @@ @g = internal constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (void (i8***)* @f1 to i8*), i8* bitcast (void (i1 (i8*)*)* @f2 to i8*)] } define internal void @f1(i8*** %a) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@f1 ; IS__TUNIT____-SAME: (i8*** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR2]] { ; IS__TUNIT____-NEXT: entry: @@ -1107,7 +975,7 @@ ; ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__CGSCC____-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC____-SAME: (i8*** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR2]] { +; IS__CGSCC____-SAME: (i8*** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR3]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: [[X:%.*]] = getelementptr { [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0 ; IS__CGSCC____-NEXT: store i8** [[X]], i8*** [[A]], align 8 @@ -1170,15 +1038,10 @@ define i1 @test_cmp_null_after_cast() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_cmp_null_after_cast -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 true -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_cmp_null_after_cast -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 true +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@test_cmp_null_after_cast +; CHECK-SAME: () #[[ATTR1]] { +; CHECK-NEXT: ret i1 true ; %c = call i1 @cmp_null_after_cast(i32 0, i8 0) ret i1 %c @@ -1271,31 +1134,37 @@ ;. ; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR5]] = { willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind writeonly } +; IS__TUNIT_OPM: attributes #[[ATTR5]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR6]] = { willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn writeonly } ;. ; IS__TUNIT_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_NPM: attributes #[[ATTR4]] = { willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__TUNIT_NPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__TUNIT_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR5]] = { willreturn } +; IS__TUNIT_NPM: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn writeonly } ;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR0:[0-9]+]] = { nofree nosync nounwind willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR5]] = { willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR6]] = { nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR6]] = { willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nounwind willreturn writeonly } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR0:[0-9]+]] = { nofree nosync nounwind willreturn } ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR4]] = { willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_NPM: attributes #[[ATTR5]] = { willreturn } ;. ; CHECK: [[RNG0]] = !{i32 0, i32 -2147483648} ;. diff --git a/llvm/test/Transforms/Attributor/willreturn.ll b/llvm/test/Transforms/Attributor/willreturn.ll --- a/llvm/test/Transforms/Attributor/willreturn.ll +++ b/llvm/test/Transforms/Attributor/willreturn.ll @@ -12,15 +12,10 @@ ; TEST 1 (positive case) define void @only_return() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@only_return -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@only_return -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@only_return +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: ret void ; ret void } @@ -35,65 +30,35 @@ ; FIXME: missing willreturn define i32 @fib(i32 %0) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fib -; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] -; IS__TUNIT_OPM: 3: -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR15:[0-9]+]] -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR15]] -; IS__TUNIT_OPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP8]] -; IS__TUNIT_OPM: 9: -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP0]] -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fib -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] -; IS__TUNIT_NPM: 3: -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR16:[0-9]+]] -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR16]] -; IS__TUNIT_NPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP8]] -; IS__TUNIT_NPM: 9: -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP0]] -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fib -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR26:[0-9]+]] -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR26]] -; IS__CGSCC_OPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP8]] -; IS__CGSCC_OPM: 9: -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP0]] -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fib -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR28:[0-9]+]] -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR28]] -; IS__CGSCC_NPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP8]] -; IS__CGSCC_NPM: 9: -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP0]] +; IS________OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS________OPM-LABEL: define {{[^@]+}}@fib +; IS________OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { +; IS________OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 +; IS________OPM-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] +; IS________OPM: 3: +; IS________OPM-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 +; IS________OPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR25:[0-9]+]] +; IS________OPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 +; IS________OPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR25]] +; IS________OPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] +; IS________OPM-NEXT: ret i32 [[TMP8]] +; IS________OPM: 9: +; IS________OPM-NEXT: ret i32 [[TMP0]] +; +; IS________NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS________NPM-LABEL: define {{[^@]+}}@fib +; IS________NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { +; IS________NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 +; IS________NPM-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] +; IS________NPM: 3: +; IS________NPM-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 +; IS________NPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR27:[0-9]+]] +; IS________NPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 +; IS________NPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR27]] +; IS________NPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] +; IS________NPM-NEXT: ret i32 [[TMP8]] +; IS________NPM: 9: +; IS________NPM-NEXT: ret i32 [[TMP0]] ; %2 = icmp slt i32 %0, 2 br i1 %2, label %9, label %3 @@ -121,41 +86,23 @@ ; fact_maybe_not(-1) doesn't stop. define i32 @fact_maybe_not_halt(i32 %0) local_unnamed_addr #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@fact_maybe_not_halt -; IS__TUNIT____-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__TUNIT____-NEXT: br i1 [[TMP2]], label [[TMP11:%.*]], label [[TMP3:%.*]] -; IS__TUNIT____: 3: -; IS__TUNIT____-NEXT: [[TMP4:%.*]] = phi i32 [ [[TMP8:%.*]], [[TMP3]] ], [ [[TMP0]], [[TMP1:%.*]] ] -; IS__TUNIT____-NEXT: [[TMP5:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP3]] ], [ 1, [[TMP1]] ] -; IS__TUNIT____-NEXT: [[TMP6:%.*]] = icmp sgt i32 [[TMP4]], 0 -; IS__TUNIT____-NEXT: [[TMP7:%.*]] = sext i1 [[TMP6]] to i32 -; IS__TUNIT____-NEXT: [[TMP8]] = add nsw i32 [[TMP4]], [[TMP7]] -; IS__TUNIT____-NEXT: [[TMP9]] = mul nsw i32 [[TMP4]], [[TMP5]] -; IS__TUNIT____-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP8]], 0 -; IS__TUNIT____-NEXT: br i1 [[TMP10]], label [[TMP11]], label [[TMP3]] -; IS__TUNIT____: 11: -; IS__TUNIT____-NEXT: [[TMP12:%.*]] = phi i32 [ 1, [[TMP1]] ], [ [[TMP9]], [[TMP3]] ] -; IS__TUNIT____-NEXT: ret i32 [[TMP12]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@fact_maybe_not_halt -; IS__CGSCC____-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__CGSCC____-NEXT: br i1 [[TMP2]], label [[TMP11:%.*]], label [[TMP3:%.*]] -; IS__CGSCC____: 3: -; IS__CGSCC____-NEXT: [[TMP4:%.*]] = phi i32 [ [[TMP8:%.*]], [[TMP3]] ], [ [[TMP0]], [[TMP1:%.*]] ] -; IS__CGSCC____-NEXT: [[TMP5:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP3]] ], [ 1, [[TMP1]] ] -; IS__CGSCC____-NEXT: [[TMP6:%.*]] = icmp sgt i32 [[TMP4]], 0 -; IS__CGSCC____-NEXT: [[TMP7:%.*]] = sext i1 [[TMP6]] to i32 -; IS__CGSCC____-NEXT: [[TMP8]] = add nsw i32 [[TMP4]], [[TMP7]] -; IS__CGSCC____-NEXT: [[TMP9]] = mul nsw i32 [[TMP4]], [[TMP5]] -; IS__CGSCC____-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP8]], 0 -; IS__CGSCC____-NEXT: br i1 [[TMP10]], label [[TMP11]], label [[TMP3]] -; IS__CGSCC____: 11: -; IS__CGSCC____-NEXT: [[TMP12:%.*]] = phi i32 [ 1, [[TMP1]] ], [ [[TMP9]], [[TMP3]] ] -; IS__CGSCC____-NEXT: ret i32 [[TMP12]] +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable +; CHECK-LABEL: define {{[^@]+}}@fact_maybe_not_halt +; CHECK-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] { +; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0]], 0 +; CHECK-NEXT: br i1 [[TMP2]], label [[TMP11:%.*]], label [[TMP3:%.*]] +; CHECK: 3: +; CHECK-NEXT: [[TMP4:%.*]] = phi i32 [ [[TMP8:%.*]], [[TMP3]] ], [ [[TMP0]], [[TMP1:%.*]] ] +; CHECK-NEXT: [[TMP5:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP3]] ], [ 1, [[TMP1]] ] +; CHECK-NEXT: [[TMP6:%.*]] = icmp sgt i32 [[TMP4]], 0 +; CHECK-NEXT: [[TMP7:%.*]] = sext i1 [[TMP6]] to i32 +; CHECK-NEXT: [[TMP8]] = add nsw i32 [[TMP4]], [[TMP7]] +; CHECK-NEXT: [[TMP9]] = mul nsw i32 [[TMP4]], [[TMP5]] +; CHECK-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP8]], 0 +; CHECK-NEXT: br i1 [[TMP10]], label [[TMP11]], label [[TMP3]] +; CHECK: 11: +; CHECK-NEXT: [[TMP12:%.*]] = phi i32 [ 1, [[TMP1]] ], [ [[TMP9]], [[TMP3]] ] +; CHECK-NEXT: ret i32 [[TMP12]] ; %2 = icmp eq i32 %0, 0 br i1 %2, label %11, label %3 @@ -187,69 +134,37 @@ ; } define i32 @fact_loop(i32 %0) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fact_loop -; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__TUNIT_OPM: 3: -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP4]] -; IS__TUNIT_OPM: 5: -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_OPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__TUNIT_OPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__TUNIT_OPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__TUNIT_OPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fact_loop -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__TUNIT_NPM: 3: -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP4]] -; IS__TUNIT_NPM: 5: -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__TUNIT_NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__TUNIT_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__TUNIT_NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fact_loop -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP4]] -; IS__CGSCC_OPM: 5: -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_OPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__CGSCC_OPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fact_loop -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP4]] -; IS__CGSCC_NPM: 5: -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__CGSCC_NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__CGSCC_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__CGSCC_NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] +; IS________OPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable +; IS________OPM-LABEL: define {{[^@]+}}@fact_loop +; IS________OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { +; IS________OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 +; IS________OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; IS________OPM: 3: +; IS________OPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] +; IS________OPM-NEXT: ret i32 [[TMP4]] +; IS________OPM: 5: +; IS________OPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] +; IS________OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] +; IS________OPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] +; IS________OPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 +; IS________OPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] +; IS________OPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] +; +; IS________NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; IS________NPM-LABEL: define {{[^@]+}}@fact_loop +; IS________NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; IS________NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 +; IS________NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; IS________NPM: 3: +; IS________NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] +; IS________NPM-NEXT: ret i32 [[TMP4]] +; IS________NPM: 5: +; IS________NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] +; IS________NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] +; IS________NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] +; IS________NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 +; IS________NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] +; IS________NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] ; %2 = icmp slt i32 %0, 1 br i1 %2, label %3, label %5 @@ -279,49 +194,27 @@ declare void @sink() nounwind willreturn nosync nofree define void @mutual_recursion1(i1 %c) #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__TUNIT_OPM: rec: -; IS__TUNIT_OPM-NEXT: call void @sink() #[[ATTR11:[0-9]+]] -; IS__TUNIT_OPM-NEXT: call void @mutual_recursion2(i1 [[C]]) #[[ATTR23:[0-9]+]] -; IS__TUNIT_OPM-NEXT: br label [[END]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__TUNIT_NPM: rec: -; IS__TUNIT_NPM-NEXT: call void @sink() #[[ATTR11:[0-9]+]] -; IS__TUNIT_NPM-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) #[[ATTR25:[0-9]+]] -; IS__TUNIT_NPM-NEXT: br label [[END]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__CGSCC_OPM: rec: -; IS__CGSCC_OPM-NEXT: call void @sink() #[[ATTR14:[0-9]+]] -; IS__CGSCC_OPM-NEXT: call void @mutual_recursion2(i1 [[C]]) #[[ATTR27:[0-9]+]] -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__CGSCC_NPM: rec: -; IS__CGSCC_NPM-NEXT: call void @sink() #[[ATTR14:[0-9]+]] -; IS__CGSCC_NPM-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) #[[ATTR29:[0-9]+]] -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret void +; IS________OPM: Function Attrs: nofree noinline nosync nounwind uwtable +; IS________OPM-LABEL: define {{[^@]+}}@mutual_recursion1 +; IS________OPM-SAME: (i1 [[C:%.*]]) #[[ATTR4:[0-9]+]] { +; IS________OPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] +; IS________OPM: rec: +; IS________OPM-NEXT: call void @sink() #[[ATTR13:[0-9]+]] +; IS________OPM-NEXT: call void @mutual_recursion2(i1 [[C]]) #[[ATTR26:[0-9]+]] +; IS________OPM-NEXT: br label [[END]] +; IS________OPM: end: +; IS________OPM-NEXT: ret void +; +; IS________NPM: Function Attrs: nofree noinline nosync nounwind uwtable +; IS________NPM-LABEL: define {{[^@]+}}@mutual_recursion1 +; IS________NPM-SAME: (i1 [[C:%.*]]) #[[ATTR4:[0-9]+]] { +; IS________NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] +; IS________NPM: rec: +; IS________NPM-NEXT: call void @sink() #[[ATTR13:[0-9]+]] +; IS________NPM-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) #[[ATTR28:[0-9]+]] +; IS________NPM-NEXT: br label [[END]] +; IS________NPM: end: +; IS________NPM-NEXT: ret void ; br i1 %c, label %rec, label %end rec: @@ -334,29 +227,17 @@ define void @mutual_recursion2(i1 %c) #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR23]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__TUNIT_NPM-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR25]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR27]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { -; IS__CGSCC_NPM-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR29]] -; IS__CGSCC_NPM-NEXT: ret void +; IS________OPM: Function Attrs: nofree noinline nosync nounwind uwtable +; IS________OPM-LABEL: define {{[^@]+}}@mutual_recursion2 +; IS________OPM-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { +; IS________OPM-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR26]] +; IS________OPM-NEXT: ret void +; +; IS________NPM: Function Attrs: nofree noinline nosync nounwind uwtable +; IS________NPM-LABEL: define {{[^@]+}}@mutual_recursion2 +; IS________NPM-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { +; IS________NPM-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR28]] +; IS________NPM-NEXT: ret void ; call void @mutual_recursion1(i1 %c) ret void @@ -370,17 +251,11 @@ declare void @exit(i32 %0) local_unnamed_addr noreturn define void @only_exit() local_unnamed_addr #0 { -; IS__TUNIT____: Function Attrs: noinline noreturn nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@only_exit -; IS__TUNIT____-SAME: () local_unnamed_addr #[[ATTR5:[0-9]+]] { -; IS__TUNIT____-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR4:[0-9]+]] -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: noinline noreturn nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@only_exit -; IS__CGSCC____-SAME: () local_unnamed_addr #[[ATTR6:[0-9]+]] { -; IS__CGSCC____-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5:[0-9]+]] -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: noinline noreturn nounwind uwtable +; CHECK-LABEL: define {{[^@]+}}@only_exit +; CHECK-SAME: () local_unnamed_addr #[[ATTR6:[0-9]+]] { +; CHECK-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5:[0-9]+]] +; CHECK-NEXT: unreachable ; tail call void @exit(i32 0) unreachable @@ -397,41 +272,23 @@ ; return; ; } define void @conditional_exit(i32 %0, i32* nocapture readonly %1) local_unnamed_addr #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@conditional_exit -; IS__TUNIT____-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__TUNIT____-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] -; IS__TUNIT____: 4: -; IS__TUNIT____-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR4]] -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: 5: -; IS__TUNIT____-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP1]], align 4 -; IS__TUNIT____-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 0 -; IS__TUNIT____-NEXT: br i1 [[TMP7]], label [[TMP9:%.*]], label [[TMP8:%.*]] -; IS__TUNIT____: 8: -; IS__TUNIT____-NEXT: tail call void @exit(i32 noundef 1) #[[ATTR4]] -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: 9: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@conditional_exit -; IS__CGSCC____-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__CGSCC____-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] -; IS__CGSCC____: 4: -; IS__CGSCC____-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5]] -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: 5: -; IS__CGSCC____-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP1]], align 4 -; IS__CGSCC____-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 0 -; IS__CGSCC____-NEXT: br i1 [[TMP7]], label [[TMP9:%.*]], label [[TMP8:%.*]] -; IS__CGSCC____: 8: -; IS__CGSCC____-NEXT: tail call void @exit(i32 noundef 1) #[[ATTR5]] -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: 9: -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: noinline nounwind uwtable +; CHECK-LABEL: define {{[^@]+}}@conditional_exit +; CHECK-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] { +; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 +; CHECK-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] +; CHECK: 4: +; CHECK-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5]] +; CHECK-NEXT: unreachable +; CHECK: 5: +; CHECK-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP1]], align 4 +; CHECK-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 0 +; CHECK-NEXT: br i1 [[TMP7]], label [[TMP9:%.*]], label [[TMP8:%.*]] +; CHECK: 8: +; CHECK-NEXT: tail call void @exit(i32 noundef 1) #[[ATTR5]] +; CHECK-NEXT: unreachable +; CHECK: 9: +; CHECK-NEXT: ret void ; %3 = icmp eq i32 %0, 0 br i1 %3, label %5, label %4 @@ -460,44 +317,27 @@ declare float @llvm.floor.f32(float) define void @call_floor(float %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@call_floor -; IS__TUNIT____-SAME: (float [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_floor -; IS__CGSCC____-SAME: (float [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@call_floor +; CHECK-SAME: (float [[A:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: ret void ; tail call float @llvm.floor.f32(float %a) ret void } define float @call_floor2(float %a) #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@call_floor2 -; IS__TUNIT_OPM-SAME: (float [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR24:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret float [[C]] -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@call_floor2 -; IS__TUNIT_NPM-SAME: (float [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR26:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret float [[C]] -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@call_floor2 -; IS__CGSCC_OPM-SAME: (float [[A:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR28:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret float [[C]] -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@call_floor2 -; IS__CGSCC_NPM-SAME: (float [[A:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR30:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret float [[C]] +; IS________OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; IS________OPM-LABEL: define {{[^@]+}}@call_floor2 +; IS________OPM-SAME: (float [[A:%.*]]) #[[ATTR9:[0-9]+]] { +; IS________OPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR27:[0-9]+]] +; IS________OPM-NEXT: ret float [[C]] +; +; IS________NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; IS________NPM-LABEL: define {{[^@]+}}@call_floor2 +; IS________NPM-SAME: (float [[A:%.*]]) #[[ATTR9:[0-9]+]] { +; IS________NPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR29:[0-9]+]] +; IS________NPM-NEXT: ret float [[C]] ; %c = tail call float @llvm.floor.f32(float %a) ret float %c @@ -513,29 +353,17 @@ declare void @maybe_noreturn() #0 define void @call_maybe_noreturn() #0 { -; IS__TUNIT_OPM: Function Attrs: noinline nounwind uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@call_maybe_noreturn -; IS__TUNIT_OPM-SAME: () #[[ATTR6]] { -; IS__TUNIT_OPM-NEXT: tail call void @maybe_noreturn() #[[ATTR25:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: noinline nounwind uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@call_maybe_noreturn -; IS__TUNIT_NPM-SAME: () #[[ATTR6]] { -; IS__TUNIT_NPM-NEXT: tail call void @maybe_noreturn() #[[ATTR27:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@call_maybe_noreturn -; IS__CGSCC_OPM-SAME: () #[[ATTR7]] { -; IS__CGSCC_OPM-NEXT: tail call void @maybe_noreturn() #[[ATTR29:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@call_maybe_noreturn -; IS__CGSCC_NPM-SAME: () #[[ATTR7]] { -; IS__CGSCC_NPM-NEXT: tail call void @maybe_noreturn() #[[ATTR31:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret void +; IS________OPM: Function Attrs: noinline nounwind uwtable +; IS________OPM-LABEL: define {{[^@]+}}@call_maybe_noreturn +; IS________OPM-SAME: () #[[ATTR7]] { +; IS________OPM-NEXT: tail call void @maybe_noreturn() #[[ATTR28:[0-9]+]] +; IS________OPM-NEXT: ret void +; +; IS________NPM: Function Attrs: noinline nounwind uwtable +; IS________NPM-LABEL: define {{[^@]+}}@call_maybe_noreturn +; IS________NPM-SAME: () #[[ATTR7]] { +; IS________NPM-NEXT: tail call void @maybe_noreturn() #[[ATTR30:[0-9]+]] +; IS________NPM-NEXT: ret void ; tail call void @maybe_noreturn() ret void @@ -550,46 +378,28 @@ declare void @will_return() willreturn norecurse define void @f1() #0 { -; IS__TUNIT_OPM: Function Attrs: noinline nounwind uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@f1 -; IS__TUNIT_OPM-SAME: () #[[ATTR9:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: tail call void @will_return() #[[ATTR26:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: noinline nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f1 -; IS__TUNIT_NPM-SAME: () #[[ATTR9:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: tail call void @will_return() #[[ATTR28:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: noinline norecurse nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC_OPM-SAME: () #[[ATTR11:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: tail call void @will_return() #[[ATTR30:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: noinline norecurse nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC_NPM-SAME: () #[[ATTR11:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: tail call void @will_return() #[[ATTR32:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret void +; IS________OPM: Function Attrs: noinline nounwind uwtable willreturn +; IS________OPM-LABEL: define {{[^@]+}}@f1 +; IS________OPM-SAME: () #[[ATTR11:[0-9]+]] { +; IS________OPM-NEXT: tail call void @will_return() #[[ATTR29:[0-9]+]] +; IS________OPM-NEXT: ret void +; +; IS________NPM: Function Attrs: noinline nounwind uwtable willreturn +; IS________NPM-LABEL: define {{[^@]+}}@f1 +; IS________NPM-SAME: () #[[ATTR11:[0-9]+]] { +; IS________NPM-NEXT: tail call void @will_return() #[[ATTR31:[0-9]+]] +; IS________NPM-NEXT: ret void ; tail call void @will_return() ret void } define void @f2() #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@f2 -; IS__TUNIT____-SAME: () #[[ATTR9:[0-9]+]] { -; IS__TUNIT____-NEXT: tail call void @f1() #[[ATTR11:[0-9]+]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: noinline norecurse nounwind uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@f2 -; IS__CGSCC____-SAME: () #[[ATTR11:[0-9]+]] { -; IS__CGSCC____-NEXT: tail call void @f1() #[[ATTR14:[0-9]+]] -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: noinline nounwind uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@f2 +; CHECK-SAME: () #[[ATTR11:[0-9]+]] { +; CHECK-NEXT: tail call void @f1() #[[ATTR13:[0-9]+]] +; CHECK-NEXT: ret void ; tail call void @f1() ret void @@ -600,25 +410,15 @@ ; call willreturn function in endless loop. define void @call_will_return_but_has_loop() #0 { -; IS__TUNIT____: Function Attrs: noinline noreturn nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@call_will_return_but_has_loop -; IS__TUNIT____-SAME: () #[[ATTR5]] { -; IS__TUNIT____-NEXT: br label [[LABEL1:%.*]] -; IS__TUNIT____: label1: -; IS__TUNIT____-NEXT: tail call void @will_return() -; IS__TUNIT____-NEXT: br label [[LABEL2:%.*]] -; IS__TUNIT____: label2: -; IS__TUNIT____-NEXT: br label [[LABEL1]] -; -; IS__CGSCC____: Function Attrs: noinline norecurse noreturn nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_will_return_but_has_loop -; IS__CGSCC____-SAME: () #[[ATTR12:[0-9]+]] { -; IS__CGSCC____-NEXT: br label [[LABEL1:%.*]] -; IS__CGSCC____: label1: -; IS__CGSCC____-NEXT: tail call void @will_return() -; IS__CGSCC____-NEXT: br label [[LABEL2:%.*]] -; IS__CGSCC____: label2: -; IS__CGSCC____-NEXT: br label [[LABEL1]] +; CHECK: Function Attrs: noinline noreturn nounwind uwtable +; CHECK-LABEL: define {{[^@]+}}@call_will_return_but_has_loop +; CHECK-SAME: () #[[ATTR6]] { +; CHECK-NEXT: br label [[LABEL1:%.*]] +; CHECK: label1: +; CHECK-NEXT: tail call void @will_return() +; CHECK-NEXT: br label [[LABEL2:%.*]] +; CHECK: label2: +; CHECK-NEXT: br label [[LABEL1]] ; br label %label1 label1: @@ -637,53 +437,29 @@ declare i1 @maybe_raise_exception() #1 willreturn define void @invoke_test() personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT_OPM: Function Attrs: nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@invoke_test -; IS__TUNIT_OPM-SAME: () #[[ATTR11]] personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR26]] -; IS__TUNIT_OPM-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] -; IS__TUNIT_OPM: N: -; IS__TUNIT_OPM-NEXT: ret void -; IS__TUNIT_OPM: F: -; IS__TUNIT_OPM-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } -; IS__TUNIT_OPM-NEXT: catch i8* null -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@invoke_test -; IS__TUNIT_NPM-SAME: () #[[ATTR11]] personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR28]] -; IS__TUNIT_NPM-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] -; IS__TUNIT_NPM: N: -; IS__TUNIT_NPM-NEXT: ret void -; IS__TUNIT_NPM: F: -; IS__TUNIT_NPM-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } -; IS__TUNIT_NPM-NEXT: catch i8* null -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@invoke_test -; IS__CGSCC_OPM-SAME: () #[[ATTR14]] personality i32 (...)* @__gxx_personality_v0 { -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR30]] -; IS__CGSCC_OPM-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] -; IS__CGSCC_OPM: N: -; IS__CGSCC_OPM-NEXT: ret void -; IS__CGSCC_OPM: F: -; IS__CGSCC_OPM-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } -; IS__CGSCC_OPM-NEXT: catch i8* null -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@invoke_test -; IS__CGSCC_NPM-SAME: () #[[ATTR14]] personality i32 (...)* @__gxx_personality_v0 { -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR32]] -; IS__CGSCC_NPM-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] -; IS__CGSCC_NPM: N: -; IS__CGSCC_NPM-NEXT: ret void -; IS__CGSCC_NPM: F: -; IS__CGSCC_NPM-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } -; IS__CGSCC_NPM-NEXT: catch i8* null -; IS__CGSCC_NPM-NEXT: ret void +; IS________OPM: Function Attrs: nounwind willreturn +; IS________OPM-LABEL: define {{[^@]+}}@invoke_test +; IS________OPM-SAME: () #[[ATTR13]] personality i32 (...)* @__gxx_personality_v0 { +; IS________OPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR29]] +; IS________OPM-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] +; IS________OPM: N: +; IS________OPM-NEXT: ret void +; IS________OPM: F: +; IS________OPM-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } +; IS________OPM-NEXT: catch i8* null +; IS________OPM-NEXT: ret void +; +; IS________NPM: Function Attrs: nounwind willreturn +; IS________NPM-LABEL: define {{[^@]+}}@invoke_test +; IS________NPM-SAME: () #[[ATTR13]] personality i32 (...)* @__gxx_personality_v0 { +; IS________NPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR31]] +; IS________NPM-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] +; IS________NPM: N: +; IS________NPM-NEXT: ret void +; IS________NPM: F: +; IS________NPM-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } +; IS________NPM-NEXT: catch i8* null +; IS________NPM-NEXT: ret void ; invoke i1 @maybe_raise_exception() to label %N unwind label %F @@ -709,69 +485,37 @@ ; } define i32 @loop_constant_trip_count(i32* nocapture readonly %0) #0 { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@loop_constant_trip_count -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly [[TMP0:%.*]]) #[[ATTR12:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: br label [[TMP3:%.*]] -; IS__TUNIT_OPM: 2: -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP8:%.*]] -; IS__TUNIT_OPM: 3: -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__TUNIT_OPM-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 -; IS__TUNIT_OPM-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@loop_constant_trip_count -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) #[[ATTR12:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: br label [[TMP3:%.*]] -; IS__TUNIT_NPM: 2: -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP8:%.*]] -; IS__TUNIT_NPM: 3: -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__TUNIT_NPM-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 -; IS__TUNIT_NPM-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@loop_constant_trip_count -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readonly [[TMP0:%.*]]) #[[ATTR15:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br label [[TMP3:%.*]] -; IS__CGSCC_OPM: 2: -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP8:%.*]] -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__CGSCC_OPM-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@loop_constant_trip_count -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) #[[ATTR15:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br label [[TMP3:%.*]] -; IS__CGSCC_NPM: 2: -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP8:%.*]] -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__CGSCC_NPM-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 -; IS__CGSCC_NPM-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] +; IS________OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable +; IS________OPM-LABEL: define {{[^@]+}}@loop_constant_trip_count +; IS________OPM-SAME: (i32* nocapture nofree readonly [[TMP0:%.*]]) #[[ATTR14:[0-9]+]] { +; IS________OPM-NEXT: br label [[TMP3:%.*]] +; IS________OPM: 2: +; IS________OPM-NEXT: ret i32 [[TMP8:%.*]] +; IS________OPM: 3: +; IS________OPM-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] +; IS________OPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] +; IS________OPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] +; IS________OPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 +; IS________OPM-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] +; IS________OPM-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 +; IS________OPM-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 +; IS________OPM-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] +; +; IS________NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn +; IS________NPM-LABEL: define {{[^@]+}}@loop_constant_trip_count +; IS________NPM-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) #[[ATTR14:[0-9]+]] { +; IS________NPM-NEXT: br label [[TMP3:%.*]] +; IS________NPM: 2: +; IS________NPM-NEXT: ret i32 [[TMP8:%.*]] +; IS________NPM: 3: +; IS________NPM-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] +; IS________NPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] +; IS________NPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] +; IS________NPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 +; IS________NPM-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] +; IS________NPM-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 +; IS________NPM-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 +; IS________NPM-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] ; br label %3 @@ -801,81 +545,43 @@ ; return ans; ; } define i32 @loop_trip_count_unbound(i32 %0, i32 %1, i32* nocapture readonly %2, i32 %3) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@loop_trip_count_unbound -; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR12]] { -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] -; IS__TUNIT_OPM-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] -; IS__TUNIT_OPM: 6: -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP7]] -; IS__TUNIT_OPM: 8: -; IS__TUNIT_OPM-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] -; IS__TUNIT_OPM-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] -; IS__TUNIT_OPM-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 -; IS__TUNIT_OPM-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] -; IS__TUNIT_OPM-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] -; IS__TUNIT_OPM-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] -; IS__TUNIT_OPM-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] -; IS__TUNIT_OPM-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@loop_trip_count_unbound -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR13:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] -; IS__TUNIT_NPM-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] -; IS__TUNIT_NPM: 6: -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP7]] -; IS__TUNIT_NPM: 8: -; IS__TUNIT_NPM-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] -; IS__TUNIT_NPM-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] -; IS__TUNIT_NPM-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 -; IS__TUNIT_NPM-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] -; IS__TUNIT_NPM-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] -; IS__TUNIT_NPM-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] -; IS__TUNIT_NPM-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] -; IS__TUNIT_NPM-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@loop_trip_count_unbound -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR15]] { -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] -; IS__CGSCC_OPM: 6: -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP7]] -; IS__CGSCC_OPM: 8: -; IS__CGSCC_OPM-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] -; IS__CGSCC_OPM-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 -; IS__CGSCC_OPM-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] -; IS__CGSCC_OPM-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] -; IS__CGSCC_OPM-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] -; IS__CGSCC_OPM-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@loop_trip_count_unbound -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR16:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] -; IS__CGSCC_NPM-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] -; IS__CGSCC_NPM: 6: -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP7]] -; IS__CGSCC_NPM: 8: -; IS__CGSCC_NPM-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] -; IS__CGSCC_NPM-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] -; IS__CGSCC_NPM-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 -; IS__CGSCC_NPM-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] -; IS__CGSCC_NPM-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] -; IS__CGSCC_NPM-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] -; IS__CGSCC_NPM-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] -; IS__CGSCC_NPM-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] +; IS________OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable +; IS________OPM-LABEL: define {{[^@]+}}@loop_trip_count_unbound +; IS________OPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR14]] { +; IS________OPM-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] +; IS________OPM-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] +; IS________OPM: 6: +; IS________OPM-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] +; IS________OPM-NEXT: ret i32 [[TMP7]] +; IS________OPM: 8: +; IS________OPM-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] +; IS________OPM-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] +; IS________OPM-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 +; IS________OPM-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] +; IS________OPM-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 +; IS________OPM-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] +; IS________OPM-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] +; IS________OPM-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] +; IS________OPM-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] +; +; IS________NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable +; IS________NPM-LABEL: define {{[^@]+}}@loop_trip_count_unbound +; IS________NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR15:[0-9]+]] { +; IS________NPM-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] +; IS________NPM-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] +; IS________NPM: 6: +; IS________NPM-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] +; IS________NPM-NEXT: ret i32 [[TMP7]] +; IS________NPM: 8: +; IS________NPM-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] +; IS________NPM-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] +; IS________NPM-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 +; IS________NPM-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] +; IS________NPM-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 +; IS________NPM-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] +; IS________NPM-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] +; IS________NPM-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] +; IS________NPM-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] ; %5 = icmp eq i32 %0, %1 br i1 %5, label %6, label %8 @@ -909,89 +615,47 @@ define i32 @loop_trip_dec(i32 %0, i32* nocapture readonly %1) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@loop_trip_dec -; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR12]] { -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] -; IS__TUNIT_OPM: 4: -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 -; IS__TUNIT_OPM-NEXT: br label [[TMP6:%.*]] -; IS__TUNIT_OPM: 6: -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] -; IS__TUNIT_OPM-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] -; IS__TUNIT_OPM-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] -; IS__TUNIT_OPM-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] -; IS__TUNIT_OPM-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 -; IS__TUNIT_OPM-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] -; IS__TUNIT_OPM: 14: -; IS__TUNIT_OPM-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP15]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@loop_trip_dec -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR12]] { -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] -; IS__TUNIT_NPM: 4: -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 -; IS__TUNIT_NPM-NEXT: br label [[TMP6:%.*]] -; IS__TUNIT_NPM: 6: -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] -; IS__TUNIT_NPM-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] -; IS__TUNIT_NPM-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] -; IS__TUNIT_NPM-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] -; IS__TUNIT_NPM-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 -; IS__TUNIT_NPM-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] -; IS__TUNIT_NPM: 14: -; IS__TUNIT_NPM-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP15]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@loop_trip_dec -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR15]] { -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] -; IS__CGSCC_OPM: 4: -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 -; IS__CGSCC_OPM-NEXT: br label [[TMP6:%.*]] -; IS__CGSCC_OPM: 6: -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] -; IS__CGSCC_OPM-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] -; IS__CGSCC_OPM-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] -; IS__CGSCC_OPM-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 -; IS__CGSCC_OPM-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] -; IS__CGSCC_OPM: 14: -; IS__CGSCC_OPM-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP15]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@loop_trip_dec -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR15]] { -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] -; IS__CGSCC_NPM: 4: -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 -; IS__CGSCC_NPM-NEXT: br label [[TMP6:%.*]] -; IS__CGSCC_NPM: 6: -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] -; IS__CGSCC_NPM-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] -; IS__CGSCC_NPM-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] -; IS__CGSCC_NPM-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] -; IS__CGSCC_NPM-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 -; IS__CGSCC_NPM-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] -; IS__CGSCC_NPM: 14: -; IS__CGSCC_NPM-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP15]] +; IS________OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable +; IS________OPM-LABEL: define {{[^@]+}}@loop_trip_dec +; IS________OPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR14]] { +; IS________OPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 +; IS________OPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] +; IS________OPM: 4: +; IS________OPM-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 +; IS________OPM-NEXT: br label [[TMP6:%.*]] +; IS________OPM: 6: +; IS________OPM-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] +; IS________OPM-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] +; IS________OPM-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] +; IS________OPM-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 +; IS________OPM-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] +; IS________OPM-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 +; IS________OPM-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 +; IS________OPM-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] +; IS________OPM: 14: +; IS________OPM-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] +; IS________OPM-NEXT: ret i32 [[TMP15]] +; +; IS________NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn +; IS________NPM-LABEL: define {{[^@]+}}@loop_trip_dec +; IS________NPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR14]] { +; IS________NPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 +; IS________NPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] +; IS________NPM: 4: +; IS________NPM-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 +; IS________NPM-NEXT: br label [[TMP6:%.*]] +; IS________NPM: 6: +; IS________NPM-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] +; IS________NPM-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] +; IS________NPM-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] +; IS________NPM-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 +; IS________NPM-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] +; IS________NPM-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 +; IS________NPM-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 +; IS________NPM-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] +; IS________NPM: 14: +; IS________NPM-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] +; IS________NPM-NEXT: ret i32 [[TMP15]] ; %3 = icmp sgt i32 %0, -1 br i1 %3, label %4, label %14 @@ -1019,25 +683,15 @@ ; multiple return define i32 @multiple_return(i32 %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@multiple_return -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[B:%.*]] = icmp eq i32 [[A]], 0 -; IS__TUNIT____-NEXT: br i1 [[B]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: ret i32 1 -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@multiple_return -; IS__CGSCC____-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[B:%.*]] = icmp eq i32 [[A]], 0 -; IS__CGSCC____-NEXT: br i1 [[B]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i32 1 -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: ret i32 0 +; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@multiple_return +; CHECK-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[B:%.*]] = icmp eq i32 [[A]], 0 +; CHECK-NEXT: br i1 [[B]], label [[T:%.*]], label [[F:%.*]] +; CHECK: t: +; CHECK-NEXT: ret i32 1 +; CHECK: f: +; CHECK-NEXT: ret i32 0 ; %b = icmp eq i32 %a, 0 br i1 %b, label %t, label %f @@ -1053,37 +707,21 @@ ; 15.1 (positive case) define void @unreachable_exit_positive1() #0 { -; IS__TUNIT_OPM: Function Attrs: noinline nounwind uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@unreachable_exit_positive1 -; IS__TUNIT_OPM-SAME: () #[[ATTR9]] { -; IS__TUNIT_OPM-NEXT: tail call void @will_return() #[[ATTR26]] -; IS__TUNIT_OPM-NEXT: ret void -; IS__TUNIT_OPM: unreachable_label: -; IS__TUNIT_OPM-NEXT: unreachable -; -; IS__TUNIT_NPM: Function Attrs: noinline nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive1 -; IS__TUNIT_NPM-SAME: () #[[ATTR9]] { -; IS__TUNIT_NPM-NEXT: tail call void @will_return() #[[ATTR28]] -; IS__TUNIT_NPM-NEXT: ret void -; IS__TUNIT_NPM: unreachable_label: -; IS__TUNIT_NPM-NEXT: unreachable -; -; IS__CGSCC_OPM: Function Attrs: noinline norecurse nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@unreachable_exit_positive1 -; IS__CGSCC_OPM-SAME: () #[[ATTR11]] { -; IS__CGSCC_OPM-NEXT: tail call void @will_return() #[[ATTR30]] -; IS__CGSCC_OPM-NEXT: ret void -; IS__CGSCC_OPM: unreachable_label: -; IS__CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: noinline norecurse nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive1 -; IS__CGSCC_NPM-SAME: () #[[ATTR11]] { -; IS__CGSCC_NPM-NEXT: tail call void @will_return() #[[ATTR32]] -; IS__CGSCC_NPM-NEXT: ret void -; IS__CGSCC_NPM: unreachable_label: -; IS__CGSCC_NPM-NEXT: unreachable +; IS________OPM: Function Attrs: noinline nounwind uwtable willreturn +; IS________OPM-LABEL: define {{[^@]+}}@unreachable_exit_positive1 +; IS________OPM-SAME: () #[[ATTR11]] { +; IS________OPM-NEXT: tail call void @will_return() #[[ATTR29]] +; IS________OPM-NEXT: ret void +; IS________OPM: unreachable_label: +; IS________OPM-NEXT: unreachable +; +; IS________NPM: Function Attrs: noinline nounwind uwtable willreturn +; IS________NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive1 +; IS________NPM-SAME: () #[[ATTR11]] { +; IS________NPM-NEXT: tail call void @will_return() #[[ATTR31]] +; IS________NPM-NEXT: ret void +; IS________NPM: unreachable_label: +; IS________NPM-NEXT: unreachable ; tail call void @will_return() ret void @@ -1094,77 +732,41 @@ } define i32 @unreachable_exit_positive2(i32) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@unreachable_exit_positive2 -; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__TUNIT_OPM: 3: -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP4]] -; IS__TUNIT_OPM: 5: -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_OPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__TUNIT_OPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__TUNIT_OPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__TUNIT_OPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; IS__TUNIT_OPM: unreachable_label: -; IS__TUNIT_OPM-NEXT: unreachable -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive2 -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__TUNIT_NPM: 3: -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP4]] -; IS__TUNIT_NPM: 5: -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__TUNIT_NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__TUNIT_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__TUNIT_NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; IS__TUNIT_NPM: unreachable_label: -; IS__TUNIT_NPM-NEXT: unreachable -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@unreachable_exit_positive2 -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP4]] -; IS__CGSCC_OPM: 5: -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_OPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__CGSCC_OPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; IS__CGSCC_OPM: unreachable_label: -; IS__CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive2 -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP4]] -; IS__CGSCC_NPM: 5: -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__CGSCC_NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__CGSCC_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__CGSCC_NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; IS__CGSCC_NPM: unreachable_label: -; IS__CGSCC_NPM-NEXT: unreachable +; IS________OPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable +; IS________OPM-LABEL: define {{[^@]+}}@unreachable_exit_positive2 +; IS________OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { +; IS________OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 +; IS________OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; IS________OPM: 3: +; IS________OPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] +; IS________OPM-NEXT: ret i32 [[TMP4]] +; IS________OPM: 5: +; IS________OPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] +; IS________OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] +; IS________OPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] +; IS________OPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 +; IS________OPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] +; IS________OPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] +; IS________OPM: unreachable_label: +; IS________OPM-NEXT: unreachable +; +; IS________NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; IS________NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive2 +; IS________NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; IS________NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 +; IS________NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; IS________NPM: 3: +; IS________NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] +; IS________NPM-NEXT: ret i32 [[TMP4]] +; IS________NPM: 5: +; IS________NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] +; IS________NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] +; IS________NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] +; IS________NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 +; IS________NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] +; IS________NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] +; IS________NPM: unreachable_label: +; IS________NPM-NEXT: unreachable ; %2 = icmp slt i32 %0, 1 br i1 %2, label %3, label %5 @@ -1190,21 +792,13 @@ ;15.2 define void @unreachable_exit_negative1() #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@unreachable_exit_negative1 -; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR4]] -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: unreachable_label: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@unreachable_exit_negative1 -; IS__CGSCC____-SAME: () #[[ATTR7]] { -; IS__CGSCC____-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5]] -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: unreachable_label: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: noinline nounwind uwtable +; CHECK-LABEL: define {{[^@]+}}@unreachable_exit_negative1 +; CHECK-SAME: () #[[ATTR7]] { +; CHECK-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5]] +; CHECK-NEXT: unreachable +; CHECK: unreachable_label: +; CHECK-NEXT: unreachable ; tail call void @exit(i32 0) ret void @@ -1215,49 +809,27 @@ } define void @unreachable_exit_negative2() #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@unreachable_exit_negative2 -; IS__TUNIT_OPM-SAME: () #[[ATTR13:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: br label [[L1:%.*]] -; IS__TUNIT_OPM: L1: -; IS__TUNIT_OPM-NEXT: br label [[L2:%.*]] -; IS__TUNIT_OPM: L2: -; IS__TUNIT_OPM-NEXT: br label [[L1]] -; IS__TUNIT_OPM: unreachable_label: -; IS__TUNIT_OPM-NEXT: unreachable -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unreachable_exit_negative2 -; IS__TUNIT_NPM-SAME: () #[[ATTR14:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: br label [[L1:%.*]] -; IS__TUNIT_NPM: L1: -; IS__TUNIT_NPM-NEXT: br label [[L2:%.*]] -; IS__TUNIT_NPM: L2: -; IS__TUNIT_NPM-NEXT: br label [[L1]] -; IS__TUNIT_NPM: unreachable_label: -; IS__TUNIT_NPM-NEXT: unreachable -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@unreachable_exit_negative2 -; IS__CGSCC_OPM-SAME: () #[[ATTR16:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br label [[L1:%.*]] -; IS__CGSCC_OPM: L1: -; IS__CGSCC_OPM-NEXT: br label [[L2:%.*]] -; IS__CGSCC_OPM: L2: -; IS__CGSCC_OPM-NEXT: br label [[L1]] -; IS__CGSCC_OPM: unreachable_label: -; IS__CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@unreachable_exit_negative2 -; IS__CGSCC_NPM-SAME: () #[[ATTR17:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br label [[L1:%.*]] -; IS__CGSCC_NPM: L1: -; IS__CGSCC_NPM-NEXT: br label [[L2:%.*]] -; IS__CGSCC_NPM: L2: -; IS__CGSCC_NPM-NEXT: br label [[L1]] -; IS__CGSCC_NPM: unreachable_label: -; IS__CGSCC_NPM-NEXT: unreachable +; IS________OPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable +; IS________OPM-LABEL: define {{[^@]+}}@unreachable_exit_negative2 +; IS________OPM-SAME: () #[[ATTR15:[0-9]+]] { +; IS________OPM-NEXT: br label [[L1:%.*]] +; IS________OPM: L1: +; IS________OPM-NEXT: br label [[L2:%.*]] +; IS________OPM: L2: +; IS________OPM-NEXT: br label [[L1]] +; IS________OPM: unreachable_label: +; IS________OPM-NEXT: unreachable +; +; IS________NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable +; IS________NPM-LABEL: define {{[^@]+}}@unreachable_exit_negative2 +; IS________NPM-SAME: () #[[ATTR16:[0-9]+]] { +; IS________NPM-NEXT: br label [[L1:%.*]] +; IS________NPM: L1: +; IS________NPM-NEXT: br label [[L2:%.*]] +; IS________NPM: L2: +; IS________NPM-NEXT: br label [[L1]] +; IS________NPM: unreachable_label: +; IS________NPM-NEXT: unreachable ; br label %L1 L1: @@ -1275,17 +847,11 @@ declare void @llvm.eh.sjlj.longjmp(i8*) define void @call_longjmp(i8* nocapture readnone %0) local_unnamed_addr #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@call_longjmp -; IS__TUNIT____-SAME: (i8* nocapture readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR6]] { -; IS__TUNIT____-NEXT: tail call void @llvm.eh.sjlj.longjmp(i8* noalias readnone [[TMP0]]) #[[ATTR4]] -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_longjmp -; IS__CGSCC____-SAME: (i8* nocapture readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR7]] { -; IS__CGSCC____-NEXT: tail call void @llvm.eh.sjlj.longjmp(i8* noalias readnone [[TMP0]]) #[[ATTR5]] -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: noinline nounwind uwtable +; CHECK-LABEL: define {{[^@]+}}@call_longjmp +; CHECK-SAME: (i8* nocapture readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR7]] { +; CHECK-NEXT: tail call void @llvm.eh.sjlj.longjmp(i8* noalias readnone [[TMP0]]) #[[ATTR5]] +; CHECK-NEXT: unreachable ; tail call void @llvm.eh.sjlj.longjmp(i8* %0) ret void @@ -1303,89 +869,47 @@ ; } define i32 @infinite_loop_inside_bounded_loop(i32 %n) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR15]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_OPM: for.cond: -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_OPM: while.cond: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_BODY:%.*]] -; IS__TUNIT_OPM: while.body: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_OPM: for.inc: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: for.end: -; IS__TUNIT_OPM-NEXT: ret i32 0 -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_NPM: for.cond: -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_NPM: while.cond: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_BODY:%.*]] -; IS__TUNIT_NPM: while.body: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_NPM: for.inc: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: for.end: -; IS__TUNIT_NPM-NEXT: ret i32 0 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR18:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_OPM: for.cond: -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_OPM: while.cond: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_BODY:%.*]] -; IS__CGSCC_OPM: while.body: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_OPM: for.inc: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: for.end: -; IS__CGSCC_OPM-NEXT: ret i32 0 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR19:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_NPM: for.cond: -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_NPM: while.cond: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_BODY:%.*]] -; IS__CGSCC_NPM: while.body: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_NPM: for.inc: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: for.end: -; IS__CGSCC_NPM-NEXT: ret i32 0 +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone +; IS________OPM-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop +; IS________OPM-SAME: (i32 [[N:%.*]]) #[[ATTR17:[0-9]+]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: br label [[FOR_COND:%.*]] +; IS________OPM: for.cond: +; IS________OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 +; IS________OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; IS________OPM: for.cond.cleanup: +; IS________OPM-NEXT: br label [[FOR_END:%.*]] +; IS________OPM: for.body: +; IS________OPM-NEXT: br label [[WHILE_COND:%.*]] +; IS________OPM: while.cond: +; IS________OPM-NEXT: br label [[WHILE_BODY:%.*]] +; IS________OPM: while.body: +; IS________OPM-NEXT: br label [[WHILE_COND]] +; IS________OPM: for.inc: +; IS________OPM-NEXT: unreachable +; IS________OPM: for.end: +; IS________OPM-NEXT: ret i32 0 +; +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone +; IS________NPM-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop +; IS________NPM-SAME: (i32 [[N:%.*]]) #[[ATTR18:[0-9]+]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: br label [[FOR_COND:%.*]] +; IS________NPM: for.cond: +; IS________NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 +; IS________NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; IS________NPM: for.cond.cleanup: +; IS________NPM-NEXT: br label [[FOR_END:%.*]] +; IS________NPM: for.body: +; IS________NPM-NEXT: br label [[WHILE_COND:%.*]] +; IS________NPM: while.cond: +; IS________NPM-NEXT: br label [[WHILE_BODY:%.*]] +; IS________NPM: while.body: +; IS________NPM-NEXT: br label [[WHILE_COND]] +; IS________NPM: for.inc: +; IS________NPM-NEXT: unreachable +; IS________NPM: for.end: +; IS________NPM-NEXT: ret i32 0 ; entry: br label %for.cond @@ -1427,121 +951,63 @@ ; } define i32 @bounded_nested_loops(i32 %n) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@bounded_nested_loops -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR15]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_OPM: for.cond: -; IS__TUNIT_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] -; IS__TUNIT_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] -; IS__TUNIT_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_OPM: while.cond: -; IS__TUNIT_OPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_OPM: while.body: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: while.end: -; IS__TUNIT_OPM-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_INC]] -; IS__TUNIT_OPM: for.inc: -; IS__TUNIT_OPM-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND]] -; IS__TUNIT_OPM: for.end: -; IS__TUNIT_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@bounded_nested_loops -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR17:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_NPM: for.cond: -; IS__TUNIT_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] -; IS__TUNIT_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] -; IS__TUNIT_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_NPM: while.cond: -; IS__TUNIT_NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_NPM: while.body: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: while.end: -; IS__TUNIT_NPM-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_INC]] -; IS__TUNIT_NPM: for.inc: -; IS__TUNIT_NPM-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND]] -; IS__TUNIT_NPM: for.end: -; IS__TUNIT_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bounded_nested_loops -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_OPM: for.cond: -; IS__CGSCC_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] -; IS__CGSCC_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] -; IS__CGSCC_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_OPM: while.cond: -; IS__CGSCC_OPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_OPM: while.body: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: while.end: -; IS__CGSCC_OPM-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_INC]] -; IS__CGSCC_OPM: for.inc: -; IS__CGSCC_OPM-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]] -; IS__CGSCC_OPM: for.end: -; IS__CGSCC_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bounded_nested_loops -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR20:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_NPM: for.cond: -; IS__CGSCC_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] -; IS__CGSCC_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] -; IS__CGSCC_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_NPM: while.cond: -; IS__CGSCC_NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_NPM: while.body: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: while.end: -; IS__CGSCC_NPM-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_INC]] -; IS__CGSCC_NPM: for.inc: -; IS__CGSCC_NPM-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND]] -; IS__CGSCC_NPM: for.end: -; IS__CGSCC_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone +; IS________OPM-LABEL: define {{[^@]+}}@bounded_nested_loops +; IS________OPM-SAME: (i32 [[N:%.*]]) #[[ATTR17]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: br label [[FOR_COND:%.*]] +; IS________OPM: for.cond: +; IS________OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] +; IS________OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] +; IS________OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] +; IS________OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] +; IS________OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; IS________OPM: for.cond.cleanup: +; IS________OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] +; IS________OPM-NEXT: br label [[FOR_END:%.*]] +; IS________OPM: for.body: +; IS________OPM-NEXT: br label [[WHILE_COND:%.*]] +; IS________OPM: while.cond: +; IS________OPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] +; IS________OPM: while.body: +; IS________OPM-NEXT: unreachable +; IS________OPM: while.end: +; IS________OPM-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] +; IS________OPM-NEXT: br label [[FOR_INC]] +; IS________OPM: for.inc: +; IS________OPM-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 +; IS________OPM-NEXT: br label [[FOR_COND]] +; IS________OPM: for.end: +; IS________OPM-NEXT: ret i32 [[ANS_0_LCSSA]] +; +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@bounded_nested_loops +; IS________NPM-SAME: (i32 [[N:%.*]]) #[[ATTR19:[0-9]+]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: br label [[FOR_COND:%.*]] +; IS________NPM: for.cond: +; IS________NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] +; IS________NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] +; IS________NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] +; IS________NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] +; IS________NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; IS________NPM: for.cond.cleanup: +; IS________NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] +; IS________NPM-NEXT: br label [[FOR_END:%.*]] +; IS________NPM: for.body: +; IS________NPM-NEXT: br label [[WHILE_COND:%.*]] +; IS________NPM: while.cond: +; IS________NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] +; IS________NPM: while.body: +; IS________NPM-NEXT: unreachable +; IS________NPM: while.end: +; IS________NPM-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] +; IS________NPM-NEXT: br label [[FOR_INC]] +; IS________NPM: for.inc: +; IS________NPM-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 +; IS________NPM-NEXT: br label [[FOR_COND]] +; IS________NPM: for.end: +; IS________NPM-NEXT: ret i32 [[ANS_0_LCSSA]] ; entry: br label %for.cond @@ -1591,129 +1057,67 @@ ; } define i32 @bounded_loop_inside_unbounded_loop(i32 %n) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR15]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_OPM: while.cond: -; IS__TUNIT_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 -; IS__TUNIT_OPM-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 -; IS__TUNIT_OPM-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 -; IS__TUNIT_OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_OPM: while.body: -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_OPM: for.cond: -; IS__TUNIT_OPM-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_END]] -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: for.inc: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: for.end: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_OPM: while.end: -; IS__TUNIT_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_NPM: while.cond: -; IS__TUNIT_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 -; IS__TUNIT_NPM-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 -; IS__TUNIT_NPM-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 -; IS__TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_NPM: while.body: -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_NPM: for.cond: -; IS__TUNIT_NPM-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_END]] -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: for.inc: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: for.end: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_NPM: while.end: -; IS__TUNIT_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_OPM: while.cond: -; IS__CGSCC_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 -; IS__CGSCC_OPM-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 -; IS__CGSCC_OPM-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 -; IS__CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_OPM: while.body: -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_OPM: for.cond: -; IS__CGSCC_OPM-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_END]] -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: for.inc: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: for.end: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_OPM: while.end: -; IS__CGSCC_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR19]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_NPM: while.cond: -; IS__CGSCC_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 -; IS__CGSCC_NPM-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 -; IS__CGSCC_NPM-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 -; IS__CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_NPM: while.body: -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_NPM: for.cond: -; IS__CGSCC_NPM-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_END]] -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: for.inc: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: for.end: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_NPM: while.end: -; IS__CGSCC_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone +; IS________OPM-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop +; IS________OPM-SAME: (i32 [[N:%.*]]) #[[ATTR17]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: br label [[WHILE_COND:%.*]] +; IS________OPM: while.cond: +; IS________OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] +; IS________OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] +; IS________OPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 +; IS________OPM-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 +; IS________OPM-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 +; IS________OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 +; IS________OPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] +; IS________OPM: while.body: +; IS________OPM-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 +; IS________OPM-NEXT: br label [[FOR_COND:%.*]] +; IS________OPM: for.cond: +; IS________OPM-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] +; IS________OPM: for.cond.cleanup: +; IS________OPM-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] +; IS________OPM-NEXT: br label [[FOR_END]] +; IS________OPM: for.body: +; IS________OPM-NEXT: unreachable +; IS________OPM: for.inc: +; IS________OPM-NEXT: unreachable +; IS________OPM: for.end: +; IS________OPM-NEXT: br label [[WHILE_COND]] +; IS________OPM: while.end: +; IS________OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] +; IS________OPM-NEXT: ret i32 [[ANS_0_LCSSA]] +; +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone +; IS________NPM-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop +; IS________NPM-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: br label [[WHILE_COND:%.*]] +; IS________NPM: while.cond: +; IS________NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] +; IS________NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] +; IS________NPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 +; IS________NPM-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 +; IS________NPM-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 +; IS________NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 +; IS________NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] +; IS________NPM: while.body: +; IS________NPM-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 +; IS________NPM-NEXT: br label [[FOR_COND:%.*]] +; IS________NPM: for.cond: +; IS________NPM-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] +; IS________NPM: for.cond.cleanup: +; IS________NPM-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] +; IS________NPM-NEXT: br label [[FOR_END]] +; IS________NPM: for.body: +; IS________NPM-NEXT: unreachable +; IS________NPM: for.inc: +; IS________NPM-NEXT: unreachable +; IS________NPM: for.end: +; IS________NPM-NEXT: br label [[WHILE_COND]] +; IS________NPM: while.end: +; IS________NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] +; IS________NPM-NEXT: ret i32 [[ANS_0_LCSSA]] ; entry: br label %while.cond @@ -1768,125 +1172,65 @@ ; } define i32 @nested_unbounded_loops(i32 %n) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@nested_unbounded_loops -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR15]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_OPM: while.cond: -; IS__TUNIT_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] -; IS__TUNIT_OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_OPM: while.body: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND1:%.*]] -; IS__TUNIT_OPM: while.cond1: -; IS__TUNIT_OPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] -; IS__TUNIT_OPM: while.body4: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: while.end: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND5:%.*]] -; IS__TUNIT_OPM: while.cond5: -; IS__TUNIT_OPM-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] -; IS__TUNIT_OPM: while.body8: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: while.end10: -; IS__TUNIT_OPM-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_OPM: while.end11: -; IS__TUNIT_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@nested_unbounded_loops -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_NPM: while.cond: -; IS__TUNIT_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] -; IS__TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_NPM: while.body: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND1:%.*]] -; IS__TUNIT_NPM: while.cond1: -; IS__TUNIT_NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] -; IS__TUNIT_NPM: while.body4: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: while.end: -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND5:%.*]] -; IS__TUNIT_NPM: while.cond5: -; IS__TUNIT_NPM-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] -; IS__TUNIT_NPM: while.body8: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: while.end10: -; IS__TUNIT_NPM-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_NPM: while.end11: -; IS__TUNIT_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nested_unbounded_loops -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_OPM: while.cond: -; IS__CGSCC_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] -; IS__CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_OPM: while.body: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND1:%.*]] -; IS__CGSCC_OPM: while.cond1: -; IS__CGSCC_OPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] -; IS__CGSCC_OPM: while.body4: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: while.end: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND5:%.*]] -; IS__CGSCC_OPM: while.cond5: -; IS__CGSCC_OPM-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] -; IS__CGSCC_OPM: while.body8: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: while.end10: -; IS__CGSCC_OPM-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_OPM: while.end11: -; IS__CGSCC_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@nested_unbounded_loops -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR19]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_NPM: while.cond: -; IS__CGSCC_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] -; IS__CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_NPM: while.body: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND1:%.*]] -; IS__CGSCC_NPM: while.cond1: -; IS__CGSCC_NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] -; IS__CGSCC_NPM: while.body4: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: while.end: -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND5:%.*]] -; IS__CGSCC_NPM: while.cond5: -; IS__CGSCC_NPM-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] -; IS__CGSCC_NPM: while.body8: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: while.end10: -; IS__CGSCC_NPM-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_NPM: while.end11: -; IS__CGSCC_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone +; IS________OPM-LABEL: define {{[^@]+}}@nested_unbounded_loops +; IS________OPM-SAME: (i32 [[N:%.*]]) #[[ATTR17]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: br label [[WHILE_COND:%.*]] +; IS________OPM: while.cond: +; IS________OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] +; IS________OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] +; IS________OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 +; IS________OPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] +; IS________OPM: while.body: +; IS________OPM-NEXT: br label [[WHILE_COND1:%.*]] +; IS________OPM: while.cond1: +; IS________OPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] +; IS________OPM: while.body4: +; IS________OPM-NEXT: unreachable +; IS________OPM: while.end: +; IS________OPM-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 +; IS________OPM-NEXT: br label [[WHILE_COND5:%.*]] +; IS________OPM: while.cond5: +; IS________OPM-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] +; IS________OPM: while.body8: +; IS________OPM-NEXT: unreachable +; IS________OPM: while.end10: +; IS________OPM-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] +; IS________OPM-NEXT: br label [[WHILE_COND]] +; IS________OPM: while.end11: +; IS________OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] +; IS________OPM-NEXT: ret i32 [[ANS_0_LCSSA]] +; +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone +; IS________NPM-LABEL: define {{[^@]+}}@nested_unbounded_loops +; IS________NPM-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { +; IS________NPM-NEXT: entry: +; IS________NPM-NEXT: br label [[WHILE_COND:%.*]] +; IS________NPM: while.cond: +; IS________NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] +; IS________NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] +; IS________NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 +; IS________NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] +; IS________NPM: while.body: +; IS________NPM-NEXT: br label [[WHILE_COND1:%.*]] +; IS________NPM: while.cond1: +; IS________NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] +; IS________NPM: while.body4: +; IS________NPM-NEXT: unreachable +; IS________NPM: while.end: +; IS________NPM-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 +; IS________NPM-NEXT: br label [[WHILE_COND5:%.*]] +; IS________NPM: while.cond5: +; IS________NPM-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] +; IS________NPM: while.body8: +; IS________NPM-NEXT: unreachable +; IS________NPM: while.end10: +; IS________NPM-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] +; IS________NPM-NEXT: br label [[WHILE_COND]] +; IS________NPM: while.end11: +; IS________NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] +; IS________NPM-NEXT: ret i32 [[ANS_0_LCSSA]] ; entry: br label %while.cond @@ -1948,11 +1292,11 @@ ; } define void @non_loop_cycle(i32 %n) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@non_loop_cycle -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR15]] { +; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR17]] { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR15]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR25]] ; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CALL]], 5 ; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; IS__TUNIT_OPM: if.then: @@ -1960,7 +1304,7 @@ ; IS__TUNIT_OPM: if.else: ; IS__TUNIT_OPM-NEXT: br label [[ENTRY2:%.*]] ; IS__TUNIT_OPM: entry1: -; IS__TUNIT_OPM-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR15]] +; IS__TUNIT_OPM-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR25]] ; IS__TUNIT_OPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[CALL1]], 5 ; IS__TUNIT_OPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_ELSE4:%.*]] ; IS__TUNIT_OPM: if.then3: @@ -1968,7 +1312,7 @@ ; IS__TUNIT_OPM: if.else4: ; IS__TUNIT_OPM-NEXT: br label [[ENTRY2]] ; IS__TUNIT_OPM: entry2: -; IS__TUNIT_OPM-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR15]] +; IS__TUNIT_OPM-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR25]] ; IS__TUNIT_OPM-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[CALL5]], 5 ; IS__TUNIT_OPM-NEXT: br i1 [[CMP6]], label [[IF_THEN7:%.*]], label [[IF_ELSE8:%.*]] ; IS__TUNIT_OPM: if.then7: @@ -1978,11 +1322,11 @@ ; IS__TUNIT_OPM: exit: ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@non_loop_cycle -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { +; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { ; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR16]] +; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR27]] ; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CALL]], 5 ; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; IS__TUNIT_NPM: if.then: @@ -1990,7 +1334,7 @@ ; IS__TUNIT_NPM: if.else: ; IS__TUNIT_NPM-NEXT: br label [[ENTRY2:%.*]] ; IS__TUNIT_NPM: entry1: -; IS__TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR16]] +; IS__TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR27]] ; IS__TUNIT_NPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[CALL1]], 5 ; IS__TUNIT_NPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_ELSE4:%.*]] ; IS__TUNIT_NPM: if.then3: @@ -1998,7 +1342,7 @@ ; IS__TUNIT_NPM: if.else4: ; IS__TUNIT_NPM-NEXT: br label [[ENTRY2]] ; IS__TUNIT_NPM: entry2: -; IS__TUNIT_NPM-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR16]] +; IS__TUNIT_NPM-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR27]] ; IS__TUNIT_NPM-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[CALL5]], 5 ; IS__TUNIT_NPM-NEXT: br i1 [[CMP6]], label [[IF_THEN7:%.*]], label [[IF_ELSE8:%.*]] ; IS__TUNIT_NPM: if.then7: @@ -2010,9 +1354,9 @@ ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@non_loop_cycle -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { +; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR17]] { ; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR31:[0-9]+]] +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR30:[0-9]+]] ; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CALL]], 5 ; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; IS__CGSCC_OPM: if.then: @@ -2020,7 +1364,7 @@ ; IS__CGSCC_OPM: if.else: ; IS__CGSCC_OPM-NEXT: br label [[ENTRY2:%.*]] ; IS__CGSCC_OPM: entry1: -; IS__CGSCC_OPM-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR31]] +; IS__CGSCC_OPM-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR30]] ; IS__CGSCC_OPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[CALL1]], 5 ; IS__CGSCC_OPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_ELSE4:%.*]] ; IS__CGSCC_OPM: if.then3: @@ -2028,7 +1372,7 @@ ; IS__CGSCC_OPM: if.else4: ; IS__CGSCC_OPM-NEXT: br label [[ENTRY2]] ; IS__CGSCC_OPM: entry2: -; IS__CGSCC_OPM-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR31]] +; IS__CGSCC_OPM-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR30]] ; IS__CGSCC_OPM-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[CALL5]], 5 ; IS__CGSCC_OPM-NEXT: br i1 [[CMP6]], label [[IF_THEN7:%.*]], label [[IF_ELSE8:%.*]] ; IS__CGSCC_OPM: if.then7: @@ -2040,7 +1384,7 @@ ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@non_loop_cycle -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR19]] { +; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) ; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CALL]], 5 @@ -2112,85 +1456,49 @@ declare void @readonly_mustprogress() readonly mustprogress define void @willreturn_mustprogress_caller_1() mustprogress { -; IS__TUNIT_OPM: Function Attrs: mustprogress -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 -; IS__TUNIT_OPM-SAME: () #[[ATTR18:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: call void @unknown() -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: mustprogress -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 -; IS__TUNIT_NPM-SAME: () #[[ATTR20:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: call void @unknown() -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: mustprogress -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 -; IS__CGSCC_OPM-SAME: () #[[ATTR21:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @unknown() -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: mustprogress -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 -; IS__CGSCC_NPM-SAME: () #[[ATTR23:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: call void @unknown() -; IS__CGSCC_NPM-NEXT: ret void +; IS________OPM: Function Attrs: mustprogress +; IS________OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 +; IS________OPM-SAME: () #[[ATTR20:[0-9]+]] { +; IS________OPM-NEXT: call void @unknown() +; IS________OPM-NEXT: ret void +; +; IS________NPM: Function Attrs: mustprogress +; IS________NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 +; IS________NPM-SAME: () #[[ATTR22:[0-9]+]] { +; IS________NPM-NEXT: call void @unknown() +; IS________NPM-NEXT: ret void ; call void @unknown() ret void } define void @willreturn_mustprogress_caller_2() mustprogress { -; IS__TUNIT_OPM: Function Attrs: mustprogress readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2 -; IS__TUNIT_OPM-SAME: () #[[ATTR20:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: call void @readonly() #[[ATTR16:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: mustprogress readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2 -; IS__TUNIT_NPM-SAME: () #[[ATTR22:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: call void @readonly() #[[ATTR18:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: mustprogress readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2 -; IS__CGSCC_OPM-SAME: () #[[ATTR23:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @readonly() #[[ATTR19:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: mustprogress readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2 -; IS__CGSCC_NPM-SAME: () #[[ATTR25:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: call void @readonly() #[[ATTR21:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret void +; IS________OPM: Function Attrs: mustprogress readonly willreturn +; IS________OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2 +; IS________OPM-SAME: () #[[ATTR22:[0-9]+]] { +; IS________OPM-NEXT: call void @readonly() #[[ATTR18:[0-9]+]] +; IS________OPM-NEXT: ret void +; +; IS________NPM: Function Attrs: mustprogress readonly willreturn +; IS________NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2 +; IS________NPM-SAME: () #[[ATTR24:[0-9]+]] { +; IS________NPM-NEXT: call void @readonly() #[[ATTR20:[0-9]+]] +; IS________NPM-NEXT: ret void ; call void @readonly() ret void } define void @willreturn_mustprogress_caller_3() mustprogress { -; IS__TUNIT_OPM: Function Attrs: mustprogress nosync readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3 -; IS__TUNIT_OPM-SAME: () #[[ATTR21:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: call void @readnone() -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: mustprogress nosync readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3 -; IS__TUNIT_NPM-SAME: () #[[ATTR23:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: call void @readnone() -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: mustprogress nosync readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3 -; IS__CGSCC_OPM-SAME: () #[[ATTR24:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @readnone() -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: mustprogress nosync readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3 -; IS__CGSCC_NPM-SAME: () #[[ATTR26:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: call void @readnone() -; IS__CGSCC_NPM-NEXT: ret void +; IS________OPM: Function Attrs: mustprogress nosync readnone willreturn +; IS________OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3 +; IS________OPM-SAME: () #[[ATTR23:[0-9]+]] { +; IS________OPM-NEXT: call void @readnone() +; IS________OPM-NEXT: ret void +; +; IS________NPM: Function Attrs: mustprogress nosync readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3 +; IS________NPM-SAME: () #[[ATTR25:[0-9]+]] { +; IS________NPM-NEXT: call void @readnone() +; IS________NPM-NEXT: ret void ; call void @readnone() ret void @@ -2204,29 +1512,17 @@ ret void } define void @willreturn_mustprogress_callee_2() { -; IS__TUNIT_OPM: Function Attrs: readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 -; IS__TUNIT_OPM-SAME: () #[[ATTR22:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: call void @readonly_mustprogress() #[[ATTR22]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 -; IS__TUNIT_NPM-SAME: () #[[ATTR24:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: call void @readonly_mustprogress() #[[ATTR24]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 -; IS__CGSCC_OPM-SAME: () #[[ATTR25:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @readonly_mustprogress() #[[ATTR25]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 -; IS__CGSCC_NPM-SAME: () #[[ATTR27:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: call void @readonly_mustprogress() #[[ATTR27]] -; IS__CGSCC_NPM-NEXT: ret void +; IS________OPM: Function Attrs: readonly willreturn +; IS________OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 +; IS________OPM-SAME: () #[[ATTR24:[0-9]+]] { +; IS________OPM-NEXT: call void @readonly_mustprogress() #[[ATTR24]] +; IS________OPM-NEXT: ret void +; +; IS________NPM: Function Attrs: readonly willreturn +; IS________NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 +; IS________NPM-SAME: () #[[ATTR26:[0-9]+]] { +; IS________NPM-NEXT: call void @readonly_mustprogress() #[[ATTR26]] +; IS________NPM-NEXT: ret void ; call void @readonly_mustprogress() ret void @@ -2240,29 +1536,17 @@ ret void } define void @willreturn_mustprogress_callee_4() { -; IS__TUNIT_OPM: Function Attrs: readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 -; IS__TUNIT_OPM-SAME: () #[[ATTR22]] { -; IS__TUNIT_OPM-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR22]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 -; IS__TUNIT_NPM-SAME: () #[[ATTR24]] { -; IS__TUNIT_NPM-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR24]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 -; IS__CGSCC_OPM-SAME: () #[[ATTR25]] { -; IS__CGSCC_OPM-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR25]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 -; IS__CGSCC_NPM-SAME: () #[[ATTR27]] { -; IS__CGSCC_NPM-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR27]] -; IS__CGSCC_NPM-NEXT: ret void +; IS________OPM: Function Attrs: readonly willreturn +; IS________OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 +; IS________OPM-SAME: () #[[ATTR24]] { +; IS________OPM-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR24]] +; IS________OPM-NEXT: ret void +; +; IS________NPM: Function Attrs: readonly willreturn +; IS________NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 +; IS________NPM-SAME: () #[[ATTR26]] { +; IS________NPM-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR26]] +; IS________NPM-NEXT: ret void ; call void @willreturn_mustprogress_callee_2() ret void @@ -2271,63 +1555,69 @@ attributes #0 = { nounwind uwtable noinline } attributes #1 = { uwtable noinline } ;. -; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } ; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } -; IS__TUNIT_OPM: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree noinline nosync nounwind uwtable } -; IS__TUNIT_OPM: attributes #[[ATTR4]] = { noreturn } -; IS__TUNIT_OPM: attributes #[[ATTR5]] = { noinline noreturn nounwind uwtable } -; IS__TUNIT_OPM: attributes #[[ATTR6]] = { noinline nounwind uwtable } -; IS__TUNIT_OPM: attributes #[[ATTR7:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR8:[0-9]+]] = { norecurse willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR9]] = { noinline nounwind uwtable willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR10:[0-9]+]] = { noinline uwtable willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR11]] = { nounwind willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR12]] = { argmemonly nofree noinline nosync nounwind readonly uwtable } -; IS__TUNIT_OPM: attributes #[[ATTR13]] = { nofree noinline noreturn nosync nounwind readnone uwtable } -; IS__TUNIT_OPM: attributes #[[ATTR14:[0-9]+]] = { noreturn nounwind } -; IS__TUNIT_OPM: attributes #[[ATTR15]] = { nofree nosync nounwind readnone } -; IS__TUNIT_OPM: attributes #[[ATTR16]] = { readonly } -; IS__TUNIT_OPM: attributes #[[ATTR17:[0-9]+]] = { readnone } -; IS__TUNIT_OPM: attributes #[[ATTR18]] = { mustprogress } -; IS__TUNIT_OPM: attributes #[[ATTR19:[0-9]+]] = { mustprogress readonly } -; IS__TUNIT_OPM: attributes #[[ATTR20]] = { mustprogress readonly willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR21]] = { mustprogress nosync readnone willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR22]] = { readonly willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR23]] = { nofree nosync nounwind } -; IS__TUNIT_OPM: attributes #[[ATTR24]] = { readnone willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR25]] = { nounwind } -; IS__TUNIT_OPM: attributes #[[ATTR26]] = { willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree noinline norecurse nosync nounwind readnone uwtable } +; IS__TUNIT_OPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync nounwind willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR4]] = { nofree noinline nosync nounwind uwtable } +; IS__TUNIT_OPM: attributes #[[ATTR5]] = { noreturn } +; IS__TUNIT_OPM: attributes #[[ATTR6]] = { noinline noreturn nounwind uwtable } +; IS__TUNIT_OPM: attributes #[[ATTR7]] = { noinline nounwind uwtable } +; IS__TUNIT_OPM: attributes #[[ATTR8:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR9]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR10:[0-9]+]] = { norecurse willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR11]] = { noinline nounwind uwtable willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR12:[0-9]+]] = { noinline uwtable willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR13]] = { nounwind willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR14]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable } +; IS__TUNIT_OPM: attributes #[[ATTR15]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } +; IS__TUNIT_OPM: attributes #[[ATTR16:[0-9]+]] = { noreturn nounwind } +; IS__TUNIT_OPM: attributes #[[ATTR17]] = { nofree norecurse nosync nounwind readnone } +; IS__TUNIT_OPM: attributes #[[ATTR18]] = { readonly } +; IS__TUNIT_OPM: attributes #[[ATTR19:[0-9]+]] = { readnone } +; IS__TUNIT_OPM: attributes #[[ATTR20]] = { mustprogress } +; IS__TUNIT_OPM: attributes #[[ATTR21:[0-9]+]] = { mustprogress readonly } +; IS__TUNIT_OPM: attributes #[[ATTR22]] = { mustprogress readonly willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR23]] = { mustprogress nosync readnone willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR24]] = { readonly willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR25]] = { nofree nosync nounwind readnone } +; IS__TUNIT_OPM: attributes #[[ATTR26]] = { nofree nosync nounwind } +; IS__TUNIT_OPM: attributes #[[ATTR27]] = { readnone willreturn } +; IS__TUNIT_OPM: attributes #[[ATTR28]] = { nounwind } +; IS__TUNIT_OPM: attributes #[[ATTR29]] = { willreturn } ;. -; IS__TUNIT_NPM: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } -; IS__TUNIT_NPM: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR3]] = { nofree noinline nosync nounwind uwtable } -; IS__TUNIT_NPM: attributes #[[ATTR4]] = { noreturn } -; IS__TUNIT_NPM: attributes #[[ATTR5]] = { noinline noreturn nounwind uwtable } -; IS__TUNIT_NPM: attributes #[[ATTR6]] = { noinline nounwind uwtable } -; IS__TUNIT_NPM: attributes #[[ATTR7:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR8:[0-9]+]] = { norecurse willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR9]] = { noinline nounwind uwtable willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR10:[0-9]+]] = { noinline uwtable willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR11]] = { nounwind willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR12]] = { argmemonly nofree noinline nosync nounwind readonly uwtable willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR13]] = { argmemonly nofree noinline nosync nounwind readonly uwtable } -; IS__TUNIT_NPM: attributes #[[ATTR14]] = { nofree noinline noreturn nosync nounwind readnone uwtable } -; IS__TUNIT_NPM: attributes #[[ATTR15:[0-9]+]] = { noreturn nounwind } -; IS__TUNIT_NPM: attributes #[[ATTR16]] = { nofree nosync nounwind readnone } -; IS__TUNIT_NPM: attributes #[[ATTR17]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR18]] = { readonly } -; IS__TUNIT_NPM: attributes #[[ATTR19:[0-9]+]] = { readnone } -; IS__TUNIT_NPM: attributes #[[ATTR20]] = { mustprogress } -; IS__TUNIT_NPM: attributes #[[ATTR21:[0-9]+]] = { mustprogress readonly } -; IS__TUNIT_NPM: attributes #[[ATTR22]] = { mustprogress readonly willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR23]] = { mustprogress nosync readnone willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR24]] = { readonly willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR25]] = { nofree nosync nounwind } -; IS__TUNIT_NPM: attributes #[[ATTR26]] = { readnone willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR27]] = { nounwind } -; IS__TUNIT_NPM: attributes #[[ATTR28]] = { willreturn } +; IS________NPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; IS________NPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } +; IS________NPM: attributes #[[ATTR2]] = { nofree noinline norecurse nosync nounwind readnone uwtable } +; IS________NPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync nounwind willreturn } +; IS________NPM: attributes #[[ATTR4]] = { nofree noinline nosync nounwind uwtable } +; IS________NPM: attributes #[[ATTR5]] = { noreturn } +; IS________NPM: attributes #[[ATTR6]] = { noinline noreturn nounwind uwtable } +; IS________NPM: attributes #[[ATTR7]] = { noinline nounwind uwtable } +; IS________NPM: attributes #[[ATTR8:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; IS________NPM: attributes #[[ATTR9]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS________NPM: attributes #[[ATTR10:[0-9]+]] = { norecurse willreturn } +; IS________NPM: attributes #[[ATTR11]] = { noinline nounwind uwtable willreturn } +; IS________NPM: attributes #[[ATTR12:[0-9]+]] = { noinline uwtable willreturn } +; IS________NPM: attributes #[[ATTR13]] = { nounwind willreturn } +; IS________NPM: attributes #[[ATTR14]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn } +; IS________NPM: attributes #[[ATTR15]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable } +; IS________NPM: attributes #[[ATTR16]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } +; IS________NPM: attributes #[[ATTR17:[0-9]+]] = { noreturn nounwind } +; IS________NPM: attributes #[[ATTR18]] = { nofree norecurse nosync nounwind readnone } +; IS________NPM: attributes #[[ATTR19]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS________NPM: attributes #[[ATTR20]] = { readonly } +; IS________NPM: attributes #[[ATTR21:[0-9]+]] = { readnone } +; IS________NPM: attributes #[[ATTR22]] = { mustprogress } +; IS________NPM: attributes #[[ATTR23:[0-9]+]] = { mustprogress readonly } +; IS________NPM: attributes #[[ATTR24]] = { mustprogress readonly willreturn } +; IS________NPM: attributes #[[ATTR25]] = { mustprogress nosync readnone willreturn } +; IS________NPM: attributes #[[ATTR26]] = { readonly willreturn } +; IS________NPM: attributes #[[ATTR27]] = { nofree nosync nounwind readnone } +; IS________NPM: attributes #[[ATTR28]] = { nofree nosync nounwind } +; IS________NPM: attributes #[[ATTR29]] = { readnone willreturn } +; IS________NPM: attributes #[[ATTR30]] = { nounwind } +; IS________NPM: attributes #[[ATTR31]] = { willreturn } ;. ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } @@ -2340,59 +1630,24 @@ ; IS__CGSCC_OPM: attributes #[[ATTR8:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR9]] = { nofree noinline nosync nounwind readnone uwtable willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR10:[0-9]+]] = { norecurse willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR11]] = { noinline norecurse nounwind uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR12]] = { noinline norecurse noreturn nounwind uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR13:[0-9]+]] = { noinline uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR14]] = { nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR15]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR16]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR17:[0-9]+]] = { noreturn nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR18]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC_OPM: attributes #[[ATTR19]] = { readonly } -; IS__CGSCC_OPM: attributes #[[ATTR20:[0-9]+]] = { readnone } -; IS__CGSCC_OPM: attributes #[[ATTR21]] = { mustprogress } -; IS__CGSCC_OPM: attributes #[[ATTR22:[0-9]+]] = { mustprogress readonly } -; IS__CGSCC_OPM: attributes #[[ATTR23]] = { mustprogress readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR24]] = { mustprogress nosync readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR25]] = { readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR26]] = { nofree nosync nounwind readnone } -; IS__CGSCC_OPM: attributes #[[ATTR27]] = { nofree nosync nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR28]] = { readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR29]] = { nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR30]] = { willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR31]] = { nounwind readnone } -;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree noinline norecurse nosync nounwind readnone uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nofree noinline nosync nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR5]] = { noreturn } -; IS__CGSCC_NPM: attributes #[[ATTR6]] = { noinline noreturn nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR7]] = { noinline nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR8:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR9]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR10:[0-9]+]] = { norecurse willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR11]] = { noinline norecurse nounwind uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR12]] = { noinline norecurse noreturn nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR13:[0-9]+]] = { noinline uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR14]] = { nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR15]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR16]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR17]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR18:[0-9]+]] = { noreturn nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR19]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC_NPM: attributes #[[ATTR20]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR21]] = { readonly } -; IS__CGSCC_NPM: attributes #[[ATTR22:[0-9]+]] = { readnone } -; IS__CGSCC_NPM: attributes #[[ATTR23]] = { mustprogress } -; IS__CGSCC_NPM: attributes #[[ATTR24:[0-9]+]] = { mustprogress readonly } -; IS__CGSCC_NPM: attributes #[[ATTR25]] = { mustprogress readonly willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR26]] = { mustprogress nosync readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR27]] = { readonly willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR28]] = { nofree nosync nounwind readnone } -; IS__CGSCC_NPM: attributes #[[ATTR29]] = { nofree nosync nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR30]] = { readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR31]] = { nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR32]] = { willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR11]] = { noinline nounwind uwtable willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR12:[0-9]+]] = { noinline uwtable willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR13]] = { nounwind willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR14]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable } +; IS__CGSCC_OPM: attributes #[[ATTR15]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } +; IS__CGSCC_OPM: attributes #[[ATTR16:[0-9]+]] = { noreturn nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR17]] = { nofree norecurse nosync nounwind readnone } +; IS__CGSCC_OPM: attributes #[[ATTR18]] = { readonly } +; IS__CGSCC_OPM: attributes #[[ATTR19:[0-9]+]] = { readnone } +; IS__CGSCC_OPM: attributes #[[ATTR20]] = { mustprogress } +; IS__CGSCC_OPM: attributes #[[ATTR21:[0-9]+]] = { mustprogress readonly } +; IS__CGSCC_OPM: attributes #[[ATTR22]] = { mustprogress readonly willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR23]] = { mustprogress nosync readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR24]] = { readonly willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR25]] = { nofree nosync nounwind readnone } +; IS__CGSCC_OPM: attributes #[[ATTR26]] = { nofree nosync nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR27]] = { readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR28]] = { nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR29]] = { willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR30]] = { nounwind readnone } ;. diff --git a/llvm/test/Transforms/Attributor/wrapper.ll b/llvm/test/Transforms/Attributor/wrapper.ll --- a/llvm/test/Transforms/Attributor/wrapper.ll +++ b/llvm/test/Transforms/Attributor/wrapper.ll @@ -61,7 +61,8 @@ ; CHECK: tail call i32 @2(i32 %0) ; CHECK: ret ; -; CHECK-NOT: Function Attrs: +; FIXME: This is wrong +; CHECK: Function Attrs: norecurse ; CHECK: define internal i32 @2(i32 %0) define linkonce i32 @inner3(i32) { entry: diff --git a/llvm/test/Transforms/OpenMP/custom_state_machines.ll b/llvm/test/Transforms/OpenMP/custom_state_machines.ll --- a/llvm/test/Transforms/OpenMP/custom_state_machines.ll +++ b/llvm/test/Transforms/OpenMP/custom_state_machines.ll @@ -870,9 +870,9 @@ ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind ; AMDGPU-LABEL: define {{[^@]+}}@no_parallel_region_in_here.internalized -; AMDGPU-SAME: () #[[ATTR1:[0-9]+]] { +; AMDGPU-SAME: () #[[ATTR0]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2:[0-9]+]]) #[[ATTR3]] ; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(%struct.ident_t* noundef @[[GLOB2]], i32 [[TMP0]]) #[[ATTR3]] @@ -889,7 +889,7 @@ ; ; AMDGPU: Function Attrs: convergent noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@no_parallel_region_in_here -; AMDGPU-SAME: () #[[ATTR1]] { +; AMDGPU-SAME: () #[[ATTR1:[0-9]+]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB2]]) ; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(%struct.ident_t* @[[GLOB2]], i32 [[TMP0]]) @@ -1113,9 +1113,9 @@ ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_before.internalized -; AMDGPU-SAME: () #[[ATTR1]] { +; AMDGPU-SAME: () #[[ATTR0]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 ; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2]]) #[[ATTR3]] @@ -1158,9 +1158,9 @@ ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_after.internalized -; AMDGPU-SAME: () #[[ATTR1]] { +; AMDGPU-SAME: () #[[ATTR0]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 ; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2]]) #[[ATTR3]] @@ -1620,9 +1620,9 @@ ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after.internalized -; AMDGPU-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { +; AMDGPU-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4 @@ -1632,7 +1632,7 @@ ; AMDGPU-NEXT: br label [[RETURN:%.*]] ; AMDGPU: if.end: ; AMDGPU-NEXT: [[SUB:%.*]] = sub nsw i32 [[A]], 1 -; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR8]] +; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR11:[0-9]+]] ; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after.internalized() #[[ATTR8]] ; AMDGPU-NEXT: br label [[RETURN]] ; AMDGPU: return: @@ -1772,9 +1772,9 @@ ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after_after.internalized -; AMDGPU-SAME: () #[[ATTR1]] { +; AMDGPU-SAME: () #[[ATTR0]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 ; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2]]) #[[ATTR3]] @@ -1846,9 +1846,9 @@ ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind ; NVPTX-LABEL: define {{[^@]+}}@no_parallel_region_in_here.internalized -; NVPTX-SAME: () #[[ATTR1:[0-9]+]] { +; NVPTX-SAME: () #[[ATTR0]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2:[0-9]+]]) #[[ATTR3]] ; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(%struct.ident_t* noundef @[[GLOB2]], i32 [[TMP0]]) #[[ATTR3]] @@ -1865,7 +1865,7 @@ ; ; NVPTX: Function Attrs: convergent noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@no_parallel_region_in_here -; NVPTX-SAME: () #[[ATTR1]] { +; NVPTX-SAME: () #[[ATTR1:[0-9]+]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB2]]) ; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(%struct.ident_t* @[[GLOB2]], i32 [[TMP0]]) @@ -2087,9 +2087,9 @@ ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_before.internalized -; NVPTX-SAME: () #[[ATTR1]] { +; NVPTX-SAME: () #[[ATTR0]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 ; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2]]) #[[ATTR3]] @@ -2132,9 +2132,9 @@ ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_after.internalized -; NVPTX-SAME: () #[[ATTR1]] { +; NVPTX-SAME: () #[[ATTR0]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 ; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2]]) #[[ATTR3]] @@ -2590,9 +2590,9 @@ ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after.internalized -; NVPTX-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { +; NVPTX-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4 @@ -2602,7 +2602,7 @@ ; NVPTX-NEXT: br label [[RETURN:%.*]] ; NVPTX: if.end: ; NVPTX-NEXT: [[SUB:%.*]] = sub nsw i32 [[A]], 1 -; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR8]] +; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR11:[0-9]+]] ; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after.internalized() #[[ATTR8]] ; NVPTX-NEXT: br label [[RETURN]] ; NVPTX: return: @@ -2741,9 +2741,9 @@ ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after_after.internalized -; NVPTX-SAME: () #[[ATTR1]] { +; NVPTX-SAME: () #[[ATTR0]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 ; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2]]) #[[ATTR3]] @@ -2815,9 +2815,9 @@ ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@no_parallel_region_in_here.internalized -; AMDGPU-DISABLED-SAME: () #[[ATTR1:[0-9]+]] { +; AMDGPU-DISABLED-SAME: () #[[ATTR0]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2:[0-9]+]]) #[[ATTR3]] ; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(%struct.ident_t* noundef @[[GLOB2]], i32 [[TMP0]]) #[[ATTR3]] @@ -2834,7 +2834,7 @@ ; ; AMDGPU-DISABLED: Function Attrs: convergent noinline nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@no_parallel_region_in_here -; AMDGPU-DISABLED-SAME: () #[[ATTR1]] { +; AMDGPU-DISABLED-SAME: () #[[ATTR1:[0-9]+]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB2]]) ; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(%struct.ident_t* @[[GLOB2]], i32 [[TMP0]]) @@ -2970,9 +2970,9 @@ ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_before.internalized -; AMDGPU-DISABLED-SAME: () #[[ATTR1]] { +; AMDGPU-DISABLED-SAME: () #[[ATTR0]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2]]) #[[ATTR3]] @@ -3015,9 +3015,9 @@ ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_after.internalized -; AMDGPU-DISABLED-SAME: () #[[ATTR1]] { +; AMDGPU-DISABLED-SAME: () #[[ATTR0]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2]]) #[[ATTR3]] @@ -3315,9 +3315,9 @@ ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after.internalized -; AMDGPU-DISABLED-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { +; AMDGPU-DISABLED-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4 @@ -3327,7 +3327,7 @@ ; AMDGPU-DISABLED-NEXT: br label [[RETURN:%.*]] ; AMDGPU-DISABLED: if.end: ; AMDGPU-DISABLED-NEXT: [[SUB:%.*]] = sub nsw i32 [[A]], 1 -; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR8]] +; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR11:[0-9]+]] ; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after.internalized() #[[ATTR8]] ; AMDGPU-DISABLED-NEXT: br label [[RETURN]] ; AMDGPU-DISABLED: return: @@ -3436,9 +3436,9 @@ ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after_after.internalized -; AMDGPU-DISABLED-SAME: () #[[ATTR1]] { +; AMDGPU-DISABLED-SAME: () #[[ATTR0]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2]]) #[[ATTR3]] @@ -3510,9 +3510,9 @@ ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@no_parallel_region_in_here.internalized -; NVPTX-DISABLED-SAME: () #[[ATTR1:[0-9]+]] { +; NVPTX-DISABLED-SAME: () #[[ATTR0]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2:[0-9]+]]) #[[ATTR3]] ; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(%struct.ident_t* noundef @[[GLOB2]], i32 [[TMP0]]) #[[ATTR3]] @@ -3529,7 +3529,7 @@ ; ; NVPTX-DISABLED: Function Attrs: convergent noinline nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@no_parallel_region_in_here -; NVPTX-DISABLED-SAME: () #[[ATTR1]] { +; NVPTX-DISABLED-SAME: () #[[ATTR1:[0-9]+]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB2]]) ; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(%struct.ident_t* @[[GLOB2]], i32 [[TMP0]]) @@ -3665,9 +3665,9 @@ ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_before.internalized -; NVPTX-DISABLED-SAME: () #[[ATTR1]] { +; NVPTX-DISABLED-SAME: () #[[ATTR0]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2]]) #[[ATTR3]] @@ -3710,9 +3710,9 @@ ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_after.internalized -; NVPTX-DISABLED-SAME: () #[[ATTR1]] { +; NVPTX-DISABLED-SAME: () #[[ATTR0]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2]]) #[[ATTR3]] @@ -4010,9 +4010,9 @@ ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after.internalized -; NVPTX-DISABLED-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { +; NVPTX-DISABLED-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4 @@ -4022,7 +4022,7 @@ ; NVPTX-DISABLED-NEXT: br label [[RETURN:%.*]] ; NVPTX-DISABLED: if.end: ; NVPTX-DISABLED-NEXT: [[SUB:%.*]] = sub nsw i32 [[A]], 1 -; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR8]] +; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR11:[0-9]+]] ; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after.internalized() #[[ATTR8]] ; NVPTX-DISABLED-NEXT: br label [[RETURN]] ; NVPTX-DISABLED: return: @@ -4131,9 +4131,9 @@ ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after_after.internalized -; NVPTX-DISABLED-SAME: () #[[ATTR1]] { +; NVPTX-DISABLED-SAME: () #[[ATTR0]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2]]) #[[ATTR3]] diff --git a/llvm/test/Transforms/OpenMP/remove_globalization.ll b/llvm/test/Transforms/OpenMP/remove_globalization.ll --- a/llvm/test/Transforms/OpenMP/remove_globalization.ll +++ b/llvm/test/Transforms/OpenMP/remove_globalization.ll @@ -30,18 +30,18 @@ ; CHECK-LABEL: define {{[^@]+}}@kernel() { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(%struct.ident_t* nonnull null, i8 1, i1 false, i1 true) -; CHECK-NEXT: call void @foo() #[[ATTR4:[0-9]+]] -; CHECK-NEXT: call void @bar() #[[ATTR4]] -; CHECK-NEXT: call void @unknown_no_openmp() #[[ATTR3:[0-9]+]] +; CHECK-NEXT: call void @foo() #[[ATTR3:[0-9]+]] +; CHECK-NEXT: call void @bar() #[[ATTR3]] +; CHECK-NEXT: call void @unknown_no_openmp() #[[ATTR2:[0-9]+]] ; CHECK-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* nonnull null, i8 1, i1 true) ; CHECK-NEXT: ret void ; ; CHECK-DISABLED-LABEL: define {{[^@]+}}@kernel() { ; CHECK-DISABLED-NEXT: entry: ; CHECK-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(%struct.ident_t* nonnull null, i8 1, i1 false, i1 true) -; CHECK-DISABLED-NEXT: call void @foo() #[[ATTR4:[0-9]+]] -; CHECK-DISABLED-NEXT: call void @bar() #[[ATTR4]] -; CHECK-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR3:[0-9]+]] +; CHECK-DISABLED-NEXT: call void @foo() #[[ATTR3:[0-9]+]] +; CHECK-DISABLED-NEXT: call void @bar() #[[ATTR3]] +; CHECK-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR2:[0-9]+]] ; CHECK-DISABLED-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* nonnull null, i8 1, i1 true) ; CHECK-DISABLED-NEXT: ret void ; @@ -78,17 +78,17 @@ ; CHECK-LABEL: define {{[^@]+}}@bar ; CHECK-SAME: () #[[ATTR0]] { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[TMP0:%.*]] = call i8* @__kmpc_alloc_shared(i64 noundef 4) #[[ATTR4]], !dbg [[DBG8:![0-9]+]] -; CHECK-NEXT: call void @share(i8* nofree writeonly [[TMP0]]) #[[ATTR5:[0-9]+]] -; CHECK-NEXT: call void @__kmpc_free_shared(i8* [[TMP0]], i64 noundef 4) #[[ATTR4]] +; CHECK-NEXT: [[TMP0:%.*]] = call i8* @__kmpc_alloc_shared(i64 noundef 4) #[[ATTR3]], !dbg [[DBG8:![0-9]+]] +; CHECK-NEXT: call void @share(i8* nofree writeonly [[TMP0]]) #[[ATTR4:[0-9]+]] +; CHECK-NEXT: call void @__kmpc_free_shared(i8* [[TMP0]], i64 noundef 4) #[[ATTR3]] ; CHECK-NEXT: ret void ; ; CHECK-DISABLED-LABEL: define {{[^@]+}}@bar ; CHECK-DISABLED-SAME: () #[[ATTR0]] { ; CHECK-DISABLED-NEXT: entry: -; CHECK-DISABLED-NEXT: [[TMP0:%.*]] = call i8* @__kmpc_alloc_shared(i64 noundef 4) #[[ATTR4]], !dbg [[DBG8:![0-9]+]] -; CHECK-DISABLED-NEXT: call void @share(i8* nofree writeonly [[TMP0]]) #[[ATTR5:[0-9]+]] -; CHECK-DISABLED-NEXT: call void @__kmpc_free_shared(i8* [[TMP0]], i64 noundef 4) #[[ATTR4]] +; CHECK-DISABLED-NEXT: [[TMP0:%.*]] = call i8* @__kmpc_alloc_shared(i64 noundef 4) #[[ATTR3]], !dbg [[DBG8:![0-9]+]] +; CHECK-DISABLED-NEXT: call void @share(i8* nofree writeonly [[TMP0]]) #[[ATTR4:[0-9]+]] +; CHECK-DISABLED-NEXT: call void @__kmpc_free_shared(i8* [[TMP0]], i64 noundef 4) #[[ATTR3]] ; CHECK-DISABLED-NEXT: ret void ; entry: @@ -99,29 +99,19 @@ } define internal void @use(i8* %x) { -; CHECK-LABEL: define {{[^@]+}}@use -; CHECK-SAME: (i8* noalias nocapture nofree readnone [[X:%.*]]) #[[ATTR1:[0-9]+]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: ret void -; -; CHECK-DISABLED-LABEL: define {{[^@]+}}@use -; CHECK-DISABLED-SAME: (i8* noalias nocapture nofree readnone [[X:%.*]]) #[[ATTR1:[0-9]+]] { -; CHECK-DISABLED-NEXT: entry: -; CHECK-DISABLED-NEXT: ret void -; entry: ret void } define internal void @share(i8* %x) { ; CHECK-LABEL: define {{[^@]+}}@share -; CHECK-SAME: (i8* nofree writeonly [[X:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-SAME: (i8* nofree writeonly [[X:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: store i8* [[X]], i8** @S, align 8 ; CHECK-NEXT: ret void ; ; CHECK-DISABLED-LABEL: define {{[^@]+}}@share -; CHECK-DISABLED-SAME: (i8* nofree writeonly [[X:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-DISABLED-SAME: (i8* nofree writeonly [[X:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK-DISABLED-NEXT: entry: ; CHECK-DISABLED-NEXT: store i8* [[X]], i8** @S, align 8 ; CHECK-DISABLED-NEXT: ret void @@ -135,14 +125,12 @@ ; CHECK-LABEL: define {{[^@]+}}@unused() { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 -; CHECK-NEXT: call void @use(i8* noalias readnone undef) ; CHECK-NEXT: ret void ; ; CHECK-DISABLED-LABEL: define {{[^@]+}}@unused() { ; CHECK-DISABLED-NEXT: entry: -; CHECK-DISABLED-NEXT: [[TMP0:%.*]] = call i8* @__kmpc_alloc_shared(i64 4), !dbg [[DBG11:![0-9]+]] -; CHECK-DISABLED-NEXT: call void @use(i8* noalias readnone [[TMP0]]) -; CHECK-DISABLED-NEXT: call void @__kmpc_free_shared(i8* [[TMP0]], i64 4) +; CHECK-DISABLED-NEXT: [[TMP0:%.*]] = call i8* @__kmpc_alloc_shared(i64 4) #[[ATTR3]], !dbg [[DBG11:![0-9]+]] +; CHECK-DISABLED-NEXT: call void @__kmpc_free_shared(i8* [[TMP0]], i64 4) #[[ATTR3]] ; CHECK-DISABLED-NEXT: ret void ; entry: @@ -181,18 +169,16 @@ !14 = !DILocation(line: 6, column: 2, scope: !9) ;. ; CHECK: attributes #[[ATTR0]] = { nosync nounwind } -; CHECK: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; CHECK: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn writeonly } -; CHECK: attributes #[[ATTR3]] = { "llvm.assume"="omp_no_openmp" } -; CHECK: attributes #[[ATTR4]] = { nounwind } -; CHECK: attributes #[[ATTR5]] = { nosync nounwind writeonly } +; CHECK: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind willreturn writeonly } +; CHECK: attributes #[[ATTR2]] = { "llvm.assume"="omp_no_openmp" } +; CHECK: attributes #[[ATTR3]] = { nounwind } +; CHECK: attributes #[[ATTR4]] = { nosync nounwind writeonly } ;. ; CHECK-DISABLED: attributes #[[ATTR0]] = { nosync nounwind } -; CHECK-DISABLED: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; CHECK-DISABLED: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn writeonly } -; CHECK-DISABLED: attributes #[[ATTR3]] = { "llvm.assume"="omp_no_openmp" } -; CHECK-DISABLED: attributes #[[ATTR4]] = { nounwind } -; CHECK-DISABLED: attributes #[[ATTR5]] = { nosync nounwind writeonly } +; CHECK-DISABLED: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind willreturn writeonly } +; CHECK-DISABLED: attributes #[[ATTR2]] = { "llvm.assume"="omp_no_openmp" } +; CHECK-DISABLED: attributes #[[ATTR3]] = { nounwind } +; CHECK-DISABLED: attributes #[[ATTR4]] = { nosync nounwind writeonly } ;. ; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 13.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) ; CHECK: [[META1:![0-9]+]] = !DIFile(filename: "remove_globalization.c", directory: "/tmp/remove_globalization.c") diff --git a/llvm/test/Transforms/OpenMP/replace_globalization.ll b/llvm/test/Transforms/OpenMP/replace_globalization.ll --- a/llvm/test/Transforms/OpenMP/replace_globalization.ll +++ b/llvm/test/Transforms/OpenMP/replace_globalization.ll @@ -167,7 +167,7 @@ ; CHECK-NEXT: ret void ; ; -; CHECK: Function Attrs: nofree nosync nounwind willreturn writeonly +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; CHECK-LABEL: define {{[^@]+}}@use.internalized ; CHECK-SAME: (i8* nofree writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: @@ -182,7 +182,7 @@ ; CHECK-NEXT: ret void ; ;. -; CHECK: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn writeonly } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn writeonly } ; CHECK: attributes #[[ATTR1:[0-9]+]] = { nosync nounwind } ; CHECK: attributes #[[ATTR2:[0-9]+]] = { nounwind readnone speculatable } ; CHECK: attributes #[[ATTR3:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } diff --git a/llvm/test/Transforms/OpenMP/spmdization.ll b/llvm/test/Transforms/OpenMP/spmdization.ll --- a/llvm/test/Transforms/OpenMP/spmdization.ll +++ b/llvm/test/Transforms/OpenMP/spmdization.ll @@ -178,9 +178,9 @@ ; AMDGPU: common.ret: ; AMDGPU-NEXT: ret void ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3:[0-9]+]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2:[0-9]+]] ; AMDGPU-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18:![0-9]+]] -; AMDGPU-NEXT: call void @__omp_outlined__(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 2, i1 false) ; AMDGPU-NEXT: br label [[COMMON_RET]] ; @@ -195,9 +195,9 @@ ; NVPTX: common.ret: ; NVPTX-NEXT: ret void ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3:[0-9]+]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2:[0-9]+]] ; NVPTX-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18:![0-9]+]] -; NVPTX-NEXT: call void @__omp_outlined__(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 2, i1 false) ; NVPTX-NEXT: br label [[COMMON_RET]] ; @@ -249,9 +249,9 @@ ; AMDGPU-DISABLED: common.ret: ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3:[0-9]+]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2:[0-9]+]] ; AMDGPU-DISABLED-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18:![0-9]+]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) ; AMDGPU-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -302,9 +302,9 @@ ; NVPTX-DISABLED: common.ret: ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3:[0-9]+]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2:[0-9]+]] ; NVPTX-DISABLED-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18:![0-9]+]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) ; NVPTX-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -339,7 +339,7 @@ ; AMDGPU-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; AMDGPU-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; AMDGPU: for.cond.cleanup: -; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR6:[0-9]+]] +; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR5:[0-9]+]] ; AMDGPU-NEXT: ret void ; AMDGPU: for.body: ; AMDGPU-NEXT: [[TMP0:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]] @@ -358,7 +358,7 @@ ; NVPTX-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; NVPTX-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; NVPTX: for.cond.cleanup: -; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR6:[0-9]+]] +; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR5:[0-9]+]] ; NVPTX-NEXT: ret void ; NVPTX: for.body: ; NVPTX-NEXT: [[TMP0:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]] @@ -377,7 +377,7 @@ ; AMDGPU-DISABLED-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; AMDGPU-DISABLED-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; AMDGPU-DISABLED: for.cond.cleanup: -; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR6:[0-9]+]] +; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR5:[0-9]+]] ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: for.body: ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]] @@ -396,7 +396,7 @@ ; NVPTX-DISABLED-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; NVPTX-DISABLED-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; NVPTX-DISABLED: for.cond.cleanup: -; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR6:[0-9]+]] +; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR5:[0-9]+]] ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: for.body: ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]] @@ -431,25 +431,25 @@ ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__1 ; AMDGPU-SAME: (i32* noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { ; AMDGPU-NEXT: entry: -; AMDGPU-NEXT: call void @unknown() #[[ATTR7:[0-9]+]] +; AMDGPU-NEXT: call void @unknown() #[[ATTR6:[0-9]+]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__1 ; NVPTX-SAME: (i32* noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { ; NVPTX-NEXT: entry: -; NVPTX-NEXT: call void @unknown() #[[ATTR7:[0-9]+]] +; NVPTX-NEXT: call void @unknown() #[[ATTR6:[0-9]+]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__1 ; AMDGPU-DISABLED-SAME: (i32* noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { ; AMDGPU-DISABLED-NEXT: entry: -; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR7:[0-9]+]] +; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR6:[0-9]+]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__1 ; NVPTX-DISABLED-SAME: (i32* noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { ; NVPTX-DISABLED-NEXT: entry: -; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR7:[0-9]+]] +; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR6:[0-9]+]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -466,7 +466,7 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca i8**, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(i8*** [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__1(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__1(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__1_wrapper @@ -476,7 +476,7 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca i8**, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(i8*** [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__1(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__1(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__1_wrapper @@ -486,7 +486,7 @@ ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca i8**, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(i8*** [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__1(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__1(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__1_wrapper @@ -496,7 +496,7 @@ ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca i8**, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(i8*** [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__1(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__1(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -523,9 +523,9 @@ ; AMDGPU: common.ret: ; AMDGPU-NEXT: ret void ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] ; AMDGPU-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; AMDGPU-NEXT: call void @__omp_outlined__2(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__2(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 2, i1 false) ; AMDGPU-NEXT: br label [[COMMON_RET]] ; @@ -540,9 +540,9 @@ ; NVPTX: common.ret: ; NVPTX-NEXT: ret void ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] ; NVPTX-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; NVPTX-NEXT: call void @__omp_outlined__2(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__2(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 2, i1 false) ; NVPTX-NEXT: br label [[COMMON_RET]] ; @@ -594,9 +594,9 @@ ; AMDGPU-DISABLED: common.ret: ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] ; AMDGPU-DISABLED-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__2(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__2(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) ; AMDGPU-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -647,9 +647,9 @@ ; NVPTX-DISABLED: common.ret: ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] ; NVPTX-DISABLED-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__2(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__2(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) ; NVPTX-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -680,14 +680,14 @@ ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 ; AMDGPU-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 4 ; AMDGPU-NEXT: [[X_ON_STACK:%.*]] = bitcast i8* [[TMP0]] to i32* -; AMDGPU-NEXT: call void @use(i32* nocapture [[X_ON_STACK]]) #[[ATTR6]] +; AMDGPU-NEXT: call void @use(i32* nocapture [[X_ON_STACK]]) #[[ATTR5]] ; AMDGPU-NEXT: br label [[FOR_COND:%.*]] ; AMDGPU: for.cond: ; AMDGPU-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ] ; AMDGPU-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; AMDGPU-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; AMDGPU: for.cond.cleanup: -; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR6]] +; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR5]] ; AMDGPU-NEXT: ret void ; AMDGPU: for.body: ; AMDGPU-NEXT: [[TMP1:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]] @@ -702,14 +702,14 @@ ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 ; NVPTX-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 4 ; NVPTX-NEXT: [[X_ON_STACK:%.*]] = bitcast i8* [[TMP0]] to i32* -; NVPTX-NEXT: call void @use(i32* nocapture [[X_ON_STACK]]) #[[ATTR6]] +; NVPTX-NEXT: call void @use(i32* nocapture [[X_ON_STACK]]) #[[ATTR5]] ; NVPTX-NEXT: br label [[FOR_COND:%.*]] ; NVPTX: for.cond: ; NVPTX-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ] ; NVPTX-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; NVPTX-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; NVPTX: for.cond.cleanup: -; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR6]] +; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR5]] ; NVPTX-NEXT: ret void ; NVPTX: for.body: ; NVPTX-NEXT: [[TMP1:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]] @@ -724,14 +724,14 @@ ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 4 ; AMDGPU-DISABLED-NEXT: [[X_ON_STACK:%.*]] = bitcast i8* [[TMP0]] to i32* -; AMDGPU-DISABLED-NEXT: call void @use(i32* nocapture [[X_ON_STACK]]) #[[ATTR6]] +; AMDGPU-DISABLED-NEXT: call void @use(i32* nocapture [[X_ON_STACK]]) #[[ATTR5]] ; AMDGPU-DISABLED-NEXT: br label [[FOR_COND:%.*]] ; AMDGPU-DISABLED: for.cond: ; AMDGPU-DISABLED-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ] ; AMDGPU-DISABLED-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; AMDGPU-DISABLED-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; AMDGPU-DISABLED: for.cond.cleanup: -; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR6]] +; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR5]] ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: for.body: ; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]] @@ -746,14 +746,14 @@ ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 4 ; NVPTX-DISABLED-NEXT: [[X_ON_STACK:%.*]] = bitcast i8* [[TMP0]] to i32* -; NVPTX-DISABLED-NEXT: call void @use(i32* nocapture [[X_ON_STACK]]) #[[ATTR6]] +; NVPTX-DISABLED-NEXT: call void @use(i32* nocapture [[X_ON_STACK]]) #[[ATTR5]] ; NVPTX-DISABLED-NEXT: br label [[FOR_COND:%.*]] ; NVPTX-DISABLED: for.cond: ; NVPTX-DISABLED-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ] ; NVPTX-DISABLED-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; NVPTX-DISABLED-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; NVPTX-DISABLED: for.cond.cleanup: -; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR6]] +; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR5]] ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: for.body: ; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]] @@ -791,25 +791,25 @@ ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__3 ; AMDGPU-SAME: (i32* noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { ; AMDGPU-NEXT: entry: -; AMDGPU-NEXT: call void @unknown() #[[ATTR7]] +; AMDGPU-NEXT: call void @unknown() #[[ATTR6]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__3 ; NVPTX-SAME: (i32* noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { ; NVPTX-NEXT: entry: -; NVPTX-NEXT: call void @unknown() #[[ATTR7]] +; NVPTX-NEXT: call void @unknown() #[[ATTR6]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__3 ; AMDGPU-DISABLED-SAME: (i32* noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { ; AMDGPU-DISABLED-NEXT: entry: -; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR7]] +; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR6]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__3 ; NVPTX-DISABLED-SAME: (i32* noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { ; NVPTX-DISABLED-NEXT: entry: -; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR7]] +; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR6]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -826,7 +826,7 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca i8**, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(i8*** [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__3(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__3(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__3_wrapper @@ -836,7 +836,7 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca i8**, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(i8*** [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__3(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__3(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__3_wrapper @@ -846,7 +846,7 @@ ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca i8**, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(i8*** [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__3(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__3(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__3_wrapper @@ -856,7 +856,7 @@ ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca i8**, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(i8*** [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__3(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__3(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -884,9 +884,9 @@ ; AMDGPU: common.ret: ; AMDGPU-NEXT: ret void ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] ; AMDGPU-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; AMDGPU-NEXT: call void @__omp_outlined__4(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__4(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 2, i1 false) ; AMDGPU-NEXT: br label [[COMMON_RET]] ; @@ -901,9 +901,9 @@ ; NVPTX: common.ret: ; NVPTX-NEXT: ret void ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] ; NVPTX-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; NVPTX-NEXT: call void @__omp_outlined__4(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__4(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 2, i1 false) ; NVPTX-NEXT: br label [[COMMON_RET]] ; @@ -955,9 +955,9 @@ ; AMDGPU-DISABLED: common.ret: ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] ; AMDGPU-DISABLED-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__4(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__4(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) ; AMDGPU-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -1008,9 +1008,9 @@ ; NVPTX-DISABLED: common.ret: ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] ; NVPTX-DISABLED-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__4(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__4(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) ; NVPTX-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -1045,7 +1045,7 @@ ; AMDGPU-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; AMDGPU-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; AMDGPU: for.cond.cleanup: -; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR6]] +; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR5]] ; AMDGPU-NEXT: ret void ; AMDGPU: for.body: ; AMDGPU-NEXT: [[TMP0:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[CAPTURED_VARS_ADDRS]], i64 0, i64 0 @@ -1066,7 +1066,7 @@ ; NVPTX-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; NVPTX-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; NVPTX: for.cond.cleanup: -; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR6]] +; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR5]] ; NVPTX-NEXT: ret void ; NVPTX: for.body: ; NVPTX-NEXT: [[TMP0:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[CAPTURED_VARS_ADDRS]], i64 0, i64 0 @@ -1087,7 +1087,7 @@ ; AMDGPU-DISABLED-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; AMDGPU-DISABLED-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; AMDGPU-DISABLED: for.cond.cleanup: -; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR6]] +; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR5]] ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: for.body: ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[CAPTURED_VARS_ADDRS]], i64 0, i64 0 @@ -1108,7 +1108,7 @@ ; NVPTX-DISABLED-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; NVPTX-DISABLED-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; NVPTX-DISABLED: for.cond.cleanup: -; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR6]] +; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR5]] ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: for.body: ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[CAPTURED_VARS_ADDRS]], i64 0, i64 0 @@ -1153,7 +1153,7 @@ ; AMDGPU-NEXT: [[TMP0:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA18]] ; AMDGPU-NEXT: [[INC:%.*]] = add nsw i32 [[TMP0]], 1 ; AMDGPU-NEXT: store i32 [[INC]], i32* [[X]], align 4, !tbaa [[TBAA18]] -; AMDGPU-NEXT: call void @unknown() #[[ATTR7]] +; AMDGPU-NEXT: call void @unknown() #[[ATTR6]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__5 @@ -1162,7 +1162,7 @@ ; NVPTX-NEXT: [[TMP0:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA18]] ; NVPTX-NEXT: [[INC:%.*]] = add nsw i32 [[TMP0]], 1 ; NVPTX-NEXT: store i32 [[INC]], i32* [[X]], align 4, !tbaa [[TBAA18]] -; NVPTX-NEXT: call void @unknown() #[[ATTR7]] +; NVPTX-NEXT: call void @unknown() #[[ATTR6]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__5 @@ -1171,7 +1171,7 @@ ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA18]] ; AMDGPU-DISABLED-NEXT: [[INC:%.*]] = add nsw i32 [[TMP0]], 1 ; AMDGPU-DISABLED-NEXT: store i32 [[INC]], i32* [[X]], align 4, !tbaa [[TBAA18]] -; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR7]] +; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR6]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__5 @@ -1180,7 +1180,7 @@ ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA18]] ; NVPTX-DISABLED-NEXT: [[INC:%.*]] = add nsw i32 [[TMP0]], 1 ; NVPTX-DISABLED-NEXT: store i32 [[INC]], i32* [[X]], align 4, !tbaa [[TBAA18]] -; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR7]] +; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR6]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -1203,7 +1203,7 @@ ; AMDGPU-NEXT: [[TMP2:%.*]] = load i8**, i8*** [[GLOBAL_ARGS]], align 8 ; AMDGPU-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i32** ; AMDGPU-NEXT: [[TMP4:%.*]] = load i32*, i32** [[TMP3]], align 8, !tbaa [[TBAA26]] -; AMDGPU-NEXT: call void @__omp_outlined__5(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]], i32* nonnull align 4 dereferenceable(4) [[TMP4]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__5(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]], i32* nonnull align 4 dereferenceable(4) [[TMP4]]) #[[ATTR2]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__5_wrapper @@ -1216,7 +1216,7 @@ ; NVPTX-NEXT: [[TMP2:%.*]] = load i8**, i8*** [[GLOBAL_ARGS]], align 8 ; NVPTX-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i32** ; NVPTX-NEXT: [[TMP4:%.*]] = load i32*, i32** [[TMP3]], align 8, !tbaa [[TBAA26]] -; NVPTX-NEXT: call void @__omp_outlined__5(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]], i32* nonnull align 4 dereferenceable(4) [[TMP4]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__5(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]], i32* nonnull align 4 dereferenceable(4) [[TMP4]]) #[[ATTR2]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__5_wrapper @@ -1229,7 +1229,7 @@ ; AMDGPU-DISABLED-NEXT: [[TMP2:%.*]] = load i8**, i8*** [[GLOBAL_ARGS]], align 8 ; AMDGPU-DISABLED-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i32** ; AMDGPU-DISABLED-NEXT: [[TMP4:%.*]] = load i32*, i32** [[TMP3]], align 8, !tbaa [[TBAA26]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__5(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]], i32* nonnull align 4 dereferenceable(4) [[TMP4]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__5(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]], i32* nonnull align 4 dereferenceable(4) [[TMP4]]) #[[ATTR2]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__5_wrapper @@ -1242,7 +1242,7 @@ ; NVPTX-DISABLED-NEXT: [[TMP2:%.*]] = load i8**, i8*** [[GLOBAL_ARGS]], align 8 ; NVPTX-DISABLED-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i32** ; NVPTX-DISABLED-NEXT: [[TMP4:%.*]] = load i32*, i32** [[TMP3]], align 8, !tbaa [[TBAA26]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__5(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]], i32* nonnull align 4 dereferenceable(4) [[TMP4]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__5(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]], i32* nonnull align 4 dereferenceable(4) [[TMP4]]) #[[ATTR2]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -1272,9 +1272,9 @@ ; AMDGPU: common.ret: ; AMDGPU-NEXT: ret void ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] ; AMDGPU-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; AMDGPU-NEXT: call void @__omp_outlined__6(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__6(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 2, i1 false) ; AMDGPU-NEXT: br label [[COMMON_RET]] ; @@ -1289,9 +1289,9 @@ ; NVPTX: common.ret: ; NVPTX-NEXT: ret void ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] ; NVPTX-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; NVPTX-NEXT: call void @__omp_outlined__6(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__6(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 2, i1 false) ; NVPTX-NEXT: br label [[COMMON_RET]] ; @@ -1343,9 +1343,9 @@ ; AMDGPU-DISABLED: common.ret: ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] ; AMDGPU-DISABLED-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__6(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__6(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) ; AMDGPU-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -1396,9 +1396,9 @@ ; NVPTX-DISABLED: common.ret: ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] ; NVPTX-DISABLED-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__6(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__6(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) ; NVPTX-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -1448,7 +1448,7 @@ ; AMDGPU-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; AMDGPU-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; AMDGPU: for.cond.cleanup: -; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR6]] +; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR5]] ; AMDGPU-NEXT: ret void ; AMDGPU: for.body: ; AMDGPU-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[CAPTURED_VARS_ADDRS]], i64 0, i64 0 @@ -1484,7 +1484,7 @@ ; NVPTX-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; NVPTX-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; NVPTX: for.cond.cleanup: -; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR6]] +; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR5]] ; NVPTX-NEXT: ret void ; NVPTX: for.body: ; NVPTX-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[CAPTURED_VARS_ADDRS]], i64 0, i64 0 @@ -1507,7 +1507,7 @@ ; AMDGPU-DISABLED-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; AMDGPU-DISABLED-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; AMDGPU-DISABLED: for.cond.cleanup: -; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR6]] +; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR5]] ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: for.body: ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[CAPTURED_VARS_ADDRS]], i64 0, i64 0 @@ -1530,7 +1530,7 @@ ; NVPTX-DISABLED-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; NVPTX-DISABLED-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; NVPTX-DISABLED: for.cond.cleanup: -; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR6]] +; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR5]] ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: for.body: ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[CAPTURED_VARS_ADDRS]], i64 0, i64 0 @@ -1576,7 +1576,7 @@ ; AMDGPU-NEXT: [[TMP0:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA18]] ; AMDGPU-NEXT: [[INC:%.*]] = add nsw i32 [[TMP0]], 1 ; AMDGPU-NEXT: store i32 [[INC]], i32* [[X]], align 4, !tbaa [[TBAA18]] -; AMDGPU-NEXT: call void @unknown() #[[ATTR7]] +; AMDGPU-NEXT: call void @unknown() #[[ATTR6]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__7 @@ -1585,7 +1585,7 @@ ; NVPTX-NEXT: [[TMP0:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA18]] ; NVPTX-NEXT: [[INC:%.*]] = add nsw i32 [[TMP0]], 1 ; NVPTX-NEXT: store i32 [[INC]], i32* [[X]], align 4, !tbaa [[TBAA18]] -; NVPTX-NEXT: call void @unknown() #[[ATTR7]] +; NVPTX-NEXT: call void @unknown() #[[ATTR6]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__7 @@ -1594,7 +1594,7 @@ ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA18]] ; AMDGPU-DISABLED-NEXT: [[INC:%.*]] = add nsw i32 [[TMP0]], 1 ; AMDGPU-DISABLED-NEXT: store i32 [[INC]], i32* [[X]], align 4, !tbaa [[TBAA18]] -; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR7]] +; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR6]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__7 @@ -1603,7 +1603,7 @@ ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA18]] ; NVPTX-DISABLED-NEXT: [[INC:%.*]] = add nsw i32 [[TMP0]], 1 ; NVPTX-DISABLED-NEXT: store i32 [[INC]], i32* [[X]], align 4, !tbaa [[TBAA18]] -; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR7]] +; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR6]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -1626,7 +1626,7 @@ ; AMDGPU-NEXT: [[TMP2:%.*]] = load i8**, i8*** [[GLOBAL_ARGS]], align 8 ; AMDGPU-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i32** ; AMDGPU-NEXT: [[TMP4:%.*]] = load i32*, i32** [[TMP3]], align 8, !tbaa [[TBAA26]] -; AMDGPU-NEXT: call void @__omp_outlined__7(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]], i32* nonnull align 4 dereferenceable(4) [[TMP4]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__7(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]], i32* nonnull align 4 dereferenceable(4) [[TMP4]]) #[[ATTR2]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__7_wrapper @@ -1639,7 +1639,7 @@ ; NVPTX-NEXT: [[TMP2:%.*]] = load i8**, i8*** [[GLOBAL_ARGS]], align 8 ; NVPTX-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i32** ; NVPTX-NEXT: [[TMP4:%.*]] = load i32*, i32** [[TMP3]], align 8, !tbaa [[TBAA26]] -; NVPTX-NEXT: call void @__omp_outlined__7(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]], i32* nonnull align 4 dereferenceable(4) [[TMP4]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__7(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]], i32* nonnull align 4 dereferenceable(4) [[TMP4]]) #[[ATTR2]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__7_wrapper @@ -1652,7 +1652,7 @@ ; AMDGPU-DISABLED-NEXT: [[TMP2:%.*]] = load i8**, i8*** [[GLOBAL_ARGS]], align 8 ; AMDGPU-DISABLED-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i32** ; AMDGPU-DISABLED-NEXT: [[TMP4:%.*]] = load i32*, i32** [[TMP3]], align 8, !tbaa [[TBAA26]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__7(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]], i32* nonnull align 4 dereferenceable(4) [[TMP4]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__7(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]], i32* nonnull align 4 dereferenceable(4) [[TMP4]]) #[[ATTR2]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__7_wrapper @@ -1665,7 +1665,7 @@ ; NVPTX-DISABLED-NEXT: [[TMP2:%.*]] = load i8**, i8*** [[GLOBAL_ARGS]], align 8 ; NVPTX-DISABLED-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i32** ; NVPTX-DISABLED-NEXT: [[TMP4:%.*]] = load i32*, i32** [[TMP3]], align 8, !tbaa [[TBAA26]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__7(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]], i32* nonnull align 4 dereferenceable(4) [[TMP4]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__7(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]], i32* nonnull align 4 dereferenceable(4) [[TMP4]]) #[[ATTR2]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -1726,8 +1726,8 @@ ; AMDGPU: common.ret: ; AMDGPU-NEXT: ret void ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-NEXT: call void @__omp_outlined__8(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] +; AMDGPU-NEXT: call void @__omp_outlined__8(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) ; AMDGPU-NEXT: br label [[COMMON_RET]] ; @@ -1772,8 +1772,8 @@ ; NVPTX: common.ret: ; NVPTX-NEXT: ret void ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] -; NVPTX-NEXT: call void @__omp_outlined__8(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] +; NVPTX-NEXT: call void @__omp_outlined__8(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) ; NVPTX-NEXT: br label [[COMMON_RET]] ; @@ -1819,8 +1819,8 @@ ; AMDGPU-DISABLED: common.ret: ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__8(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__8(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) ; AMDGPU-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -1865,8 +1865,8 @@ ; NVPTX-DISABLED: common.ret: ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__8(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__8(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTTHREADID_TEMP_]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) ; NVPTX-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -1894,25 +1894,25 @@ ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__8 ; AMDGPU-SAME: (i32* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { ; AMDGPU-NEXT: entry: -; AMDGPU-NEXT: call void @unknown() #[[ATTR7]] +; AMDGPU-NEXT: call void @unknown() #[[ATTR6]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__8 ; NVPTX-SAME: (i32* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { ; NVPTX-NEXT: entry: -; NVPTX-NEXT: call void @unknown() #[[ATTR7]] +; NVPTX-NEXT: call void @unknown() #[[ATTR6]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__8 ; AMDGPU-DISABLED-SAME: (i32* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { ; AMDGPU-DISABLED-NEXT: entry: -; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR7]] +; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR6]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__8 ; NVPTX-DISABLED-SAME: (i32* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { ; NVPTX-DISABLED-NEXT: entry: -; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR7]] +; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR6]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -1969,10 +1969,10 @@ ; AMDGPU: common.ret: ; AMDGPU-NEXT: ret void ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-NEXT: [[TMP2:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i32 1, i64 40, i64 0, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @"_omp_task_entry$" to i32 (i32, i8*)*)) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] +; AMDGPU-NEXT: [[TMP2:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i32 1, i64 40, i64 0, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @"_omp_task_entry$" to i32 (i32, i8*)*)) #[[ATTR2]] ; AMDGPU-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to %struct.kmp_task_t_with_privates* -; AMDGPU-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_omp_task(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i8* [[TMP2]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_omp_task(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i8* [[TMP2]]) #[[ATTR2]] ; AMDGPU-NEXT: [[TMP5:%.*]] = bitcast [0 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8** ; AMDGPU-NEXT: call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*)* @__omp_outlined__9 to i8*), i8* @__omp_outlined__9_wrapper.ID, i8** [[TMP5]], i64 0) ; AMDGPU-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) @@ -2024,10 +2024,10 @@ ; NVPTX: common.ret: ; NVPTX-NEXT: ret void ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] -; NVPTX-NEXT: [[TMP2:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i32 1, i64 40, i64 0, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @"_omp_task_entry$" to i32 (i32, i8*)*)) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] +; NVPTX-NEXT: [[TMP2:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i32 1, i64 40, i64 0, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @"_omp_task_entry$" to i32 (i32, i8*)*)) #[[ATTR2]] ; NVPTX-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to %struct.kmp_task_t_with_privates* -; NVPTX-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_omp_task(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i8* [[TMP2]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_omp_task(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i8* [[TMP2]]) #[[ATTR2]] ; NVPTX-NEXT: [[TMP5:%.*]] = bitcast [0 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8** ; NVPTX-NEXT: call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*)* @__omp_outlined__9 to i8*), i8* @__omp_outlined__9_wrapper.ID, i8** [[TMP5]], i64 0) ; NVPTX-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) @@ -2080,10 +2080,10 @@ ; AMDGPU-DISABLED: common.ret: ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-DISABLED-NEXT: [[TMP2:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i32 1, i64 40, i64 0, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @"_omp_task_entry$" to i32 (i32, i8*)*)) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] +; AMDGPU-DISABLED-NEXT: [[TMP2:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i32 1, i64 40, i64 0, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @"_omp_task_entry$" to i32 (i32, i8*)*)) #[[ATTR2]] ; AMDGPU-DISABLED-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to %struct.kmp_task_t_with_privates* -; AMDGPU-DISABLED-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_omp_task(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i8* [[TMP2]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_omp_task(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i8* [[TMP2]]) #[[ATTR2]] ; AMDGPU-DISABLED-NEXT: [[TMP5:%.*]] = bitcast [0 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8** ; AMDGPU-DISABLED-NEXT: call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*)* @__omp_outlined__9 to i8*), i8* @__omp_outlined__9_wrapper.ID, i8** [[TMP5]], i64 0) ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) @@ -2135,10 +2135,10 @@ ; NVPTX-DISABLED: common.ret: ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR3]] -; NVPTX-DISABLED-NEXT: [[TMP2:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i32 1, i64 40, i64 0, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @"_omp_task_entry$" to i32 (i32, i8*)*)) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) #[[ATTR2]] +; NVPTX-DISABLED-NEXT: [[TMP2:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i32 1, i64 40, i64 0, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @"_omp_task_entry$" to i32 (i32, i8*)*)) #[[ATTR2]] ; NVPTX-DISABLED-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to %struct.kmp_task_t_with_privates* -; NVPTX-DISABLED-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_omp_task(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i8* [[TMP2]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_omp_task(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i8* [[TMP2]]) #[[ATTR2]] ; NVPTX-DISABLED-NEXT: [[TMP5:%.*]] = bitcast [0 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8** ; NVPTX-DISABLED-NEXT: call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*)* @__omp_outlined__9 to i8*), i8* @__omp_outlined__9_wrapper.ID, i8** [[TMP5]], i64 0) ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) @@ -2167,27 +2167,27 @@ ; Function Attrs: alwaysinline convergent nounwind define internal void @.omp_outlined.(i32 %.global_tid., i32* noalias %.part_id., i8* noalias %.privates., void (i8*, ...)* noalias %.copy_fn., i8* %.task_t., %struct.anon* noalias %__context) #9 { ; AMDGPU-LABEL: define {{[^@]+}}@.omp_outlined. -; AMDGPU-SAME: (i32 [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree nonnull readnone [[DOTPART_ID_:%.*]], i8* noalias nocapture nofree readnone align 4294967296 [[DOTPRIVATES_:%.*]], void (i8*, ...)* noalias nocapture nofree readnone [[DOTCOPY_FN_:%.*]], i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[DOTTASK_T_:%.*]], %struct.anon* noalias nocapture nofree readnone [[__CONTEXT:%.*]]) #[[ATTR2:[0-9]+]] { +; AMDGPU-SAME: (i32 [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree nonnull readnone [[DOTPART_ID_:%.*]], i8* noalias nocapture nofree readnone align 4294967296 [[DOTPRIVATES_:%.*]], void (i8*, ...)* noalias nocapture nofree readnone [[DOTCOPY_FN_:%.*]], i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[DOTTASK_T_:%.*]], %struct.anon* noalias nocapture nofree readnone [[__CONTEXT:%.*]]) #[[ATTR0]] { ; AMDGPU-NEXT: entry: -; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR6]] +; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR5]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@.omp_outlined. -; NVPTX-SAME: (i32 [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree nonnull readnone [[DOTPART_ID_:%.*]], i8* noalias nocapture nofree readnone align 4294967296 [[DOTPRIVATES_:%.*]], void (i8*, ...)* noalias nocapture nofree readnone [[DOTCOPY_FN_:%.*]], i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[DOTTASK_T_:%.*]], %struct.anon* noalias nocapture nofree readnone [[__CONTEXT:%.*]]) #[[ATTR2:[0-9]+]] { +; NVPTX-SAME: (i32 [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree nonnull readnone [[DOTPART_ID_:%.*]], i8* noalias nocapture nofree readnone align 4294967296 [[DOTPRIVATES_:%.*]], void (i8*, ...)* noalias nocapture nofree readnone [[DOTCOPY_FN_:%.*]], i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[DOTTASK_T_:%.*]], %struct.anon* noalias nocapture nofree readnone [[__CONTEXT:%.*]]) #[[ATTR0]] { ; NVPTX-NEXT: entry: -; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR6]] +; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR5]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@.omp_outlined. -; AMDGPU-DISABLED-SAME: (i32 [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree nonnull readnone [[DOTPART_ID_:%.*]], i8* noalias nocapture nofree readnone align 4294967296 [[DOTPRIVATES_:%.*]], void (i8*, ...)* noalias nocapture nofree readnone [[DOTCOPY_FN_:%.*]], i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[DOTTASK_T_:%.*]], %struct.anon* noalias nocapture nofree readnone [[__CONTEXT:%.*]]) #[[ATTR2:[0-9]+]] { +; AMDGPU-DISABLED-SAME: (i32 [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree nonnull readnone [[DOTPART_ID_:%.*]], i8* noalias nocapture nofree readnone align 4294967296 [[DOTPRIVATES_:%.*]], void (i8*, ...)* noalias nocapture nofree readnone [[DOTCOPY_FN_:%.*]], i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[DOTTASK_T_:%.*]], %struct.anon* noalias nocapture nofree readnone [[__CONTEXT:%.*]]) #[[ATTR0]] { ; AMDGPU-DISABLED-NEXT: entry: -; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR6]] +; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR5]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@.omp_outlined. -; NVPTX-DISABLED-SAME: (i32 [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree nonnull readnone [[DOTPART_ID_:%.*]], i8* noalias nocapture nofree readnone align 4294967296 [[DOTPRIVATES_:%.*]], void (i8*, ...)* noalias nocapture nofree readnone [[DOTCOPY_FN_:%.*]], i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[DOTTASK_T_:%.*]], %struct.anon* noalias nocapture nofree readnone [[__CONTEXT:%.*]]) #[[ATTR2:[0-9]+]] { +; NVPTX-DISABLED-SAME: (i32 [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree nonnull readnone [[DOTPART_ID_:%.*]], i8* noalias nocapture nofree readnone align 4294967296 [[DOTPRIVATES_:%.*]], void (i8*, ...)* noalias nocapture nofree readnone [[DOTCOPY_FN_:%.*]], i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[DOTTASK_T_:%.*]], %struct.anon* noalias nocapture nofree readnone [[__CONTEXT:%.*]]) #[[ATTR0]] { ; NVPTX-DISABLED-NEXT: entry: -; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR6]] +; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR5]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -2253,25 +2253,25 @@ ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__9 ; AMDGPU-SAME: (i32* noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { ; AMDGPU-NEXT: entry: -; AMDGPU-NEXT: call void @unknown() #[[ATTR7]] +; AMDGPU-NEXT: call void @unknown() #[[ATTR6]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__9 ; NVPTX-SAME: (i32* noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { ; NVPTX-NEXT: entry: -; NVPTX-NEXT: call void @unknown() #[[ATTR7]] +; NVPTX-NEXT: call void @unknown() #[[ATTR6]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__9 ; AMDGPU-DISABLED-SAME: (i32* noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { ; AMDGPU-DISABLED-NEXT: entry: -; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR7]] +; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR6]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__9 ; NVPTX-DISABLED-SAME: (i32* noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { ; NVPTX-DISABLED-NEXT: entry: -; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR7]] +; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR6]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -2288,7 +2288,7 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca i8**, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(i8*** [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__9(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__9(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__9_wrapper @@ -2298,7 +2298,7 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca i8**, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(i8*** [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__9(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__9(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__9_wrapper @@ -2308,7 +2308,7 @@ ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca i8**, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(i8*** [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__9(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__9(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__9_wrapper @@ -2318,7 +2318,7 @@ ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca i8**, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(i8*** [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__9(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__9(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -2388,51 +2388,47 @@ ;. ; AMDGPU: attributes #[[ATTR0]] = { alwaysinline convergent norecurse nounwind } ; AMDGPU: attributes #[[ATTR1]] = { convergent norecurse nounwind } -; AMDGPU: attributes #[[ATTR2]] = { alwaysinline convergent nounwind } -; AMDGPU: attributes #[[ATTR3]] = { nounwind } -; AMDGPU: attributes #[[ATTR4:[0-9]+]] = { nosync nounwind } -; AMDGPU: attributes #[[ATTR5:[0-9]+]] = { nofree nosync nounwind } -; AMDGPU: attributes #[[ATTR6]] = { convergent "llvm.assume"="ompx_spmd_amenable" } -; AMDGPU: attributes #[[ATTR7]] = { convergent } -; AMDGPU: attributes #[[ATTR8:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; AMDGPU: attributes #[[ATTR9:[0-9]+]] = { alwaysinline } -; AMDGPU: attributes #[[ATTR10:[0-9]+]] = { convergent nounwind } +; AMDGPU: attributes #[[ATTR2]] = { nounwind } +; AMDGPU: attributes #[[ATTR3:[0-9]+]] = { nosync nounwind } +; AMDGPU: attributes #[[ATTR4:[0-9]+]] = { nofree nosync nounwind } +; AMDGPU: attributes #[[ATTR5]] = { convergent "llvm.assume"="ompx_spmd_amenable" } +; AMDGPU: attributes #[[ATTR6]] = { convergent } +; AMDGPU: attributes #[[ATTR7:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; AMDGPU: attributes #[[ATTR8:[0-9]+]] = { alwaysinline } +; AMDGPU: attributes #[[ATTR9:[0-9]+]] = { convergent nounwind } ;. ; NVPTX: attributes #[[ATTR0]] = { alwaysinline convergent norecurse nounwind } ; NVPTX: attributes #[[ATTR1]] = { convergent norecurse nounwind } -; NVPTX: attributes #[[ATTR2]] = { alwaysinline convergent nounwind } -; NVPTX: attributes #[[ATTR3]] = { nounwind } -; NVPTX: attributes #[[ATTR4:[0-9]+]] = { nosync nounwind } -; NVPTX: attributes #[[ATTR5:[0-9]+]] = { nofree nosync nounwind } -; NVPTX: attributes #[[ATTR6]] = { convergent "llvm.assume"="ompx_spmd_amenable" } -; NVPTX: attributes #[[ATTR7]] = { convergent } -; NVPTX: attributes #[[ATTR8:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; NVPTX: attributes #[[ATTR9:[0-9]+]] = { alwaysinline } -; NVPTX: attributes #[[ATTR10:[0-9]+]] = { convergent nounwind } +; NVPTX: attributes #[[ATTR2]] = { nounwind } +; NVPTX: attributes #[[ATTR3:[0-9]+]] = { nosync nounwind } +; NVPTX: attributes #[[ATTR4:[0-9]+]] = { nofree nosync nounwind } +; NVPTX: attributes #[[ATTR5]] = { convergent "llvm.assume"="ompx_spmd_amenable" } +; NVPTX: attributes #[[ATTR6]] = { convergent } +; NVPTX: attributes #[[ATTR7:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; NVPTX: attributes #[[ATTR8:[0-9]+]] = { alwaysinline } +; NVPTX: attributes #[[ATTR9:[0-9]+]] = { convergent nounwind } ;. ; AMDGPU-DISABLED: attributes #[[ATTR0]] = { alwaysinline convergent norecurse nounwind } ; AMDGPU-DISABLED: attributes #[[ATTR1]] = { convergent norecurse nounwind } -; AMDGPU-DISABLED: attributes #[[ATTR2]] = { alwaysinline convergent nounwind } -; AMDGPU-DISABLED: attributes #[[ATTR3]] = { nounwind } -; AMDGPU-DISABLED: attributes #[[ATTR4:[0-9]+]] = { nosync nounwind } -; AMDGPU-DISABLED: attributes #[[ATTR5:[0-9]+]] = { nofree nosync nounwind } -; AMDGPU-DISABLED: attributes #[[ATTR6]] = { convergent "llvm.assume"="ompx_spmd_amenable" } -; AMDGPU-DISABLED: attributes #[[ATTR7]] = { convergent } -; AMDGPU-DISABLED: attributes #[[ATTR8:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; AMDGPU-DISABLED: attributes #[[ATTR9:[0-9]+]] = { alwaysinline } -; AMDGPU-DISABLED: attributes #[[ATTR10:[0-9]+]] = { convergent nounwind } +; AMDGPU-DISABLED: attributes #[[ATTR2]] = { nounwind } +; AMDGPU-DISABLED: attributes #[[ATTR3:[0-9]+]] = { nosync nounwind } +; AMDGPU-DISABLED: attributes #[[ATTR4:[0-9]+]] = { nofree nosync nounwind } +; AMDGPU-DISABLED: attributes #[[ATTR5]] = { convergent "llvm.assume"="ompx_spmd_amenable" } +; AMDGPU-DISABLED: attributes #[[ATTR6]] = { convergent } +; AMDGPU-DISABLED: attributes #[[ATTR7:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; AMDGPU-DISABLED: attributes #[[ATTR8:[0-9]+]] = { alwaysinline } +; AMDGPU-DISABLED: attributes #[[ATTR9:[0-9]+]] = { convergent nounwind } ;. ; NVPTX-DISABLED: attributes #[[ATTR0]] = { alwaysinline convergent norecurse nounwind } ; NVPTX-DISABLED: attributes #[[ATTR1]] = { convergent norecurse nounwind } -; NVPTX-DISABLED: attributes #[[ATTR2]] = { alwaysinline convergent nounwind } -; NVPTX-DISABLED: attributes #[[ATTR3]] = { nounwind } -; NVPTX-DISABLED: attributes #[[ATTR4:[0-9]+]] = { nosync nounwind } -; NVPTX-DISABLED: attributes #[[ATTR5:[0-9]+]] = { nofree nosync nounwind } -; NVPTX-DISABLED: attributes #[[ATTR6]] = { convergent "llvm.assume"="ompx_spmd_amenable" } -; NVPTX-DISABLED: attributes #[[ATTR7]] = { convergent } -; NVPTX-DISABLED: attributes #[[ATTR8:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; NVPTX-DISABLED: attributes #[[ATTR9:[0-9]+]] = { alwaysinline } -; NVPTX-DISABLED: attributes #[[ATTR10:[0-9]+]] = { convergent nounwind } +; NVPTX-DISABLED: attributes #[[ATTR2]] = { nounwind } +; NVPTX-DISABLED: attributes #[[ATTR3:[0-9]+]] = { nosync nounwind } +; NVPTX-DISABLED: attributes #[[ATTR4:[0-9]+]] = { nofree nosync nounwind } +; NVPTX-DISABLED: attributes #[[ATTR5]] = { convergent "llvm.assume"="ompx_spmd_amenable" } +; NVPTX-DISABLED: attributes #[[ATTR6]] = { convergent } +; NVPTX-DISABLED: attributes #[[ATTR7:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; NVPTX-DISABLED: attributes #[[ATTR8:[0-9]+]] = { alwaysinline } +; NVPTX-DISABLED: attributes #[[ATTR9:[0-9]+]] = { convergent nounwind } ;. ; AMDGPU: [[META0:![0-9]+]] = !{i32 0, i32 64770, i32 541341486, !"do_not_spmdize_task", i32 74, i32 5} ; AMDGPU: [[META1:![0-9]+]] = !{i32 0, i32 64770, i32 541341486, !"sequential_loop_to_stack_var", i32 20, i32 1} diff --git a/llvm/test/Transforms/OpenMP/spmdization_guarding_two_reaching_kernels.ll b/llvm/test/Transforms/OpenMP/spmdization_guarding_two_reaching_kernels.ll --- a/llvm/test/Transforms/OpenMP/spmdization_guarding_two_reaching_kernels.ll +++ b/llvm/test/Transforms/OpenMP/spmdization_guarding_two_reaching_kernels.ll @@ -91,7 +91,7 @@ ; CHECK-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; CHECK-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; CHECK: user_code.entry: -; CHECK-NEXT: call void @spmd_helper() #[[ATTR5:[0-9]+]] +; CHECK-NEXT: call void @spmd_helper() #[[ATTR4:[0-9]+]] ; CHECK-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) ; CHECK-NEXT: ret void ; CHECK: worker.exit: @@ -124,7 +124,7 @@ ; CHECK-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; CHECK-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; CHECK: user_code.entry: -; CHECK-NEXT: call void @generic_helper() #[[ATTR6:[0-9]+]] +; CHECK-NEXT: call void @generic_helper() #[[ATTR5:[0-9]+]] ; CHECK-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) ; CHECK-NEXT: ret void ; CHECK: worker.exit: @@ -147,11 +147,11 @@ ; Function Attrs: convergent noinline nounwind define internal void @spmd_helper() #1 { ; CHECK-LABEL: define {{[^@]+}}@spmd_helper -; CHECK-SAME: () #[[ATTR1:[0-9]+]] { +; CHECK-SAME: () #[[ATTR0]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8 -; CHECK-NEXT: call void @leaf() #[[ATTR7:[0-9]+]] -; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2]]) #[[ATTR2:[0-9]+]] +; CHECK-NEXT: call void @leaf() #[[ATTR6:[0-9]+]] +; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* noundef @[[GLOB2]]) #[[ATTR1:[0-9]+]] ; CHECK-NEXT: [[TMP1:%.*]] = bitcast [0 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8** ; CHECK-NEXT: call void @__kmpc_parallel_51(%struct.ident_t* noundef @[[GLOB2]], i32 [[TMP0]], i32 noundef 1, i32 noundef -1, i32 noundef -1, i8* noundef bitcast (void (i32*, i32*)* @__omp_outlined__ to i8*), i8* noundef @__omp_outlined___wrapper.ID, i8** noundef [[TMP1]], i64 noundef 0) ; CHECK-NEXT: ret void @@ -172,7 +172,7 @@ ; CHECK-NEXT: entry: ; CHECK-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8 ; CHECK-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8 -; CHECK-NEXT: call void @unknown() #[[ATTR8:[0-9]+]] +; CHECK-NEXT: call void @unknown() #[[ATTR7:[0-9]+]] ; CHECK-NEXT: ret void ; entry: @@ -194,7 +194,7 @@ ; CHECK-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; CHECK-NEXT: [[GLOBAL_ARGS:%.*]] = alloca i8**, align 8 ; CHECK-NEXT: call void @__kmpc_get_shared_variables(i8*** [[GLOBAL_ARGS]]) -; CHECK-NEXT: call void @__omp_outlined__(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR2]] +; CHECK-NEXT: call void @__omp_outlined__(i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTADDR1]], i32* noalias nocapture noundef nonnull readnone align 4 dereferenceable(4) [[DOTZERO_ADDR]]) #[[ATTR1]] ; CHECK-NEXT: ret void ; entry: @@ -221,7 +221,7 @@ ; Function Attrs: convergent noinline nounwind define internal void @leaf() #1 { ; CHECK-LABEL: define {{[^@]+}}@leaf -; CHECK-SAME: () #[[ATTR4:[0-9]+]] { +; CHECK-SAME: () #[[ATTR3:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: store i32 42, i32* @G, align 4 ; CHECK-NEXT: ret void @@ -234,9 +234,9 @@ ; Function Attrs: convergent noinline nounwind define internal void @generic_helper() #1 { ; CHECK-LABEL: define {{[^@]+}}@generic_helper -; CHECK-SAME: () #[[ATTR4]] { +; CHECK-SAME: () #[[ATTR3]] { ; CHECK-NEXT: entry: -; CHECK-NEXT: call void @leaf() #[[ATTR7]] +; CHECK-NEXT: call void @leaf() #[[ATTR6]] ; CHECK-NEXT: ret void ; entry: @@ -270,14 +270,13 @@ !9 = !{!"clang version 14.0.0"} ;. ; CHECK: attributes #[[ATTR0]] = { convergent noinline norecurse nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } -; CHECK: attributes #[[ATTR1]] = { convergent noinline nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } -; CHECK: attributes #[[ATTR2]] = { nounwind } -; CHECK: attributes #[[ATTR3:[0-9]+]] = { alwaysinline } -; CHECK: attributes #[[ATTR4]] = { convergent nofree noinline nosync nounwind willreturn writeonly "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } -; CHECK: attributes #[[ATTR5]] = { convergent nounwind } -; CHECK: attributes #[[ATTR6]] = { convergent nounwind writeonly } -; CHECK: attributes #[[ATTR7]] = { convergent nofree nosync nounwind willreturn writeonly } -; CHECK: attributes #[[ATTR8]] = { convergent } +; CHECK: attributes #[[ATTR1]] = { nounwind } +; CHECK: attributes #[[ATTR2:[0-9]+]] = { alwaysinline } +; CHECK: attributes #[[ATTR3]] = { convergent nofree noinline norecurse nosync nounwind willreturn writeonly "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } +; CHECK: attributes #[[ATTR4]] = { convergent nounwind } +; CHECK: attributes #[[ATTR5]] = { convergent nounwind writeonly } +; CHECK: attributes #[[ATTR6]] = { convergent nofree nosync nounwind willreturn writeonly } +; CHECK: attributes #[[ATTR7]] = { convergent } ;. ; CHECK: [[META0:![0-9]+]] = !{i32 0, i32 43, i32 17011637, !"spmd", i32 12, i32 0} ; CHECK: [[META1:![0-9]+]] = !{i32 0, i32 43, i32 17011637, !"generic", i32 20, i32 1}