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 @@ -2884,6 +2884,13 @@ return false; const IRPosition &CallIRP = IRPosition::callsite_function(*CB); + const auto &MustProgressAA = A.getAndUpdateAAFor( + *this, CallIRP, /* TrackDependence */ false); + if (!MustProgressAA.isAssumedMustProgress()) + return false; + if (!MustProgressAA.isKnownMustProgress()) + A.recordDependence(MustProgressAA, *this, DepClassTy::OPTIONAL); + const auto &NoUnwindAA = A.getAndUpdateAAFor( *this, CallIRP, /* TrackDependence */ false); if (!NoUnwindAA.isAssumedNoUnwind()) 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 @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes -; 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 ; PR2498 @@ -50,10 +50,10 @@ } define i32 @foo(i32* %A) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn mustprogress +; IS__TUNIT____: Function Attrs: argmemonly nofree 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:#.*]] +; IS__TUNIT____-SAME: (i32* nocapture nofree readonly [[A:%.*]]) [[ATTR1:#.*]] { +; IS__TUNIT____-NEXT: [[X:%.*]] = call i32 @callee(i32* nocapture nofree readonly align 4 [[A]]) [[ATTR2:#.*]] ; IS__TUNIT____-NEXT: ret i32 [[X]] ; ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn mustprogress 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,7 +16,7 @@ } define void @encode(i32* %m, i32* %ts, i32* %new) nounwind { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn mustprogress +; 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:#.*]] { ; IS__TUNIT____-NEXT: entry: 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 @@ -32,28 +32,28 @@ } define void @no_promote(<4 x i64>* %arg) #1 { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind uwtable willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@no_promote ; IS__TUNIT_OPM-SAME: (<4 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR1:#.*]] { ; IS__TUNIT_OPM-NEXT: bb: ; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR3:#.*]] -; IS__TUNIT_OPM-NEXT: call fastcc void @no_promote_avx2(<4 x i64>* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64>* nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) [[ATTR4:#.*]] +; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR4:#.*]] +; IS__TUNIT_OPM-NEXT: call fastcc void @no_promote_avx2(<4 x i64>* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64>* nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) [[ATTR5:#.*]] ; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 ; IS__TUNIT_OPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind uwtable willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@no_promote ; IS__TUNIT_NPM-SAME: (<4 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR1:#.*]] { ; IS__TUNIT_NPM-NEXT: bb: ; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR3:#.*]] -; IS__TUNIT_NPM-NEXT: call fastcc void @no_promote_avx2(<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64>* noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) [[ATTR4:#.*]] +; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR4:#.*]] +; IS__TUNIT_NPM-NEXT: call fastcc void @no_promote_avx2(<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64>* noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) [[ATTR5:#.*]] ; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 ; IS__TUNIT_NPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 ; IS__TUNIT_NPM-NEXT: ret void @@ -121,29 +121,29 @@ } define void @promote(<4 x i64>* %arg) #0 { -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@promote -; IS__TUNIT_OPM-SAME: (<4 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR0:#.*]] { +; IS__TUNIT_OPM-SAME: (<4 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR2:#.*]] { ; IS__TUNIT_OPM-NEXT: bb: ; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR3]] -; IS__TUNIT_OPM-NEXT: call fastcc void @promote_avx2(<4 x i64>* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64>* nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) [[ATTR4]] +; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR4]] +; IS__TUNIT_OPM-NEXT: call fastcc void @promote_avx2(<4 x i64>* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64>* nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) [[ATTR5]] ; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 ; IS__TUNIT_OPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@promote -; IS__TUNIT_NPM-SAME: (<4 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR0:#.*]] { +; IS__TUNIT_NPM-SAME: (<4 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR2:#.*]] { ; IS__TUNIT_NPM-NEXT: bb: ; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR3]] +; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR4]] ; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <4 x i64>, <4 x i64>* [[TMP]], align 32 -; IS__TUNIT_NPM-NEXT: call fastcc void @promote_avx2(<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64> [[TMP0]]) [[ATTR4]] +; IS__TUNIT_NPM-NEXT: call fastcc void @promote_avx2(<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64> [[TMP0]]) [[ATTR5]] ; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 ; IS__TUNIT_NPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 ; IS__TUNIT_NPM-NEXT: ret void diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll @@ -13,7 +13,7 @@ ; ; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS________OPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512 -; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) [[ATTR0:#.*]] { +; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR0:[0-9]+]] { ; IS________OPM-NEXT: bb: ; IS________OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 ; IS________OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 @@ -21,7 +21,7 @@ ; ; IS________NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS________NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512 -; IS________NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) [[ATTR0:#.*]] { +; IS________NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { ; IS________NPM-NEXT: bb: ; IS________NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 ; IS________NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 @@ -37,56 +37,56 @@ define void @avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* %arg) #0 { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer512 -; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR0:#.*]] { +; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: bb: ; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6:#.*]] -; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7:#.*]] +; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR11:[0-9]+]] +; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR12:[0-9]+]] ; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer512 -; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR0:#.*]] { +; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: bb: ; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6:#.*]] +; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR11:[0-9]+]] ; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) [[ATTR7:#.*]] +; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR12:[0-9]+]] ; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__TUNIT_NPM-NEXT: ret void ; ; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer512 -; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) [[ATTR0:#.*]] { +; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] { ; IS__CGSCC_OPM-NEXT: bb: ; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6:#.*]] -; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7:#.*]] +; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6:[0-9]+]] +; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7:[0-9]+]] ; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__CGSCC_OPM-NEXT: ret void ; ; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer512 -; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) [[ATTR0:#.*]] { +; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] { ; IS__CGSCC_NPM-NEXT: bb: ; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6:#.*]] +; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6:[0-9]+]] ; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) [[ATTR7:#.*]] +; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7:[0-9]+]] ; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__CGSCC_NPM-NEXT: ret void @@ -105,23 +105,41 @@ ; This should promote define internal fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #1 { ; -; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress -; IS________OPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256 -; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) [[ATTR1:#.*]] { -; IS________OPM-NEXT: bb: -; IS________OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________OPM-NEXT: ret void +; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256 +; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR2:[0-9]+]] { +; IS__TUNIT_OPM-NEXT: bb: +; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__TUNIT_OPM-NEXT: ret void ; -; IS________NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress -; IS________NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256 -; IS________NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) [[ATTR1:#.*]] { -; IS________NPM-NEXT: bb: -; IS________NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 -; IS________NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 -; IS________NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 -; IS________NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________NPM-NEXT: ret void +; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256 +; IS__TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR2:[0-9]+]] { +; IS__TUNIT_NPM-NEXT: bb: +; IS__TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__TUNIT_NPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256 +; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR1:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: bb: +; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256 +; IS__CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: bb: +; IS__CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__CGSCC_NPM-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -131,56 +149,56 @@ define void @avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* %arg) #1 { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer256 -; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR1:#.*]] { +; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: bb: ; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR11]] +; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR12]] ; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer256 -; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR1:#.*]] { +; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: bb: ; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] +; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR11]] ; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) [[ATTR7]] +; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR12]] ; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__TUNIT_NPM-NEXT: ret void ; ; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer256 -; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) [[ATTR1:#.*]] { +; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { ; IS__CGSCC_OPM-NEXT: bb: ; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] ; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__CGSCC_OPM-NEXT: ret void ; ; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer256 -; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) [[ATTR1:#.*]] { +; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { ; IS__CGSCC_NPM-NEXT: bb: ; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] +; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] ; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] ; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__CGSCC_NPM-NEXT: ret void @@ -199,23 +217,41 @@ ; This should promote define internal fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #1 { ; -; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress -; IS________OPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256 -; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) [[ATTR1]] { -; IS________OPM-NEXT: bb: -; IS________OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________OPM-NEXT: ret void +; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256 +; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR2]] { +; IS__TUNIT_OPM-NEXT: bb: +; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__TUNIT_OPM-NEXT: ret void ; -; IS________NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress -; IS________NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256 -; IS________NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) [[ATTR1]] { -; IS________NPM-NEXT: bb: -; IS________NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 -; IS________NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 -; IS________NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 -; IS________NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________NPM-NEXT: ret void +; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256 +; IS__TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR2]] { +; IS__TUNIT_NPM-NEXT: bb: +; IS__TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__TUNIT_NPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256 +; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR1]] { +; IS__CGSCC_OPM-NEXT: bb: +; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256 +; IS__CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1]] { +; IS__CGSCC_NPM-NEXT: bb: +; IS__CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__CGSCC_NPM-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -225,56 +261,56 @@ define void @avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* %arg) #0 { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer256 -; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR0]] { +; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { ; IS__TUNIT_OPM-NEXT: bb: ; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR11]] +; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR12]] ; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer256 -; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR0]] { +; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { ; IS__TUNIT_NPM-NEXT: bb: ; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] +; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR11]] ; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) [[ATTR7]] +; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR12]] ; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__TUNIT_NPM-NEXT: ret void ; ; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer256 -; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) [[ATTR0]] { +; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] { ; IS__CGSCC_OPM-NEXT: bb: ; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] ; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__CGSCC_OPM-NEXT: ret void ; ; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer256 -; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) [[ATTR0]] { +; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] { ; IS__CGSCC_NPM-NEXT: bb: ; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] +; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] ; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] ; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__CGSCC_NPM-NEXT: ret void @@ -295,7 +331,7 @@ ; ; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS________OPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512 -; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) [[ATTR0]] { +; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR0]] { ; IS________OPM-NEXT: bb: ; IS________OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 ; IS________OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 @@ -303,7 +339,7 @@ ; ; IS________NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS________NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512 -; IS________NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) [[ATTR0]] { +; IS________NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0]] { ; IS________NPM-NEXT: bb: ; IS________NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 ; IS________NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 @@ -319,56 +355,56 @@ define void @avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* %arg) #1 { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer512 -; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR1]] { +; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3]] { ; IS__TUNIT_OPM-NEXT: bb: ; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR11]] +; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR12]] ; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer512 -; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR1]] { +; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3]] { ; IS__TUNIT_NPM-NEXT: bb: ; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] +; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR11]] ; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) [[ATTR7]] +; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR12]] ; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__TUNIT_NPM-NEXT: ret void ; ; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer512 -; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) [[ATTR1]] { +; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { ; IS__CGSCC_OPM-NEXT: bb: ; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] ; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__CGSCC_OPM-NEXT: ret void ; ; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer512 -; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) [[ATTR1]] { +; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { ; IS__CGSCC_NPM-NEXT: bb: ; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] +; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] ; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] ; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__CGSCC_NPM-NEXT: ret void @@ -387,21 +423,37 @@ ; This should not promote define internal fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #1 { ; -; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress -; IS________OPM-LABEL: define {{[^@]+}}@callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256 -; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) [[ATTR1]] { -; IS________OPM-NEXT: bb: -; IS________OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________OPM-NEXT: ret void +; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256 +; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR2]] { +; IS__TUNIT_OPM-NEXT: bb: +; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__TUNIT_OPM-NEXT: ret void ; -; IS________NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress -; IS________NPM-LABEL: define {{[^@]+}}@callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256 -; IS________NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) [[ATTR1]] { -; IS________NPM-NEXT: bb: -; IS________NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________NPM-NEXT: ret void +; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256 +; IS__TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR2]] { +; IS__TUNIT_NPM-NEXT: bb: +; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__TUNIT_NPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256 +; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR1]] { +; IS__CGSCC_OPM-NEXT: bb: +; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256 +; IS__CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR1]] { +; IS__CGSCC_NPM-NEXT: bb: +; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__CGSCC_NPM-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -411,54 +463,54 @@ define void @avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* %arg) #2 { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@avx512_legal256_prefer256_call_avx512_legal512_prefer256 -; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR2:#.*]] { +; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: bb: ; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR11]] +; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR12]] ; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal256_prefer256_call_avx512_legal512_prefer256 -; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR2:#.*]] { +; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: bb: ; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR11]] +; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR12]] ; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__TUNIT_NPM-NEXT: ret void ; ; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@avx512_legal256_prefer256_call_avx512_legal512_prefer256 -; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) [[ATTR2:#.*]] { +; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR2:[0-9]+]] { ; IS__CGSCC_OPM-NEXT: bb: ; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] ; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__CGSCC_OPM-NEXT: ret void ; ; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal256_prefer256_call_avx512_legal512_prefer256 -; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) [[ATTR2:#.*]] { +; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR2:[0-9]+]] { ; IS__CGSCC_NPM-NEXT: bb: ; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] ; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__CGSCC_NPM-NEXT: ret void @@ -477,21 +529,37 @@ ; This should not promote define internal fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #2 { ; -; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress -; IS________OPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256 -; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) [[ATTR2:#.*]] { -; IS________OPM-NEXT: bb: -; IS________OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________OPM-NEXT: ret void +; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256 +; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR5:[0-9]+]] { +; IS__TUNIT_OPM-NEXT: bb: +; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__TUNIT_OPM-NEXT: ret void ; -; IS________NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress -; IS________NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256 -; IS________NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) [[ATTR2:#.*]] { -; IS________NPM-NEXT: bb: -; IS________NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________NPM-NEXT: ret void +; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256 +; IS__TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR5:[0-9]+]] { +; IS__TUNIT_NPM-NEXT: bb: +; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__TUNIT_NPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256 +; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR2]] { +; IS__CGSCC_OPM-NEXT: bb: +; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256 +; IS__CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR2]] { +; IS__CGSCC_NPM-NEXT: bb: +; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__CGSCC_NPM-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -501,54 +569,54 @@ define void @avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* %arg) #1 { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal256_prefer256 -; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR1]] { +; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3]] { ; IS__TUNIT_OPM-NEXT: bb: ; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR11]] +; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR12]] ; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal256_prefer256 -; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR1]] { +; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3]] { ; IS__TUNIT_NPM-NEXT: bb: ; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR11]] +; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR12]] ; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__TUNIT_NPM-NEXT: ret void ; ; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal256_prefer256 -; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) [[ATTR1]] { +; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { ; IS__CGSCC_OPM-NEXT: bb: ; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] ; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__CGSCC_OPM-NEXT: ret void ; ; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal256_prefer256 -; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) [[ATTR1]] { +; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { ; IS__CGSCC_NPM-NEXT: bb: ; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] ; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__CGSCC_NPM-NEXT: ret void @@ -567,23 +635,41 @@ ; This should promote define internal fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #3 { ; -; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress -; IS________OPM-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256 -; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) [[ATTR3:#.*]] { -; IS________OPM-NEXT: bb: -; IS________OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________OPM-NEXT: ret void +; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256 +; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR6:[0-9]+]] { +; IS__TUNIT_OPM-NEXT: bb: +; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__TUNIT_OPM-NEXT: ret void ; -; IS________NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress -; IS________NPM-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256 -; IS________NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) [[ATTR3:#.*]] { -; IS________NPM-NEXT: bb: -; IS________NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 -; IS________NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 -; IS________NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 -; IS________NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________NPM-NEXT: ret void +; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256 +; IS__TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR6:[0-9]+]] { +; IS__TUNIT_NPM-NEXT: bb: +; IS__TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__TUNIT_NPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256 +; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR3:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: bb: +; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256 +; IS__CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR3:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: bb: +; IS__CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__CGSCC_NPM-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -593,56 +679,56 @@ define void @avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* %arg) #4 { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@avx2_legal256_prefer256_call_avx2_legal512_prefer256 -; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR4:#.*]] { +; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR7:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: bb: ; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR11]] +; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR12]] ; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@avx2_legal256_prefer256_call_avx2_legal512_prefer256 -; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR4:#.*]] { +; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR7:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: bb: ; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] +; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR11]] ; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) [[ATTR7]] +; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR12]] ; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__TUNIT_NPM-NEXT: ret void ; ; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@avx2_legal256_prefer256_call_avx2_legal512_prefer256 -; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) [[ATTR4:#.*]] { +; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { ; IS__CGSCC_OPM-NEXT: bb: ; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] ; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__CGSCC_OPM-NEXT: ret void ; ; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@avx2_legal256_prefer256_call_avx2_legal512_prefer256 -; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) [[ATTR4:#.*]] { +; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { ; IS__CGSCC_NPM-NEXT: bb: ; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] +; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] ; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] ; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__CGSCC_NPM-NEXT: ret void @@ -661,23 +747,41 @@ ; This should promote define internal fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #4 { ; -; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress -; IS________OPM-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256 -; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) [[ATTR4:#.*]] { -; IS________OPM-NEXT: bb: -; IS________OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________OPM-NEXT: ret void +; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256 +; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR8:[0-9]+]] { +; IS__TUNIT_OPM-NEXT: bb: +; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__TUNIT_OPM-NEXT: ret void ; -; IS________NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress -; IS________NPM-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256 -; IS________NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) [[ATTR4:#.*]] { -; IS________NPM-NEXT: bb: -; IS________NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 -; IS________NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 -; IS________NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 -; IS________NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________NPM-NEXT: ret void +; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256 +; IS__TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR8:[0-9]+]] { +; IS__TUNIT_NPM-NEXT: bb: +; IS__TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__TUNIT_NPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256 +; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR4]] { +; IS__CGSCC_OPM-NEXT: bb: +; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256 +; IS__CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR4]] { +; IS__CGSCC_NPM-NEXT: bb: +; IS__CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; IS__CGSCC_NPM-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -687,56 +791,56 @@ define void @avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* %arg) #3 { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@avx2_legal512_prefer256_call_avx2_legal256_prefer256 -; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR3:#.*]] { +; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR9:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: bb: ; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR11]] +; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR12]] ; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@avx2_legal512_prefer256_call_avx2_legal256_prefer256 -; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) [[ATTR3:#.*]] { +; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR9:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: bb: ; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] +; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR11]] ; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) [[ATTR7]] +; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR12]] ; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__TUNIT_NPM-NEXT: ret void ; ; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@avx2_legal512_prefer256_call_avx2_legal256_prefer256 -; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) [[ATTR3:#.*]] { +; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR3]] { ; IS__CGSCC_OPM-NEXT: bb: ; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] -; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] ; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__CGSCC_OPM-NEXT: ret void ; ; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@avx2_legal512_prefer256_call_avx2_legal256_prefer256 -; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) [[ATTR3:#.*]] { +; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR3]] { ; IS__CGSCC_NPM-NEXT: bb: ; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 ; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) [[ATTR6]] +; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] ; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] ; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 ; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 ; IS__CGSCC_NPM-NEXT: ret void @@ -761,3 +865,25 @@ attributes #3 = { inlinehint norecurse nounwind uwtable "target-features"="+avx2" "min-legal-vector-width"="512" "prefer-vector-width"="256" } attributes #4 = { inlinehint norecurse nounwind uwtable "target-features"="+avx2" "min-legal-vector-width"="256" "prefer-vector-width"="256" } attributes #5 = { argmemonly nounwind } +; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress "min-legal-vector-width"="512" "prefer-vector-width"="512" "target-features"="+avx512vl" } +; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="512" "target-features"="+avx512vl" } +; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; IS__TUNIT____: attributes #[[ATTR3:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; IS__TUNIT____: attributes #[[ATTR5:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; IS__TUNIT____: attributes #[[ATTR6:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } +; IS__TUNIT____: attributes #[[ATTR7:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx2" } +; IS__TUNIT____: attributes #[[ATTR8:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx2" } +; IS__TUNIT____: attributes #[[ATTR9:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } +; IS__TUNIT____: attributes #[[ATTR10:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR11:[0-9]+]] = { willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR12:[0-9]+]] = { nofree nosync willreturn } +;. +; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress "min-legal-vector-width"="512" "prefer-vector-width"="512" "target-features"="+avx512vl" } +; IS__CGSCC____: attributes #[[ATTR1:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; IS__CGSCC____: attributes #[[ATTR2:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; IS__CGSCC____: attributes #[[ATTR3:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } +; IS__CGSCC____: attributes #[[ATTR4:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn mustprogress "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx2" } +; IS__CGSCC____: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR6:[0-9]+]] = { willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR7:[0-9]+]] = { nounwind willreturn mustprogress } 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 @@ -40,11 +40,11 @@ } define i32 @caller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@caller -; IS__TUNIT____-SAME: () [[ATTR0]] { +; IS__TUNIT____-SAME: () [[ATTR1:#.*]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[V:%.*]] = call i32 @test() [[ATTR1:#.*]] +; IS__TUNIT____-NEXT: [[V:%.*]] = call i32 @test() [[ATTR1]] ; IS__TUNIT____-NEXT: ret i32 [[V]] ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress 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 @@ -91,21 +91,21 @@ ; Also make sure we don't drop the call zeroext attribute. define i32 @test(i32* %X) { ; -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly align 4 [[X:%.*]]) [[ATTR0]] { +; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly align 4 [[X:%.*]]) [[ATTR1:#.*]] { ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 ; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 ; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[TMP1]], align 8 ; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 ; IS__TUNIT_OPM-NEXT: store i64 2, i64* [[TMP4]], align 4 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull readonly byval(%struct.ss) align 8 dereferenceable(12) [[S]], i32* nocapture nofree readonly byval(i32) align 4 [[X]], i32 noundef zeroext 0) [[ATTR1:#.*]] +; IS__TUNIT_OPM-NEXT: [[C:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull readonly byval(%struct.ss) align 8 dereferenceable(12) [[S]], i32* nocapture nofree readonly byval(i32) align 4 [[X]], i32 noundef zeroext 0) [[ATTR2:#.*]] ; IS__TUNIT_OPM-NEXT: ret i32 [[C]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readonly align 4 [[X:%.*]]) [[ATTR0]] { +; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readonly align 4 [[X:%.*]]) [[ATTR1:#.*]] { ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 ; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 @@ -117,7 +117,7 @@ ; IS__TUNIT_NPM-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 ; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_1]], align 8 ; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[X]], align 4 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]], i32 [[TMP2]], i32 noundef zeroext 0) [[ATTR1:#.*]] +; IS__TUNIT_NPM-NEXT: [[C:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]], i32 [[TMP2]], i32 noundef zeroext 0) [[ATTR2:#.*]] ; IS__TUNIT_NPM-NEXT: ret i32 [[C]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress 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 @@ -48,7 +48,7 @@ define i32 @test(i32* %X) { ; -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test ; IS__TUNIT____-SAME: (i32* nocapture nofree readonly align 4 [[X:%.*]]) [[ATTR0:#.*]] { ; IS__TUNIT____-NEXT: entry: 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 @@ -129,23 +129,23 @@ define i32 @main() nounwind { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@main -; IS__TUNIT_OPM-SAME: () [[ATTR0]] { +; IS__TUNIT_OPM-SAME: () [[ATTR1:#.*]] { ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 ; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 ; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[TMP1]], align 8 ; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 ; IS__TUNIT_OPM-NEXT: store i64 2, i64* [[TMP4]], align 4 -; IS__TUNIT_OPM-NEXT: [[C0:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull readonly byval(%struct.ss) align 8 dereferenceable(12) [[S]]) [[ATTR1:#.*]] +; IS__TUNIT_OPM-NEXT: [[C0:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull readonly byval(%struct.ss) align 8 dereferenceable(12) [[S]]) [[ATTR1]] ; IS__TUNIT_OPM-NEXT: [[C1:%.*]] = call i32 @g(%struct.ss* noalias nocapture nofree noundef nonnull readonly byval(%struct.ss) align 32 dereferenceable(12) [[S]]) [[ATTR1]] ; 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 mustprogress +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@main -; IS__TUNIT_NPM-SAME: () [[ATTR0]] { +; IS__TUNIT_NPM-SAME: () [[ATTR1:#.*]] { ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 ; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 @@ -156,7 +156,7 @@ ; 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]], i32 0, i32 1 ; 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]]) [[ATTR1:#.*]] +; IS__TUNIT_NPM-NEXT: [[C0:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]]) [[ATTR1]] ; 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]], i32 0, i32 1 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 @@ -32,11 +32,11 @@ } define i32 @caller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@caller -; IS__TUNIT____-SAME: () [[ATTR0]] { +; IS__TUNIT____-SAME: () [[ATTR1:#.*]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[X:%.*]] = call i32 @test() [[ATTR1:#.*]] +; IS__TUNIT____-NEXT: [[X:%.*]] = call i32 @test() [[ATTR1]] ; IS__TUNIT____-NEXT: ret i32 [[X]] ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn mustprogress 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 @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes -; 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,11 +40,11 @@ } define i32 @foo(i1 %C, i32* %P) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn mustprogress +; 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____-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) [[ATTR1:#.*]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[X:%.*]] = call i32 @callee(i1 [[C]], i32* nocapture nofree readonly [[P]]) [[ATTR1:#.*]] +; IS__TUNIT____-NEXT: [[X:%.*]] = call i32 @callee(i1 [[C]], i32* nocapture nofree readonly [[P]]) [[ATTR2:#.*]] ; IS__TUNIT____-NEXT: ret i32 [[X]] ; ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn mustprogress 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 @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes -; 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 @@ -9,11 +9,11 @@ ; 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 mustprogress +; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@zot ; IS__TUNIT____-SAME: () [[ATTR0:#.*]] personality i32 (...)* @wibble { ; IS__TUNIT____-NEXT: bb: -; IS__TUNIT____-NEXT: call void @hoge() [[ATTR2:#.*]] +; IS__TUNIT____-NEXT: call void @hoge() [[ATTR0]] ; IS__TUNIT____-NEXT: unreachable ; IS__TUNIT____: bb1: ; IS__TUNIT____-NEXT: unreachable @@ -24,7 +24,7 @@ ; IS__CGSCC____-LABEL: define {{[^@]+}}@zot ; IS__CGSCC____-SAME: () [[ATTR0:#.*]] personality i32 (...)* @wibble { ; IS__CGSCC____-NEXT: bb: -; IS__CGSCC____-NEXT: call void @hoge() [[ATTR2:#.*]] +; IS__CGSCC____-NEXT: call void @hoge() [[ATTR3:#.*]] ; IS__CGSCC____-NEXT: unreachable ; IS__CGSCC____: bb1: ; IS__CGSCC____-NEXT: unreachable @@ -45,7 +45,7 @@ } define internal void @hoge() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@hoge ; IS__TUNIT____-SAME: () [[ATTR0]] { ; IS__TUNIT____-NEXT: bb: @@ -92,17 +92,19 @@ } define i32 @test_inf_promote_caller(i32 %arg) { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_inf_promote_caller ; IS__TUNIT____-SAME: (i32 [[ARG:%.*]]) [[ATTR1:#.*]] { ; IS__TUNIT____-NEXT: bb: ; IS__TUNIT____-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress +; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@test_inf_promote_caller -; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) [[ATTR1]] { +; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) [[ATTR0]] { ; IS__CGSCC____-NEXT: bb: -; IS__CGSCC____-NEXT: ret i32 0 +; IS__CGSCC____-NEXT: [[TMP:%.*]] = alloca [[S:%.*]], align 8 +; IS__CGSCC____-NEXT: [[TMP1:%.*]] = alloca [[S]], align 8 +; IS__CGSCC____-NEXT: unreachable ; bb: %tmp = alloca %S @@ -113,6 +115,12 @@ } define internal i32 @test_inf_promote_callee(%S* %arg, %S* %arg1) { +; IS__CGSCC____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn mustprogress +; IS__CGSCC____-LABEL: define {{[^@]+}}@test_inf_promote_callee +; IS__CGSCC____-SAME: () [[ATTR2:#.*]] { +; IS__CGSCC____-NEXT: bb: +; IS__CGSCC____-NEXT: unreachable +; bb: %tmp = getelementptr %S, %S* %arg1, i32 0, i32 0 %tmp2 = load %S*, %S** %tmp 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 @@ -51,7 +51,7 @@ ; 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* inalloca noalias nocapture nofree noundef nonnull align 4 dereferenceable(8) [[S]]) [[ATTR3:#.*]] +; IS__TUNIT____-NEXT: [[R:%.*]] = call i32 @f(%struct.ss* inalloca noalias nocapture nofree noundef nonnull align 4 dereferenceable(8) [[S]]) [[ATTR2:#.*]] ; IS__TUNIT____-NEXT: ret i32 [[R]] ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -90,9 +90,9 @@ } define i32 @test() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test -; IS__TUNIT____-SAME: () [[ATTR2:#.*]] { +; IS__TUNIT____-SAME: () [[ATTR1]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: ret i32 0 ; 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 @@ -25,11 +25,11 @@ } define i32 @b() { -; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn ; CHECK-LABEL: define {{[^@]+}}@b -; CHECK-SAME: () [[ATTR0]] { +; CHECK-SAME: () [[ATTR1:#.*]] { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[V:%.*]] = call i32 @a() [[ATTR1:#.*]] +; CHECK-NEXT: [[V:%.*]] = call i32 @a() [[ATTR1]] ; CHECK-NEXT: ret i32 [[V]] ; entry: 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 @@ -65,7 +65,7 @@ } define i32 @callercaller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@callercaller ; IS__TUNIT____-SAME: () [[ATTR0:#.*]] { ; IS__TUNIT____-NEXT: [[B:%.*]] = alloca i32, align 4 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 @@ -65,15 +65,15 @@ } define i32 @callercaller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@callercaller ; IS__TUNIT____-SAME: () [[ATTR1:#.*]] { ; IS__TUNIT____-NEXT: [[B:%.*]] = alloca i32, align 4 ; IS__TUNIT____-NEXT: store i32 2, i32* [[B]], 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: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) [[ATTR3:#.*]] ; IS__TUNIT____-NEXT: ret i32 0 ; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callercaller ; IS__CGSCC_OPM-SAME: () [[ATTR1:#.*]] { ; IS__CGSCC_OPM-NEXT: [[B:%.*]] = alloca i32, align 4 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 @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes -; 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=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-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 ; PR36543 @@ -39,10 +39,10 @@ } define i32 @caller(%T* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn mustprogress +; 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:#.*]] +; IS__TUNIT____-SAME: (%T* nocapture nofree readonly [[P:%.*]]) [[ATTR1:#.*]] { +; IS__TUNIT____-NEXT: [[V:%.*]] = musttail call i32 @test(%T* nocapture nofree readonly [[P]]) [[ATTR6:#.*]] ; IS__TUNIT____-NEXT: ret i32 [[V]] ; ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn mustprogress @@ -60,7 +60,7 @@ define i32 @foo(%T* %p, i32 %v) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (%T* nocapture nofree readnone [[P:%.*]], i32 [[V:%.*]]) [[ATTR1:#.*]] { +; IS__TUNIT____-SAME: (%T* nocapture nofree readnone [[P:%.*]], i32 [[V:%.*]]) [[ATTR2:#.*]] { ; IS__TUNIT____-NEXT: ret i32 0 ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -87,9 +87,9 @@ } define i32 @caller2(%T* %g) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; 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____-SAME: (%T* nocapture nofree readnone [[G:%.*]]) [[ATTR3:#.*]] { ; IS__TUNIT____-NEXT: ret i32 0 ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -108,7 +108,7 @@ define i32 @bar(%T* %p, i32 %v) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: (%T* nocapture nofree nonnull writeonly dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) [[ATTR2:#.*]] { +; IS__TUNIT____-SAME: (%T* nocapture nofree nonnull writeonly dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) [[ATTR4:#.*]] { ; 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 @@ -126,15 +126,15 @@ } define internal i32 @test2b(%T* %p, i32 %p2) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn mustprogress +; 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:#.*]] { +; IS__TUNIT____-SAME: (%T* nocapture nofree readonly [[P:%.*]], i32 [[P2:%.*]]) [[ATTR5:#.*]] { ; 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:#.*]] +; IS__TUNIT____-NEXT: [[CA:%.*]] = musttail call i32 @bar(%T* undef, i32 [[V]]) [[ATTR7:#.*]] ; IS__TUNIT____-NEXT: ret i32 [[CA]] ; ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn mustprogress @@ -158,10 +158,10 @@ } define i32 @caller2b(%T* %g) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn mustprogress +; 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:#.*]] +; IS__TUNIT____-SAME: (%T* nocapture nofree readonly [[G:%.*]]) [[ATTR5]] { +; IS__TUNIT____-NEXT: [[V:%.*]] = call i32 @test2b(%T* nocapture nofree readonly [[G]], i32 undef) [[ATTR8:#.*]] ; IS__TUNIT____-NEXT: ret i32 0 ; ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn mustprogress diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/nonzero-address-spaces.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/nonzero-address-spaces.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/nonzero-address-spaces.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/nonzero-address-spaces.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes -; 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=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/ArgumentPromotion/pr27568.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr27568.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr27568.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr27568.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes -; 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 target triple = "x86_64-pc-windows-msvc" 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 @@ -9,13 +9,13 @@ @a = common local_unnamed_addr global i32 0, align 4 define i32 @fn2() local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@fn2 ; IS__TUNIT____-SAME: () local_unnamed_addr [[ATTR0:#.*]] { ; 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]]) [[ATTR1:#.*]] +; IS__TUNIT____-NEXT: call fastcc void @fn1(i32* nocapture nofree readonly align 4 [[TMP3]]) [[ATTR0]] ; IS__TUNIT____-NEXT: ret i32 undef ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn mustprogress @@ -37,7 +37,7 @@ define internal fastcc void @fn1(i32* nocapture readonly) unnamed_addr { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@fn1 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly align 4 [[TMP0:%.*]]) unnamed_addr [[ATTR0]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly align 4 [[TMP0:%.*]]) unnamed_addr [[ATTR1:#.*]] { ; 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 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 @@ -45,15 +45,15 @@ } define i32 @main() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@main -; IS__TUNIT____-SAME: () [[ATTR0]] { +; IS__TUNIT____-SAME: () [[ATTR1:#.*]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32**, i32*** @e, align 8, [[TBAA5:!tbaa !.*]] ; IS__TUNIT____-NEXT: store i32* @g, i32** [[TMP0]], align 8, [[TBAA5]] ; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32*, i32** @a, align 8, [[TBAA5]] ; IS__TUNIT____-NEXT: store i32 1, i32* [[TMP1]], align 4, [[TBAA0]] -; IS__TUNIT____-NEXT: call fastcc void @fn(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) @g) [[ATTR1:#.*]] +; IS__TUNIT____-NEXT: call fastcc void @fn(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) @g) [[ATTR1]] ; IS__TUNIT____-NEXT: ret i32 0 ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn mustprogress 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 @@ -63,7 +63,7 @@ } define void @f() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@f ; IS__TUNIT_OPM-SAME: () [[ATTR1:#.*]] { ; IS__TUNIT_OPM-NEXT: [[R:%.*]] = alloca i32, align 4 @@ -71,7 +71,7 @@ ; IS__TUNIT_OPM-NEXT: call void @add({ i32, i32 }* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[PAIR]], i32* nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R]]) [[ATTR2:#.*]] ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f ; IS__TUNIT_NPM-SAME: () [[ATTR1:#.*]] { ; IS__TUNIT_NPM-NEXT: [[R:%.*]] = alloca i32, align 4 diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM +; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=4 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM +; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=4 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ; PR14710 diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/variadic.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/variadic.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/variadic.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/variadic.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes -; 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=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/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 @@ -102,14 +102,14 @@ } define i32 @unions() nounwind { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@unions ; IS__TUNIT_OPM-SAME: () [[ATTR1:#.*]] { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(%struct.MYstr* nocapture nofree noundef nonnull readonly byval(%struct.MYstr) align 8 dereferenceable(8) @mystr) [[ATTR3:#.*]] +; IS__TUNIT_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(%struct.MYstr* nocapture nofree noundef nonnull readonly byval(%struct.MYstr) align 8 dereferenceable(8) @mystr) [[ATTR4:#.*]] ; IS__TUNIT_OPM-NEXT: ret i32 [[RESULT]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unions ; IS__TUNIT_NPM-SAME: () [[ATTR1:#.*]] { ; IS__TUNIT_NPM-NEXT: entry: @@ -117,7 +117,7 @@ ; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i8, i8* [[MYSTR_CAST]], align 8 ; IS__TUNIT_NPM-NEXT: [[MYSTR_0_1:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 1 ; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[MYSTR_0_1]], align 8 -; IS__TUNIT_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP0]], i32 [[TMP1]]) [[ATTR3:#.*]] +; IS__TUNIT_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP0]], i32 [[TMP1]]) [[ATTR4:#.*]] ; IS__TUNIT_NPM-NEXT: ret i32 [[RESULT]] ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn mustprogress @@ -213,22 +213,22 @@ } define i32 @unions_v2() nounwind { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@unions_v2 -; IS__TUNIT_OPM-SAME: () [[ATTR2]] { +; IS__TUNIT_OPM-SAME: () [[ATTR3:#.*]] { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(%struct.MYstr* nocapture nofree noundef nonnull readonly byval(%struct.MYstr) align 8 dereferenceable(8) @mystr) [[ATTR4:#.*]] +; IS__TUNIT_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(%struct.MYstr* nocapture nofree noundef nonnull readonly byval(%struct.MYstr) align 8 dereferenceable(8) @mystr) [[ATTR3]] ; IS__TUNIT_OPM-NEXT: ret i32 [[RESULT]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unions_v2 -; IS__TUNIT_NPM-SAME: () [[ATTR2]] { +; IS__TUNIT_NPM-SAME: () [[ATTR3:#.*]] { ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: [[MYSTR_CAST:%.*]] = bitcast %struct.MYstr* @mystr to i8* ; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i8, i8* [[MYSTR_CAST]], align 8 ; IS__TUNIT_NPM-NEXT: [[MYSTR_0_1:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 1 ; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[MYSTR_0_1]], align 8 -; IS__TUNIT_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(i8 [[TMP0]], i32 [[TMP1]]) [[ATTR4:#.*]] +; IS__TUNIT_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(i8 [[TMP0]], i32 [[TMP1]]) [[ATTR3]] ; IS__TUNIT_NPM-NEXT: ret i32 [[RESULT]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress 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 @@ -8,11 +8,11 @@ target triple = "x86_64-unknown-linux-gnu" define i64 @fn2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@fn2 ; IS__TUNIT____-SAME: () [[ATTR0:#.*]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 undef) [[ATTR1:#.*]], [[RNG0:!range !.*]] +; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 undef) [[ATTR0]], [[RNG0:!range !.*]] ; IS__TUNIT____-NEXT: ret i64 [[CALL2]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -37,13 +37,13 @@ } define i64 @fn2b(i32 %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@fn2b ; IS__TUNIT____-SAME: (i32 [[ARG:%.*]]) [[ATTR0]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64 ; IS__TUNIT____-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]] -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 [[DIV]]) [[ATTR1]], [[RNG0]] +; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 [[DIV]]) [[ATTR0]], [[RNG0]] ; IS__TUNIT____-NEXT: ret i64 [[CALL2]] ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn @@ -63,11 +63,11 @@ } define i64 @fn2c() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@fn2c ; IS__TUNIT____-SAME: () [[ATTR0]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 noundef 42) [[ATTR1]], [[RNG0]] +; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 noundef 42) [[ATTR0]], [[RNG0]] ; IS__TUNIT____-NEXT: ret i64 [[CALL2]] ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -87,7 +87,7 @@ define internal i64 @fn1(i64 %p1) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@fn1 -; IS__TUNIT____-SAME: (i64 returned [[P1:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i64 returned [[P1:%.*]]) [[ATTR1:#.*]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp ne i64 [[P1]], 0 ; IS__TUNIT____-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i64 [[P1]], i64 [[P1]] 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 @@ -27,9 +27,9 @@ } define void @baz(<8 x i32> %arg) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; 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____-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr [[ATTR1:#.*]] { ; IS__TUNIT____-NEXT: bb: ; IS__TUNIT____-NEXT: ret void ; 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 -; 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=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-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 ; @@ -74,9 +74,9 @@ } define internal i32 @cb2(i32 %unknown) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@cb2 -; IS__TUNIT____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) [[ATTR1:#.*]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: ret i32 [[UNKNOWN]] ; diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll b/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes -; 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=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-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 ; PR36485 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 @@ -1,27 +1,38 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes -; 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=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-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 ; CHECK-NOT: %X define internal i32 @foo(i32 %X) { +; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone +; IS__TUNIT____-LABEL: define {{[^@]+}}@foo +; IS__TUNIT____-SAME: () [[ATTR0:#.*]] { +; IS__TUNIT____-NEXT: unreachable +; +; IS__CGSCC____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn mustprogress +; IS__CGSCC____-LABEL: define {{[^@]+}}@foo +; IS__CGSCC____-SAME: () [[ATTR0:#.*]] { +; IS__CGSCC____-NEXT: unreachable +; %Y = call i32 @foo( i32 %X ) ; [#uses=1] %Z = add i32 %Y, 1 ; [#uses=1] ret i32 %Z } define void @bar() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: () [[ATTR0:#.*]] { +; IS__TUNIT____-SAME: () [[ATTR0]] { +; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @foo() [[ATTR0]] ; IS__TUNIT____-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress +; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@bar -; IS__CGSCC____-SAME: () [[ATTR0:#.*]] { -; IS__CGSCC____-NEXT: ret void +; IS__CGSCC____-SAME: () [[ATTR1:#.*]] { +; IS__CGSCC____-NEXT: unreachable ; call i32 @foo( i32 17 ) ; :1 [#uses=0] ret void 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,10 +7,10 @@ ; FIXME: icmp folding is missing define i1 @invokecaller(i1 %C) personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@invokecaller ; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR0:#.*]] personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT____-NEXT: [[X:%.*]] = call i32 @foo(i1 [[C]]) [[ATTR1:#.*]] +; IS__TUNIT____-NEXT: [[X:%.*]] = call i32 @foo(i1 [[C]]) [[ATTR0]] ; IS__TUNIT____-NEXT: br label [[OK:%.*]] ; IS__TUNIT____: OK: ; IS__TUNIT____-NEXT: ret i1 true @@ -40,7 +40,7 @@ define internal i32 @foo(i1 %C) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR1:#.*]] { ; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT____: T: ; IS__TUNIT____-NEXT: ret i32 undef @@ -66,7 +66,7 @@ } define i1 @caller(i1 %C) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; 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 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 -; 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=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-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM diff --git a/llvm/test/Transforms/Attributor/align.ll b/llvm/test/Transforms/Attributor/align.ll --- a/llvm/test/Transforms/Attributor/align.ll +++ b/llvm/test/Transforms/Attributor/align.ll @@ -227,9 +227,9 @@ ; TEST 7 ; Better than IR information define align 4 i8* @test7() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test7 -; IS__TUNIT____-SAME: () [[ATTR0]] { +; IS__TUNIT____-SAME: () [[ATTR2:#.*]] { ; IS__TUNIT____-NEXT: [[C:%.*]] = tail call i8* @f1(i8* noalias nofree noundef nonnull readnone align 8 dereferenceable(1) "no-capture-maybe-returned" @a1) [[ATTR12:#.*]] ; IS__TUNIT____-NEXT: ret i8* [[C]] ; @@ -313,9 +313,9 @@ } define align 4 i32* @test7b(i32* align 32 %p) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn mustprogress +; 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____-SAME: (i32* nofree readnone returned align 32 "no-capture-maybe-returned" [[P:%.*]]) [[ATTR2]] { ; IS__TUNIT____-NEXT: ret i32* [[P]] ; ; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn mustprogress @@ -329,23 +329,14 @@ ; TEST 8 define void @test8_helper() { -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test8_helper() { -; NOT_CGSCC_OPM-NEXT: [[PTR0:%.*]] = tail call i32* @unknown() -; NOT_CGSCC_OPM-NEXT: [[PTR1:%.*]] = tail call align 4 i32* @unknown() -; NOT_CGSCC_OPM-NEXT: [[PTR2:%.*]] = tail call align 8 i32* @unknown() -; NOT_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]]) [[ATTR2:#.*]] -; NOT_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]]) [[ATTR2]] -; NOT_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]]) [[ATTR2]] -; NOT_CGSCC_OPM-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:#.*]] -; 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 +; CHECK-LABEL: define {{[^@]+}}@test8_helper() { +; CHECK-NEXT: [[PTR0:%.*]] = tail call i32* @unknown() +; CHECK-NEXT: [[PTR1:%.*]] = tail call align 4 i32* @unknown() +; CHECK-NEXT: [[PTR2:%.*]] = tail call align 8 i32* @unknown() +; CHECK-NEXT: tail call void @test8(i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone [[PTR0]]) +; CHECK-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]]) +; CHECK-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]]) +; CHECK-NEXT: ret void ; %ptr0 = tail call i32* @unknown() %ptr1 = tail call align 4 i32* @unknown() @@ -359,21 +350,21 @@ declare void @user_i32_ptr(i32* nocapture readnone) nounwind define internal void @test8(i32* %a, i32* %b, i32* %c) { -; NOT_CGSCC_OPM: Function Attrs: nounwind -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test8 -; NOT_CGSCC_OPM-SAME: (i32* noalias nocapture readnone align 4 [[A:%.*]], i32* noalias nocapture readnone align 4 [[B:%.*]], i32* noalias nocapture readnone [[C:%.*]]) [[ATTR2]] { -; NOT_CGSCC_OPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) [[ATTR2]] -; NOT_CGSCC_OPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) [[ATTR2]] -; NOT_CGSCC_OPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) [[ATTR2]] -; NOT_CGSCC_OPM-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 +; NOT_CGSCC_NPM: Function Attrs: nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test8 +; NOT_CGSCC_NPM-SAME: (i32* noalias nocapture readnone align 4 [[A:%.*]], i32* noalias nocapture readnone align 4 [[B:%.*]], i32* noalias nocapture readnone [[C:%.*]]) [[ATTR3:#.*]] { +; NOT_CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) [[ATTR3]] +; NOT_CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) [[ATTR3]] +; NOT_CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) [[ATTR3]] +; NOT_CGSCC_NPM-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 ; call void @user_i32_ptr(i32* %a) call void @user_i32_ptr(i32* %b) @@ -401,43 +392,43 @@ ; FIXME: This will work with an upcoming patch (D66618 or similar) ; store i32 -1, i32* %g1, align 32 define i32* @test10a(i32* align 32 %p) { -; NOT_CGSCC_OPM: Function Attrs: nofree nosync nounwind -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test10a -; NOT_CGSCC_OPM-SAME: (i32* nofree nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) [[ATTR3:#.*]] { -; NOT_CGSCC_OPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 -; NOT_CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; NOT_CGSCC_OPM: t: -; NOT_CGSCC_OPM-NEXT: [[R:%.*]] = call align 32 i32* @test10a(i32* nofree nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) [[ATTR3]] -; NOT_CGSCC_OPM-NEXT: store i32 1, i32* [[R]], align 32 -; NOT_CGSCC_OPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; NOT_CGSCC_OPM-NEXT: br label [[E:%.*]] -; NOT_CGSCC_OPM: f: -; NOT_CGSCC_OPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; NOT_CGSCC_OPM-NEXT: store i32 -1, i32* [[G1]], align 32 -; NOT_CGSCC_OPM-NEXT: br label [[E]] -; NOT_CGSCC_OPM: e: -; NOT_CGSCC_OPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] -; NOT_CGSCC_OPM-NEXT: ret i32* [[PHI]] -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test10a -; IS__CGSCC_OPM-SAME: (i32* nofree 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* @test10a(i32* nofree 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]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test10a +; NOT_CGSCC_NPM-SAME: (i32* nofree nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) [[ATTR4:#.*]] { +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: [[R:%.*]] = call align 32 i32* @test10a(i32* nofree nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) [[ATTR4]] +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[R]], align 32 +; NOT_CGSCC_NPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; NOT_CGSCC_NPM-NEXT: br label [[E:%.*]] +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; NOT_CGSCC_NPM-NEXT: store i32 -1, i32* [[G1]], align 32 +; NOT_CGSCC_NPM-NEXT: br label [[E]] +; NOT_CGSCC_NPM: e: +; NOT_CGSCC_NPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] +; NOT_CGSCC_NPM-NEXT: ret i32* [[PHI]] +; +; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test10a +; IS__CGSCC_NPM-SAME: (i32* nofree 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* @test10a(i32* nofree 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]] ; %l = load i32, i32* %p %c = icmp eq i32 %l, 0 @@ -463,43 +454,43 @@ ; FIXME: This will work with an upcoming patch (D66618 or similar) ; store i32 -1, i32* %g1, align 32 define i32* @test10b(i32* align 32 %p) { -; NOT_CGSCC_OPM: Function Attrs: nofree nosync nounwind -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test10b -; NOT_CGSCC_OPM-SAME: (i32* nofree nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) [[ATTR3]] { -; NOT_CGSCC_OPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 -; NOT_CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; NOT_CGSCC_OPM: t: -; NOT_CGSCC_OPM-NEXT: [[R:%.*]] = call align 32 i32* @test10b(i32* nofree nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) [[ATTR3]] -; NOT_CGSCC_OPM-NEXT: store i32 1, i32* [[R]], align 32 -; NOT_CGSCC_OPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; NOT_CGSCC_OPM-NEXT: br label [[E:%.*]] -; NOT_CGSCC_OPM: f: -; NOT_CGSCC_OPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8 -; NOT_CGSCC_OPM-NEXT: store i32 -1, i32* [[G1]], align 32 -; NOT_CGSCC_OPM-NEXT: br label [[E]] -; NOT_CGSCC_OPM: e: -; NOT_CGSCC_OPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] -; NOT_CGSCC_OPM-NEXT: ret i32* [[PHI]] -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test10b -; IS__CGSCC_OPM-SAME: (i32* nofree 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 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]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test10b +; NOT_CGSCC_NPM-SAME: (i32* nofree nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) [[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: [[R:%.*]] = call align 32 i32* @test10b(i32* nofree nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) [[ATTR4]] +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[R]], align 32 +; NOT_CGSCC_NPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; NOT_CGSCC_NPM-NEXT: br label [[E:%.*]] +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8 +; NOT_CGSCC_NPM-NEXT: store i32 -1, i32* [[G1]], align 32 +; NOT_CGSCC_NPM-NEXT: br label [[E]] +; NOT_CGSCC_NPM: e: +; NOT_CGSCC_NPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] +; NOT_CGSCC_NPM-NEXT: ret i32* [[PHI]] +; +; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test10b +; IS__CGSCC_NPM-SAME: (i32* nofree 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 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]] ; %l = load i32, i32* %p %c = icmp eq i32 %l, 0 @@ -522,7 +513,7 @@ define i64 @test11(i32* %p) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@test11 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) [[ATTR4:#.*]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) [[ATTR5:#.*]] { ; 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]] @@ -546,7 +537,7 @@ define i64 @test12-1(i32* align 4 %p) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-1 -; IS__TUNIT____-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) [[ATTR4]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) [[ATTR5]] { ; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* ; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 ; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 @@ -572,7 +563,7 @@ define i64 @test12-2(i32* align 4 %p) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-2 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) [[ATTR4]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) [[ATTR5]] { ; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* ; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 ; IS__TUNIT____-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16 @@ -596,7 +587,7 @@ define void @test12-3(i32* align 4 %p) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-3 -; IS__TUNIT____-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) [[ATTR5:#.*]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) [[ATTR6:#.*]] { ; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* ; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 ; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 @@ -622,7 +613,7 @@ define void @test12-4(i32* align 4 %p) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-4 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) [[ATTR5]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) [[ATTR6]] { ; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* ; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 ; IS__TUNIT____-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16 @@ -645,23 +636,32 @@ declare void @use(i64*) willreturn nounwind define void @test12-5(i32* align 4 %p) { -; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn mustprogress -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test12-5 -; NOT_CGSCC_OPM-SAME: (i32* align 16 [[P:%.*]]) [[ATTR7:#.*]] { -; NOT_CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; NOT_CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 -; NOT_CGSCC_OPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 -; NOT_CGSCC_OPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX1]]) [[ATTR6:#.*]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn mustprogress +; IS__TUNIT____: Function Attrs: nounwind willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-5 +; IS__TUNIT____-SAME: (i32* align 16 [[P:%.*]]) [[ATTR7:#.*]] { +; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; IS__TUNIT____-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX1]]) [[ATTR13:#.*]] +; 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:%.*]]) [[ATTR8:#.*]] { +; 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 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: tail call void @use(i64* align 16 [[ARRAYIDX1]]) [[ATTR12:#.*]] ; 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:#.*]] { +; 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]]) [[ATTR11:#.*]] +; IS__CGSCC_NPM-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 1 @@ -671,21 +671,29 @@ } define void @test12-6(i32* align 4 %p) { -; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn mustprogress -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test12-6 -; NOT_CGSCC_OPM-SAME: (i32* align 16 [[P:%.*]]) [[ATTR7]] { -; NOT_CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; NOT_CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; NOT_CGSCC_OPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) [[ATTR6]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn mustprogress +; IS__TUNIT____: Function Attrs: nounwind willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-6 +; IS__TUNIT____-SAME: (i32* align 16 [[P:%.*]]) [[ATTR7]] { +; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; IS__TUNIT____-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) [[ATTR13]] +; 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:%.*]]) [[ATTR8]] { +; 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: tail call void @use(i64* align 16 [[ARRAYIDX0]]) [[ATTR12]] ; 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]]) [[ATTR11]] +; IS__CGSCC_NPM-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 0 @@ -709,7 +717,7 @@ ; ; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@test13 -; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) [[ATTR8:#.*]] { +; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) [[ATTR7:#.*]] { ; IS__CGSCC____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; IS__CGSCC____: truebb: ; IS__CGSCC____-NEXT: br label [[END:%.*]] @@ -747,7 +755,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@test13-1 -; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) [[ATTR9:#.*]] { +; 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:%.*]] @@ -785,7 +793,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@test13-2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) [[ATTR9]] { +; 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:%.*]] @@ -823,7 +831,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@test13-3 -; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) [[ATTR9]] { +; 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:%.*]] @@ -855,7 +863,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@ptr2int -; IS__CGSCC____-SAME: (i32* nofree readnone [[P:%.*]]) [[ATTR10:#.*]] { +; IS__CGSCC____-SAME: (i32* nofree readnone [[P:%.*]]) [[ATTR9:#.*]] { ; IS__CGSCC____-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64 ; IS__CGSCC____-NEXT: ret i64 [[P2I]] ; @@ -871,7 +879,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@int2ptr -; IS__CGSCC____-SAME: (i64 [[I:%.*]]) [[ATTR10]] { +; IS__CGSCC____-SAME: (i64 [[I:%.*]]) [[ATTR9]] { ; IS__CGSCC____-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64* ; IS__CGSCC____-NEXT: ret i64* [[I2P]] ; @@ -883,7 +891,7 @@ define void @aligned_store(i8* %Value, i8** %Ptr) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@aligned_store -; IS__TUNIT____-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) [[ATTR5]] { +; IS__TUNIT____-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) [[ATTR6]] { ; IS__TUNIT____-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32 ; IS__TUNIT____-NEXT: ret void ; @@ -913,7 +921,7 @@ ; ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@align_store_after_bc -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) [[ATTR5]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) [[ATTR6]] { ; IS__TUNIT____-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8* ; IS__TUNIT____-NEXT: store i8 0, i8* [[BC]], align 2048 ; IS__TUNIT____-NEXT: ret void @@ -936,7 +944,7 @@ define i32 @musttail_callee_1(i32* %p) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@musttail_callee_1 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[P:%.*]]) [[ATTR4]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[P:%.*]]) [[ATTR5]] { ; IS__TUNIT____-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32 ; IS__TUNIT____-NEXT: ret i32 [[V]] ; @@ -950,20 +958,20 @@ ret i32 %v } define i32 @musttail_caller_1(i32* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@musttail_caller_1 ; IS__TUNIT____-SAME: (i32* nocapture nofree readonly [[P:%.*]]) [[ATTR11:#.*]] { ; 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]]) [[ATTR13:#.*]] +; IS__TUNIT____-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree readonly [[P]]) [[ATTR11]] ; 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 mustprogress ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@musttail_caller_1 -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readonly [[P:%.*]]) [[ATTR12:#.*]] { +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readonly [[P:%.*]]) [[ATTR11:#.*]] { ; 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: @@ -974,7 +982,7 @@ ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@musttail_caller_1 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree readonly [[P:%.*]]) [[ATTR11:#.*]] { +; IS__CGSCC_NPM-SAME: (i32* nocapture nofree readonly [[P:%.*]]) [[ATTR10:#.*]] { ; 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: @@ -993,37 +1001,37 @@ } define i32* @checkAndAdvance(i32* align(16) %p) { -; NOT_CGSCC_OPM: Function Attrs: nounwind -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@checkAndAdvance -; NOT_CGSCC_OPM-SAME: (i32* nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) [[ATTR2]] { -; NOT_CGSCC_OPM-NEXT: entry: -; NOT_CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 16 -; NOT_CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] -; NOT_CGSCC_OPM: if.then: -; NOT_CGSCC_OPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 4 -; NOT_CGSCC_OPM-NEXT: [[CALL:%.*]] = call nonnull align 16 i32* @checkAndAdvance(i32* nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) [[ATTR2]] -; NOT_CGSCC_OPM-NEXT: br label [[RETURN]] -; NOT_CGSCC_OPM: return: -; NOT_CGSCC_OPM-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ] -; NOT_CGSCC_OPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) [[ATTR2]] -; NOT_CGSCC_OPM-NEXT: ret i32* [[RETVAL_0]] -; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@checkAndAdvance -; IS__CGSCC_OPM-SAME: (i32* 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]] +; NOT_CGSCC_NPM: Function Attrs: nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@checkAndAdvance +; NOT_CGSCC_NPM-SAME: (i32* nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) [[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 16 +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 4 +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call nonnull align 16 i32* @checkAndAdvance(i32* nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) [[ATTR3]] +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ] +; NOT_CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) [[ATTR3]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[RETVAL_0]] +; +; IS__CGSCC_NPM: Function Attrs: nounwind +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@checkAndAdvance +; IS__CGSCC_NPM-SAME: (i32* 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]] ; entry: %0 = load i32, i32* %p, align 4 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 @@ -28,7 +28,7 @@ ; CHECK_DISABLED_FUNCTION-NEXT: [[TMP2:%.*]] = zext i1 [[TMP1]] to i32 ; CHECK_DISABLED_FUNCTION-NEXT: ret i32 [[TMP2]] ; -; CHECK_ENABLED_FUNCTION: Function Attrs: noinline nounwind readnone uwtable +; CHECK_ENABLED_FUNCTION: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; CHECK_ENABLED_FUNCTION-LABEL: define {{[^@]+}}@range_test ; CHECK_ENABLED_FUNCTION-SAME: () [[ATTR0:#.*]] { ; CHECK_ENABLED_FUNCTION-NEXT: ret i32 1 @@ -59,7 +59,7 @@ ; ; CHECK_ENABLED_FUNCTION: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; CHECK_ENABLED_FUNCTION-LABEL: define {{[^@]+}}@range_use1 -; CHECK_ENABLED_FUNCTION-SAME: () [[ATTR1:#.*]] { +; CHECK_ENABLED_FUNCTION-SAME: () [[ATTR0]] { ; CHECK_ENABLED_FUNCTION-NEXT: ret i32 1 ; %1 = call i32 @range_test(i32 123) @@ -87,7 +87,7 @@ ; ; CHECK_ENABLED_FUNCTION: Function Attrs: noinline nounwind uwtable ; CHECK_ENABLED_FUNCTION-LABEL: define {{[^@]+}}@range_use2 -; CHECK_ENABLED_FUNCTION-SAME: () [[ATTR2:#.*]] { +; CHECK_ENABLED_FUNCTION-SAME: () [[ATTR1:#.*]] { ; CHECK_ENABLED_FUNCTION-NEXT: [[TMP1:%.*]] = call i32 @range_test() ; CHECK_ENABLED_FUNCTION-NEXT: ret i32 [[TMP1]] ; 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 @@ -27,7 +27,7 @@ } define void @outer1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@outer1 ; IS__TUNIT____-SAME: () [[ATTR1:#.*]] { ; IS__TUNIT____-NEXT: entry: 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 @@ -73,8 +73,6 @@ ; GRAPH-NEXT: updates [AANoCapture] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state assumed not-captured-maybe-returned ; GRAPH-NEXT: updates [AANoCapture] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state assumed not-captured-maybe-returned ; GRAPH-NEXT: updates [AANoUnwind] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state nounwind -; GRAPH-NEXT: updates [AANoUnwind] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state nounwind -; GRAPH-NEXT: updates [AANoUnwind] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state nounwind ; GRAPH-NEXT: updates [AANoCapture] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state assumed not-captured-maybe-returned ; GRAPH-NEXT: updates [AANoCapture] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state assumed not-captured-maybe-returned ; GRAPH-NEXT: updates [AANoCapture] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state assumed not-captured-maybe-returned @@ -113,10 +111,8 @@ ; GRAPH-NEXT: updates [AANoCapture] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state assumed not-captured-maybe-returned ; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state readonly ; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state readonly -; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state readonly ; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state readonly ; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state readonly -; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state readonly ; GRAPH-NEXT: updates [AANoCapture] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state assumed not-captured-maybe-returned ; GRAPH-NEXT: updates [AANoCapture] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state assumed not-captured-maybe-returned ; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %2 = load i32, i32* %0, align 4' at position {arg: [@0]} with state readonly @@ -177,13 +173,12 @@ ; GRAPH-EMPTY: ; GRAPH-NEXT: [AAIsDead] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs_ret: [@-1]} with state assumed-live ; GRAPH-EMPTY: +; GRAPH-NEXT: [AAMustProgress] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state may-not-progress +; GRAPH-EMPTY: ; GRAPH-NEXT: [AANoUnwind] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state nounwind -; GRAPH-NEXT: updates [AAIsDead] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs_ret: [@-1]} with state assumed-live -; GRAPH-NEXT: updates [AAIsDead] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs_ret: [@-1]} with state assumed-live ; GRAPH-NEXT: updates [AANoUnwind] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state nounwind ; GRAPH-EMPTY: ; GRAPH-NEXT: [AAMemoryBehavior] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state readonly -; GRAPH-NEXT: updates [AAIsDead] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs_ret: [@-1]} with state assumed-live ; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state readonly ; GRAPH-EMPTY: ; GRAPH-NEXT: [AAIsDead] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs_arg: [@0]} with state assumed-live @@ -202,7 +197,6 @@ ; GRAPH-NEXT: [AAMemoryBehavior] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs_arg: [@0]} with state readonly ; GRAPH-NEXT: updates [AAMemoryLocation] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state memory:argument ; GRAPH-NEXT: updates [AAMemoryLocation] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state memory:argument -; GRAPH-NEXT: updates [AAMemoryLocation] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state memory:argument ; GRAPH-EMPTY: ; GRAPH-NEXT: [AANoFree] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs_arg: [@0]} with state nofree ; GRAPH-EMPTY: @@ -230,24 +224,24 @@ ; GRAPH-NEXT: updates [AANonNull] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn_ret:checkAndAdvance [checkAndAdvance@-1]} with state nonnull ; GRAPH-NEXT: updates [AANonNull] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn_ret:checkAndAdvance [checkAndAdvance@-1]} with state nonnull ; GRAPH-EMPTY: -; GRAPH-NEXT: [AAIsDead] for CtxI ' ret i32* %.0' at position {flt: [@-1]} with state assumed-live -; GRAPH-EMPTY: -; GRAPH-NEXT: [AAIsDead] for CtxI ' br label %8' at position {flt: [@-1]} with state assumed-live +; GRAPH-NEXT: [AAMemoryLocation] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state memory:argument +; GRAPH-NEXT: updates [AAMemoryLocation] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state memory:argument ; GRAPH-EMPTY: -; GRAPH-NEXT: [AAIsDead] for CtxI ' %5 = getelementptr inbounds i32, i32* %0, i64 4' at position {flt: [@-1]} with state assumed-live +; GRAPH-NEXT: [AANoRecurse] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state may-recurse ; GRAPH-EMPTY: -; GRAPH-NEXT: [AAWillReturn] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state may-noreturn +; GRAPH-NEXT: [AAIsDead] for CtxI ' ret i32* %.0' at position {flt: [@-1]} with state assumed-live ; GRAPH-EMPTY: -; GRAPH-NEXT: [AANoRecurse] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state may-recurse +; GRAPH-NEXT: [AANoFree] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state nofree +; GRAPH-NEXT: updates [AANoFree] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state nofree ; GRAPH-EMPTY: ; GRAPH-NEXT: [AANoSync] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state nosync ; GRAPH-NEXT: updates [AANoSync] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state nosync ; GRAPH-EMPTY: -; GRAPH-NEXT: [AANoFree] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state nofree -; GRAPH-NEXT: updates [AANoFree] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state nofree +; GRAPH-NEXT: [AAWillReturn] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state may-noreturn ; GRAPH-EMPTY: -; GRAPH-NEXT: [AAMemoryLocation] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position {cs: [@-1]} with state memory:argument -; GRAPH-NEXT: updates [AAMemoryLocation] for CtxI ' %2 = load i32, i32* %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state memory:argument +; GRAPH-NEXT: [AAIsDead] for CtxI ' br label %8' at position {flt: [@-1]} with state assumed-live +; GRAPH-EMPTY: +; GRAPH-NEXT: [AAIsDead] for CtxI ' %5 = getelementptr inbounds i32, i32* %0, i64 4' at position {flt: [@-1]} with state assumed-live ; GRAPH-EMPTY: ; GRAPH-NEXT: [AAIsDead] for CtxI ' br label %8' at position {flt: [@-1]} with state assumed-live ; GRAPH-EMPTY: @@ -269,53 +263,5 @@ ; DOT-DAG: Node[[Node6:0x[a-z0-9]+]] [shape=record,label="{[AANoUnwind] for CtxI ' %2 = load i32, i32* %0, align 4' at position \{fn:checkAndAdvance [checkAndAdvance@-1]\} ; DOT-DAG: Node[[Node34:0x[a-z0-9]+]] [shape=record,label="{[AANoCapture] for CtxI ' %2 = load i32, i32* %0, align 4' at position \{arg: [@0]\} -; DOT-DAG: Node[[Node39:0x[a-z0-9]+]] [shape=record,label="{[AANoUnwind] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position \{cs: [@-1]\} -; DOT-DAG: Node[[Node7:0x[a-z0-9]+]] [shape=record,label="{[AANoSync] for CtxI ' %2 = load i32, i32* %0, align 4' at position \{fn:checkAndAdvance [checkAndAdvance@-1]\} -; DOT-DAG: Node[[Node61:0x[a-z0-9]+]] [shape=record,label="{[AANoSync] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position \{cs: [@-1]\} -; DOT-DAG: Node[[Node13:0x[a-z0-9]+]] [shape=record,label="{[AANoFree] for CtxI ' %2 = load i32, i32* %0, align 4' at position \{fn:checkAndAdvance [checkAndAdvance@-1]\} -; DOT-DAG: Node[[Node36:0x[a-z0-9]+]] [shape=record,label="{[AANoFree] for CtxI ' %2 = load i32, i32* %0, align 4' at position \{arg: [@0]\} -; DOT-DAG: Node[[Node62:0x[a-z0-9]+]] [shape=record,label="{[AANoFree] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position \{cs: [@-1]\} -; DOT-DAG: Node[[Node16:0x[a-z0-9]+]] [shape=record,label="{[AAMemoryBehavior] for CtxI ' %2 = load i32, i32* %0, align 4' at position \{fn:checkAndAdvance [checkAndAdvance@-1]\} -; DOT-DAG: Node[[Node35:0x[a-z0-9]+]] [shape=record,label="{[AAMemoryBehavior] for CtxI ' %2 = load i32, i32* %0, align 4' at position \{arg: [@0]\} -; DOT-DAG: Node[[Node40:0x[a-z0-9]+]] [shape=record,label="{[AAMemoryBehavior] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position \{cs: [@-1]\} -; DOT-DAG: Node[[Node17:0x[a-z0-9]+]] [shape=record,label="{[AAMemoryLocation] for CtxI ' %2 = load i32, i32* %0, align 4' at position \{fn:checkAndAdvance [checkAndAdvance@-1]\} -; DOT-DAG: Node[[Node63:0x[a-z0-9]+]] [shape=record,label="{[AAMemoryLocation] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position \{cs: [@-1]\} -; DOT-DAG: Node[[Node22:0x[a-z0-9]+]] [shape=record,label="{[AAAlign] for CtxI ' %2 = load i32, i32* %0, align 4' at position \{fn_ret:checkAndAdvance [checkAndAdvance@-1]\} -; DOT-DAG: Node[[Node65:0x[a-z0-9]+]] [shape=record,label="{[AAAlign] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position \{cs_ret: [@-1]\} -; DOT-DAG: Node[[Node23:0x[a-z0-9]+]] [shape=record,label="{[AANonNull] for CtxI ' %2 = load i32, i32* %0, align 4' at position \{fn_ret:checkAndAdvance [checkAndAdvance@-1]\} -; DOT-DAG: Node[[Node67:0x[a-z0-9]+]] [shape=record,label="{[AANonNull] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position \{cs_ret: [@-1]\} -; DOT-DAG: Node[[Node43:0x[a-z0-9]+]] [shape=record,label="{[AANoCapture] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position \{cs_arg: [@0]\} -; DOT-DAG: Node[[Node45:0x[a-z0-9]+]] [shape=record,label="{[AAMemoryBehavior] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position \{cs_arg: [@0]\} -; DOT-DAG: Node[[Node46:0x[a-z0-9]+]] [shape=record,label="{[AANoFree] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position \{cs_arg: [@0]\} -; DOT-DAG: Node[[Node38:0x[a-z0-9]+]] [shape=record,label="{[AAIsDead] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position \{cs_ret: [@-1]\} -; DOT-DAG: Node[[Node55:0x[a-z0-9]+]] [shape=record,label="{[AANonNull] for CtxI ' %5 = getelementptr inbounds i32, i32* %0, i64 4' at position \{flt: [@-1]\} -; DOT-DAG: Node[[Node31:0x[a-x0-9]+]] [shape=record,label="{[AANonNull] for CtxI ' %6 = call i32* @checkAndAdvance(i32* %5)' at position \{cs_arg: [@0]\} ; DOT-DAG: Node[[Node6]] -> Node[[Node34]] -; DOT-DAG: Node[[Node6]] -> Node[[Node39]] -; DOT-DAG: Node[[Node7]] -> Node[[Node61]] -; DOT-DAG: Node[[Node13]] -> Node[[Node36]] -; DOT-DAG: Node[[Node13]] -> Node[[Node62]] -; DOT-DAG: Node[[Node16]] -> Node[[Node34]] -; DOT-DAG: Node[[Node16]] -> Node[[Node35]] -; DOT-DAG: Node[[Node16]] -> Node[[Node40]] -; DOT-DAG: Node[[Node17]] -> Node[[Node63]] -; DOT-DAG: Node[[Node22]] -> Node[[Node65]] -; DOT-DAG: Node[[Node23]] -> Node[[Node67]] -; DOT-DAG: Node[[Node34]] -> Node[[Node43]] -; DOT-DAG: Node[[Node35]] -> Node[[Node45]] -; DOT-DAG: Node[[Node36]] -> Node[[Node46]] -; DOT-DAG: Node[[Node39]] -> Node[[Node38]] -; DOT-DAG: Node[[Node39]] -> Node[[Node6]] -; DOT-DAG: Node[[Node40]] -> Node[[Node38]] -; DOT-DAG: Node[[Node40]] -> Node[[Node16]] -; DOT-DAG: Node[[Node43]] -> Node[[Node34]] -; DOT-DAG: Node[[Node45]] -> Node[[Node17]] -; DOT-DAG: Node[[Node55]] -> Node[[Node55]] -; DOT-DAG: Node[[Node55]] -> Node[[Node31]] -; DOT-DAG: Node[[Node55]] -> Node[[Node23]] -; DOT-DAG: Node[[Node61]] -> Node[[Node7]] -; DOT-DAG: Node[[Node62]] -> Node[[Node13]] -; DOT-DAG: Node[[Node63]] -> Node[[Node17]] -; DOT-DAG: Node[[Node65]] -> Node[[Node22]] -; DOT-DAG: Node[[Node67]] -> Node[[Node23]] 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 @@ -234,30 +234,50 @@ declare i32* @unkown_ptr() willreturn nounwind declare i32 @unkown_f(i32*) willreturn nounwind define i32* @f7_0(i32* %ptr) { -; CHECK: Function Attrs: nounwind willreturn mustprogress -; CHECK-LABEL: define {{[^@]+}}@f7_0 -; CHECK-SAME: (i32* nonnull returned dereferenceable(8) [[PTR:%.*]]) [[ATTR2:#.*]] { -; CHECK-NEXT: [[T:%.*]] = tail call i32 @unkown_f(i32* nonnull dereferenceable(8) [[PTR]]) [[ATTR1:#.*]] -; CHECK-NEXT: ret i32* [[PTR]] +; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f7_0 +; NOT_CGSCC_OPM-SAME: (i32* nonnull returned dereferenceable(8) [[PTR:%.*]]) [[ATTR1:#.*]] { +; NOT_CGSCC_OPM-NEXT: [[T:%.*]] = tail call i32 @unkown_f(i32* nonnull dereferenceable(8) [[PTR]]) [[ATTR6:#.*]] +; NOT_CGSCC_OPM-NEXT: ret i32* [[PTR]] +; +; IS__CGSCC_OPM: Function Attrs: nounwind willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f7_0 +; IS__CGSCC_OPM-SAME: (i32* nonnull returned dereferenceable(8) [[PTR:%.*]]) [[ATTR1:#.*]] { +; IS__CGSCC_OPM-NEXT: [[T:%.*]] = tail call i32 @unkown_f(i32* nonnull dereferenceable(8) [[PTR]]) [[ATTR7:#.*]] +; IS__CGSCC_OPM-NEXT: ret i32* [[PTR]] ; %T = tail call i32 @unkown_f(i32* dereferenceable(8) %ptr) ret i32* %ptr } define void @f7_1(i32* %ptr, i1 %c) { -; CHECK: Function Attrs: nounwind willreturn mustprogress -; CHECK-LABEL: define {{[^@]+}}@f7_1 -; CHECK-SAME: (i32* nonnull align 4 dereferenceable(4) [[PTR:%.*]], i1 [[C:%.*]]) [[ATTR2]] { -; CHECK-NEXT: [[A:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(4) [[PTR]]) [[ATTR1]] -; CHECK-NEXT: [[B:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(4) [[PTR]]) [[ATTR1]] -; CHECK-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] -; CHECK: if.true: -; CHECK-NEXT: [[C:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR1]] -; CHECK-NEXT: [[D:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR1]] -; CHECK-NEXT: [[E:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR1]] -; CHECK-NEXT: ret void -; CHECK: if.false: -; CHECK-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f7_1 +; NOT_CGSCC_OPM-SAME: (i32* nonnull align 4 dereferenceable(4) [[PTR:%.*]], i1 [[C:%.*]]) [[ATTR1]] { +; NOT_CGSCC_OPM-NEXT: [[A:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(4) [[PTR]]) [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: [[B:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(4) [[PTR]]) [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] +; NOT_CGSCC_OPM: if.true: +; NOT_CGSCC_OPM-NEXT: [[C:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: [[D:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: [[E:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: ret void +; NOT_CGSCC_OPM: if.false: +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: nounwind willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f7_1 +; IS__CGSCC_OPM-SAME: (i32* nonnull align 4 dereferenceable(4) [[PTR:%.*]], i1 [[C:%.*]]) [[ATTR1]] { +; IS__CGSCC_OPM-NEXT: [[A:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(4) [[PTR]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: [[B:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(4) [[PTR]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] +; IS__CGSCC_OPM: if.true: +; IS__CGSCC_OPM-NEXT: [[C:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: [[D:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: [[E:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: ret void +; IS__CGSCC_OPM: if.false: +; IS__CGSCC_OPM-NEXT: ret void ; %A = tail call i32 @unkown_f(i32* %ptr) %ptr.0 = load i32, i32* %ptr @@ -275,21 +295,37 @@ } define void @f7_2(i1 %c) { -; CHECK: Function Attrs: nounwind willreturn mustprogress -; CHECK-LABEL: define {{[^@]+}}@f7_2 -; CHECK-SAME: (i1 [[C:%.*]]) [[ATTR2]] { -; CHECK-NEXT: [[PTR:%.*]] = tail call nonnull align 4 dereferenceable(4) i32* @unkown_ptr() [[ATTR1]] -; CHECK-NEXT: [[A:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(4) [[PTR]]) [[ATTR1]] -; CHECK-NEXT: [[ARG_A_0:%.*]] = load i32, i32* [[PTR]], align 4 -; CHECK-NEXT: [[B:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(4) [[PTR]]) [[ATTR1]] -; CHECK-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] -; CHECK: if.true: -; CHECK-NEXT: [[C:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR1]] -; CHECK-NEXT: [[D:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR1]] -; CHECK-NEXT: [[E:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR1]] -; CHECK-NEXT: ret void -; CHECK: if.false: -; CHECK-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f7_2 +; NOT_CGSCC_OPM-SAME: (i1 [[C:%.*]]) [[ATTR1]] { +; NOT_CGSCC_OPM-NEXT: [[PTR:%.*]] = tail call nonnull align 4 dereferenceable(4) i32* @unkown_ptr() [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: [[A:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(4) [[PTR]]) [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: [[ARG_A_0:%.*]] = load i32, i32* [[PTR]], align 4 +; NOT_CGSCC_OPM-NEXT: [[B:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(4) [[PTR]]) [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] +; NOT_CGSCC_OPM: if.true: +; NOT_CGSCC_OPM-NEXT: [[C:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: [[D:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: [[E:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: ret void +; NOT_CGSCC_OPM: if.false: +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: nounwind willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f7_2 +; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) [[ATTR1]] { +; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = tail call nonnull align 4 dereferenceable(4) i32* @unkown_ptr() [[ATTR7]] +; IS__CGSCC_OPM-NEXT: [[A:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(4) [[PTR]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: [[ARG_A_0:%.*]] = load i32, i32* [[PTR]], align 4 +; IS__CGSCC_OPM-NEXT: [[B:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(4) [[PTR]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] +; IS__CGSCC_OPM: if.true: +; IS__CGSCC_OPM-NEXT: [[C:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: [[D:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: [[E:%.*]] = tail call i32 @unkown_f(i32* nonnull align 4 dereferenceable(8) [[PTR]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: ret void +; IS__CGSCC_OPM: if.false: +; IS__CGSCC_OPM-NEXT: ret void ; %ptr = tail call i32* @unkown_ptr() %A = tail call i32 @unkown_f(i32* %ptr) @@ -307,12 +343,19 @@ } define i32* @f7_3() { -; CHECK: Function Attrs: nounwind willreturn mustprogress -; CHECK-LABEL: define {{[^@]+}}@f7_3 -; CHECK-SAME: () [[ATTR2]] { -; CHECK-NEXT: [[PTR:%.*]] = tail call nonnull align 16 dereferenceable(4) i32* @unkown_ptr() [[ATTR1]] -; CHECK-NEXT: store i32 10, i32* [[PTR]], align 16 -; CHECK-NEXT: ret i32* [[PTR]] +; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f7_3 +; NOT_CGSCC_OPM-SAME: () [[ATTR1]] { +; NOT_CGSCC_OPM-NEXT: [[PTR:%.*]] = tail call nonnull align 16 dereferenceable(4) i32* @unkown_ptr() [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: store i32 10, i32* [[PTR]], align 16 +; NOT_CGSCC_OPM-NEXT: ret i32* [[PTR]] +; +; IS__CGSCC_OPM: Function Attrs: nounwind willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f7_3 +; IS__CGSCC_OPM-SAME: () [[ATTR1]] { +; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = tail call nonnull align 16 dereferenceable(4) i32* @unkown_ptr() [[ATTR7]] +; IS__CGSCC_OPM-NEXT: store i32 10, i32* [[PTR]], align 16 +; IS__CGSCC_OPM-NEXT: ret i32* [[PTR]] ; %ptr = tail call i32* @unkown_ptr() store i32 10, i32* %ptr, align 16 @@ -323,14 +366,14 @@ define i32* @test_for_minus_index(i32* %p) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_for_minus_index -; IS__TUNIT____-SAME: (i32* nofree nonnull writeonly align 4 "no-capture-maybe-returned" [[P:%.*]]) [[ATTR3:#.*]] { +; IS__TUNIT____-SAME: (i32* nofree nonnull writeonly align 4 "no-capture-maybe-returned" [[P:%.*]]) [[ATTR2:#.*]] { ; 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 mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@test_for_minus_index -; IS__CGSCC____-SAME: (i32* nofree nonnull writeonly align 4 "no-capture-maybe-returned" [[P:%.*]]) [[ATTR3:#.*]] { +; IS__CGSCC____-SAME: (i32* nofree nonnull writeonly align 4 "no-capture-maybe-returned" [[P:%.*]]) [[ATTR2:#.*]] { ; 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]] @@ -343,13 +386,13 @@ define void @deref_or_null_and_nonnull(i32* dereferenceable_or_null(100) %0) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@deref_or_null_and_nonnull -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(100) [[TMP0:%.*]]) [[ATTR3]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree 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 mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@deref_or_null_and_nonnull -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(100) [[TMP0:%.*]]) [[ATTR3]] { +; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(100) [[TMP0:%.*]]) [[ATTR2]] { ; IS__CGSCC____-NEXT: store i32 1, i32* [[TMP0]], align 4 ; IS__CGSCC____-NEXT: ret void ; @@ -368,7 +411,7 @@ 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:%.*]]) [[ATTR4:#.*]] { +; IS__TUNIT_OPM-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) [[ATTR3:#.*]] { ; IS__TUNIT_OPM-NEXT: br label [[TMP1:%.*]] ; IS__TUNIT_OPM: 1: ; IS__TUNIT_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] @@ -385,7 +428,7 @@ ; ; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test8 -; IS__TUNIT_NPM-SAME: (i8* nocapture nofree nonnull writeonly dereferenceable(21) [[PTR:%.*]]) [[ATTR3:#.*]] { +; 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:%.*]] ] @@ -402,7 +445,7 @@ ; ; 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:%.*]]) [[ATTR4:#.*]] { +; IS__CGSCC_OPM-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) [[ATTR3:#.*]] { ; IS__CGSCC_OPM-NEXT: br label [[TMP1:%.*]] ; IS__CGSCC_OPM: 1: ; IS__CGSCC_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] @@ -419,7 +462,7 @@ ; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test8 -; IS__CGSCC_NPM-SAME: (i8* nocapture nofree nonnull writeonly dereferenceable(21) [[PTR:%.*]]) [[ATTR3:#.*]] { +; 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:%.*]] ] @@ -454,7 +497,7 @@ define void @test8_neg(i32 %i, i8* %ptr) #0 { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@test8_neg -; IS__TUNIT____-SAME: (i32 [[I:%.*]], i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) [[ATTR3]] { +; 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 @@ -462,7 +505,7 @@ ; ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@test8_neg -; IS__CGSCC____-SAME: (i32 [[I:%.*]], i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) [[ATTR3]] { +; 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 @@ -485,7 +528,7 @@ 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:%.*]]) [[ATTR4]] { +; 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:%.*]] @@ -502,7 +545,7 @@ ; ; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) [[ATTR3]] { +; 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:%.*]] @@ -519,7 +562,7 @@ ; ; 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:%.*]]) [[ATTR4]] { +; 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:%.*]] @@ -536,7 +579,7 @@ ; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) [[ATTR3]] { +; 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:%.*]] @@ -572,7 +615,7 @@ 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:%.*]]) [[ATTR4]] { +; 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:%.*]] @@ -589,7 +632,7 @@ ; ; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fill_range_inbounds -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) [[ATTR3]] { +; 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:%.*]] @@ -606,7 +649,7 @@ ; ; 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:%.*]]) [[ATTR4]] { +; 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:%.*]] @@ -623,7 +666,7 @@ ; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fill_range_inbounds -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) [[ATTR3]] { +; 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:%.*]] @@ -658,7 +701,7 @@ 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 nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) [[ATTR5:#.*]] { +; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) [[ATTR4:#.*]] { ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, [[RNG0:!range !.*]] ; IS__TUNIT_OPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) [[ATTR7:#.*]] @@ -667,7 +710,7 @@ ; ; 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 nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) [[ATTR4:#.*]] { +; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) [[ATTR3:#.*]] { ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, [[RNG0:!range !.*]] ; IS__TUNIT_NPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) [[ATTR7:#.*]] @@ -676,16 +719,16 @@ ; ; 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 nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) [[ATTR5:#.*]] { +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) [[ATTR4:#.*]] { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, [[RNG0:!range !.*]] ; IS__CGSCC_OPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) [[ATTR8:#.*]] -; IS__CGSCC_OPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) [[ATTR8]] +; IS__CGSCC_OPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) [[ATTR9:#.*]] ; IS__CGSCC_OPM-NEXT: ret void ; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@call_fill_range -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) [[ATTR4:#.*]] { +; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) [[ATTR3:#.*]] { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, [[RNG0:!range !.*]] ; IS__CGSCC_NPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) [[ATTR7:#.*]] @@ -711,17 +754,29 @@ ; fun2(dereferenceable(4) %a, %b) ; We can say that %a is dereferenceable(4) but %b is not. define void @simple-path(i8* %a, i8 * %b, i8 %c) { -; CHECK: Function Attrs: nounwind willreturn mustprogress -; CHECK-LABEL: define {{[^@]+}}@simple-path -; CHECK-SAME: (i8* nonnull dereferenceable(4) [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) [[ATTR2]] { -; 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 @use2(i8* nonnull dereferenceable(8) [[A]], i8* nonnull dereferenceable(8) [[B]]) [[ATTR1]] -; CHECK-NEXT: ret void -; CHECK: if.else: -; CHECK-NEXT: tail call void @use2(i8* nonnull dereferenceable(4) [[A]], i8* [[B]]) [[ATTR1]] -; CHECK-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@simple-path +; NOT_CGSCC_OPM-SAME: (i8* nonnull dereferenceable(4) [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) [[ATTR1]] { +; 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 @use2(i8* nonnull dereferenceable(8) [[A]], i8* nonnull dereferenceable(8) [[B]]) [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: ret void +; NOT_CGSCC_OPM: if.else: +; NOT_CGSCC_OPM-NEXT: tail call void @use2(i8* nonnull dereferenceable(4) [[A]], i8* [[B]]) [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: nounwind willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@simple-path +; IS__CGSCC_OPM-SAME: (i8* nonnull dereferenceable(4) [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) [[ATTR1]] { +; 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 @use2(i8* nonnull dereferenceable(8) [[A]], i8* nonnull dereferenceable(8) [[B]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: ret void +; IS__CGSCC_OPM: if.else: +; IS__CGSCC_OPM-NEXT: tail call void @use2(i8* nonnull dereferenceable(4) [[A]], i8* [[B]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: ret void ; %cmp = icmp eq i8 %c, 0 br i1 %cmp, label %if.then, label %if.else @@ -746,21 +801,37 @@ ; } ; %a is dereferenceable(12) define void @complex-path(i8* %a, i8* %b, i8 %c) { -; CHECK: Function Attrs: nounwind willreturn mustprogress -; CHECK-LABEL: define {{[^@]+}}@complex-path -; CHECK-SAME: (i8* nonnull dereferenceable(12) [[A:%.*]], i8* nocapture nofree readnone [[B:%.*]], i8 [[C:%.*]]) [[ATTR2]] { -; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 -; CHECK-NEXT: tail call void @use1(i8* nonnull dereferenceable(12) [[A]]) [[ATTR1]] -; CHECK-NEXT: br i1 [[CMP]], label [[CONT_THEN:%.*]], label [[CONT_ELSE:%.*]] -; CHECK: cont.then: -; CHECK-NEXT: tail call void @use1(i8* nonnull dereferenceable(12) [[A]]) [[ATTR1]] -; CHECK-NEXT: br label [[CONT2:%.*]] -; CHECK: cont.else: -; CHECK-NEXT: tail call void @use1(i8* nonnull dereferenceable(16) [[A]]) [[ATTR1]] -; CHECK-NEXT: br label [[CONT2]] -; CHECK: cont2: -; CHECK-NEXT: tail call void @use1(i8* nonnull dereferenceable(12) [[A]]) [[ATTR1]] -; CHECK-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@complex-path +; NOT_CGSCC_OPM-SAME: (i8* nonnull dereferenceable(12) [[A:%.*]], i8* nocapture nofree readnone [[B:%.*]], i8 [[C:%.*]]) [[ATTR1]] { +; NOT_CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 +; NOT_CGSCC_OPM-NEXT: tail call void @use1(i8* nonnull dereferenceable(12) [[A]]) [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: br i1 [[CMP]], label [[CONT_THEN:%.*]], label [[CONT_ELSE:%.*]] +; NOT_CGSCC_OPM: cont.then: +; NOT_CGSCC_OPM-NEXT: tail call void @use1(i8* nonnull dereferenceable(12) [[A]]) [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: br label [[CONT2:%.*]] +; NOT_CGSCC_OPM: cont.else: +; NOT_CGSCC_OPM-NEXT: tail call void @use1(i8* nonnull dereferenceable(16) [[A]]) [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: br label [[CONT2]] +; NOT_CGSCC_OPM: cont2: +; NOT_CGSCC_OPM-NEXT: tail call void @use1(i8* nonnull dereferenceable(12) [[A]]) [[ATTR6]] +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: nounwind willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complex-path +; IS__CGSCC_OPM-SAME: (i8* nonnull dereferenceable(12) [[A:%.*]], i8* nocapture nofree readnone [[B:%.*]], i8 [[C:%.*]]) [[ATTR1]] { +; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 +; IS__CGSCC_OPM-NEXT: tail call void @use1(i8* nonnull dereferenceable(12) [[A]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[CONT_THEN:%.*]], label [[CONT_ELSE:%.*]] +; IS__CGSCC_OPM: cont.then: +; IS__CGSCC_OPM-NEXT: tail call void @use1(i8* nonnull dereferenceable(12) [[A]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: br label [[CONT2:%.*]] +; IS__CGSCC_OPM: cont.else: +; IS__CGSCC_OPM-NEXT: tail call void @use1(i8* nonnull dereferenceable(16) [[A]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: br label [[CONT2]] +; IS__CGSCC_OPM: cont2: +; IS__CGSCC_OPM-NEXT: tail call void @use1(i8* nonnull dereferenceable(12) [[A]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: ret void ; %cmp = icmp eq i8 %c, 0 tail call void @use1(i8* dereferenceable(4) %a) @@ -794,7 +865,7 @@ 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 mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@rec-branch-1 -; IS__TUNIT____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) [[ATTR3]] { +; 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:%.*]] @@ -821,7 +892,7 @@ ; ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@rec-branch-1 -; IS__CGSCC____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) [[ATTR3]] { +; 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:%.*]] @@ -895,7 +966,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:%.*]]) [[ATTR4]] { +; IS__TUNIT_OPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) [[ATTR3]] { ; 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:%.*]] @@ -922,7 +993,7 @@ ; ; IS________NPM: Function Attrs: argmemonly nofree nosync nounwind writeonly ; IS________NPM-LABEL: define {{[^@]+}}@rec-branch-2 -; IS________NPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) [[ATTR5:#.*]] { +; IS________NPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) [[ATTR4:#.*]] { ; IS________NPM-NEXT: entry: ; IS________NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 ; IS________NPM-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] @@ -949,7 +1020,7 @@ ; ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind writeonly ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@rec-branch-2 -; IS__CGSCC_OPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) [[ATTR6:#.*]] { +; IS__CGSCC_OPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) [[ATTR5:#.*]] { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 ; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] @@ -969,7 +1040,7 @@ ; IS__CGSCC_OPM-NEXT: store i32 3, i32* [[PTR]], align 4 ; IS__CGSCC_OPM-NEXT: br label [[IF_END8]] ; IS__CGSCC_OPM: if.else6: -; IS__CGSCC_OPM-NEXT: tail call void @rec-branch-2(i32 noundef 1, i32 noundef 1, i32 noundef 1, i32* nocapture nofree writeonly [[PTR]]) [[ATTR9:#.*]] +; IS__CGSCC_OPM-NEXT: tail call void @rec-branch-2(i32 noundef 1, i32 noundef 1, i32 noundef 1, i32* nocapture nofree writeonly [[PTR]]) [[ATTR10:#.*]] ; IS__CGSCC_OPM-NEXT: br label [[IF_END8]] ; IS__CGSCC_OPM: if.end8: ; IS__CGSCC_OPM-NEXT: ret void @@ -1014,21 +1085,15 @@ ; 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) [[ATTR8:#.*]] [ "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) [[ATTR9:#.*]] [ "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) [[ATTR6]] [ "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:%.*]]) { -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) [[ATTR10:#.*]] [ "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__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) [[ATTR7]] [ "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__CGSCC_OPM-NEXT: call void @unknown() ; IS__CGSCC_OPM-NEXT: ret void ; @@ -1072,59 +1137,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() [[ATTR9:#.*]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) [[ATTR9]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) [[ATTR9]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) [[ATTR9]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) [[ATTR9]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) [[ATTR9]] -; 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]]) [[ATTR9]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) [[ATTR9]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) [[ATTR9]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) [[ATTR9]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) [[ATTR9]] -; 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() [[ATTR10:#.*]] -; IS________NPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) [[ATTR10]] -; IS________NPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) [[ATTR10]] -; IS________NPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) [[ATTR10]] -; IS________NPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) [[ATTR10]] -; IS________NPM-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) [[ATTR10]] -; 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]]) [[ATTR10]] -; IS________NPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) [[ATTR10]] -; IS________NPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) [[ATTR10]] -; IS________NPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) [[ATTR10]] -; IS________NPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) [[ATTR10]] -; IS________NPM-NEXT: call void @unknown() -; IS________NPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_call -; IS__CGSCC_OPM-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) { -; IS__CGSCC_OPM-NEXT: call void @unknown() -; IS__CGSCC_OPM-NEXT: [[P:%.*]] = call nonnull dereferenceable(101) i32* @unkown_ptr() [[ATTR11:#.*]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) [[ATTR11]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) [[ATTR11]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) [[ATTR11]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) [[ATTR11]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) [[ATTR11]] -; IS__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) ] -; IS__CGSCC_OPM-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) [[ATTR11]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) [[ATTR11]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) [[ATTR11]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) [[ATTR11]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) [[ATTR11]] -; IS__CGSCC_OPM-NEXT: call void @unknown() -; IS__CGSCC_OPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_call +; CHECK-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) { +; CHECK-NEXT: call void @unknown() +; CHECK-NEXT: [[P:%.*]] = call nonnull dereferenceable(101) i32* @unkown_ptr() +; CHECK-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) +; CHECK-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) +; CHECK-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) +; CHECK-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) +; CHECK-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) +; CHECK-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) ] +; CHECK-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) +; CHECK-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) +; CHECK-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) +; CHECK-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) +; CHECK-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) +; CHECK-NEXT: call void @unknown() +; CHECK-NEXT: ret void ; call void @unknown() %p = call i32* @unkown_ptr() 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 @@ -29,11 +29,23 @@ declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) nounwind define void @nofree_arg_only(i8* %p1, i8* %p2) { -; CHECK-LABEL: define {{[^@]+}}@nofree_arg_only -; CHECK-SAME: (i8* nocapture nofree [[P1:%.*]], i8* nocapture [[P2:%.*]]) { -; CHECK-NEXT: tail call void @free(i8* nocapture [[P2]]) -; CHECK-NEXT: tail call void @nofree_func(i8* nocapture nofree [[P1]]) -; CHECK-NEXT: ret void +; IS__TUNIT____-LABEL: define {{[^@]+}}@nofree_arg_only +; IS__TUNIT____-SAME: (i8* nocapture nofree [[P1:%.*]], i8* nocapture [[P2:%.*]]) { +; IS__TUNIT____-NEXT: tail call void @free(i8* nocapture [[P2]]) +; IS__TUNIT____-NEXT: tail call void @nofree_func(i8* nocapture nofree [[P1]]) +; IS__TUNIT____-NEXT: ret void +; +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nofree_arg_only +; IS__CGSCC_OPM-SAME: (i8* nocapture nofree [[P1:%.*]], i8* nocapture [[P2:%.*]]) { +; IS__CGSCC_OPM-NEXT: tail call void @free(i8* nocapture [[P2]]) +; IS__CGSCC_OPM-NEXT: tail call void @nofree_func(i8* nocapture nofree [[P1]]) [[ATTR5:#.*]] +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@nofree_arg_only +; IS__CGSCC_NPM-SAME: (i8* nocapture nofree [[P1:%.*]], i8* nocapture [[P2:%.*]]) { +; IS__CGSCC_NPM-NEXT: tail call void @free(i8* nocapture [[P2]]) +; IS__CGSCC_NPM-NEXT: tail call void @nofree_func(i8* nocapture nofree [[P1]]) [[ATTR6:#.*]] +; IS__CGSCC_NPM-NEXT: ret void ; tail call void @free(i8* %p2) tail call void @nofree_func(i8* %p1) @@ -331,23 +343,14 @@ ; TEST 9 - FIXME: malloc should be converted. define void @test9() { -; IS________OPM-LABEL: define {{[^@]+}}@test9() { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) -; IS________OPM-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32* -; IS________OPM-NEXT: store i32 10, i32* [[TMP2]], align 4 -; IS________OPM-NEXT: tail call void @foo_nounw(i32* nofree align 4 [[TMP2]]) [[ATTR5:#.*]] -; IS________OPM-NEXT: tail call void @free(i8* nocapture nonnull align 4 dereferenceable(4) [[TMP1]]) -; IS________OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@test9() { -; IS________NPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________NPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) -; IS________NPM-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32* -; IS________NPM-NEXT: store i32 10, i32* [[TMP2]], align 4 -; IS________NPM-NEXT: tail call void @foo_nounw(i32* nofree align 4 [[TMP2]]) [[ATTR6:#.*]] -; IS________NPM-NEXT: tail call void @free(i8* nocapture nonnull align 4 dereferenceable(4) [[TMP1]]) -; IS________NPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@test9() { +; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) +; CHECK-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) +; CHECK-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32* +; CHECK-NEXT: store i32 10, i32* [[TMP2]], align 4 +; CHECK-NEXT: tail call void @foo_nounw(i32* nofree align 4 [[TMP2]]) +; CHECK-NEXT: tail call void @free(i8* nocapture nonnull align 4 dereferenceable(4) [[TMP1]]) +; CHECK-NEXT: ret void ; %1 = tail call noalias i8* @malloc(i64 4) tail call void @no_sync_func(i8* %1) @@ -423,13 +426,13 @@ define void @test11() { ; IS________OPM-LABEL: define {{[^@]+}}@test11() { ; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: tail call void @sync_will_return(i8* [[TMP1]]) [[ATTR5]] +; IS________OPM-NEXT: tail call void @sync_will_return(i8* [[TMP1]]) ; IS________OPM-NEXT: tail call void @free(i8* nocapture [[TMP1]]) ; IS________OPM-NEXT: ret void ; ; IS________NPM-LABEL: define {{[^@]+}}@test11() { ; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 -; IS________NPM-NEXT: tail call void @sync_will_return(i8* [[TMP1]]) [[ATTR6]] +; IS________NPM-NEXT: tail call void @sync_will_return(i8* [[TMP1]]) ; IS________NPM-NEXT: ret void ; %1 = tail call noalias i8* @malloc(i64 4) @@ -728,20 +731,35 @@ } define void @test16c(i8 %v, i8** %P) { -; IS________OPM-LABEL: define {{[^@]+}}@test16c -; IS________OPM-SAME: (i8 [[V:%.*]], i8** nocapture writeonly [[P:%.*]]) { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: store i8* [[TMP1]], i8** [[P]], align 8 -; IS________OPM-NEXT: tail call void @no_sync_func(i8* nocapture nofree [[TMP1]]) [[ATTR5]] -; IS________OPM-NEXT: tail call void @free(i8* nocapture [[TMP1]]) -; IS________OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@test16c -; IS________NPM-SAME: (i8 [[V:%.*]], i8** nocapture writeonly [[P:%.*]]) { -; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 -; IS________NPM-NEXT: store i8* [[TMP1]], i8** [[P]], align 8 -; IS________NPM-NEXT: tail call void @no_sync_func(i8* nocapture nofree [[TMP1]]) [[ATTR6]] -; IS________NPM-NEXT: ret void +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test16c +; IS__TUNIT_OPM-SAME: (i8 [[V:%.*]], i8** nocapture writeonly [[P:%.*]]) { +; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) +; IS__TUNIT_OPM-NEXT: store i8* [[TMP1]], i8** [[P]], align 8 +; IS__TUNIT_OPM-NEXT: tail call void @no_sync_func(i8* nocapture nofree [[TMP1]]) [[ATTR5:#.*]] +; IS__TUNIT_OPM-NEXT: tail call void @free(i8* nocapture [[TMP1]]) +; IS__TUNIT_OPM-NEXT: ret void +; +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test16c +; IS__TUNIT_NPM-SAME: (i8 [[V:%.*]], i8** nocapture writeonly [[P:%.*]]) { +; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 +; IS__TUNIT_NPM-NEXT: store i8* [[TMP1]], i8** [[P]], align 8 +; IS__TUNIT_NPM-NEXT: tail call void @no_sync_func(i8* nocapture nofree [[TMP1]]) [[ATTR6:#.*]] +; IS__TUNIT_NPM-NEXT: ret void +; +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test16c +; IS__CGSCC_OPM-SAME: (i8 [[V:%.*]], i8** nocapture writeonly [[P:%.*]]) { +; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) +; IS__CGSCC_OPM-NEXT: store i8* [[TMP1]], i8** [[P]], align 8 +; IS__CGSCC_OPM-NEXT: tail call void @no_sync_func(i8* nocapture nofree [[TMP1]]) [[ATTR6:#.*]] +; IS__CGSCC_OPM-NEXT: tail call void @free(i8* nocapture [[TMP1]]) +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test16c +; IS__CGSCC_NPM-SAME: (i8 [[V:%.*]], i8** nocapture writeonly [[P:%.*]]) { +; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 +; IS__CGSCC_NPM-NEXT: store i8* [[TMP1]], i8** [[P]], align 8 +; IS__CGSCC_NPM-NEXT: tail call void @no_sync_func(i8* nocapture nofree [[TMP1]]) [[ATTR7:#.*]] +; IS__CGSCC_NPM-NEXT: ret void ; %1 = tail call noalias i8* @malloc(i64 4) store i8* %1, i8** %P 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 @@ -9,8 +9,8 @@ ; IS__TUNIT____-LABEL: define {{[^@]+}}@visible ; IS__TUNIT____-SAME: (i32* noalias nocapture nofree readonly [[A:%.*]], i32* noalias nocapture nofree readonly [[B:%.*]]) [[ATTR0:#.*]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(i32* noalias nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree readonly align 4 [[B]]) [[ATTR4:#.*]] -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(i32* noalias nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree readonly align 4 [[B]]) [[ATTR4]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(i32* noalias nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree readonly align 4 [[B]]) [[ATTR3:#.*]] +; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(i32* noalias nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree readonly align 4 [[B]]) [[ATTR3]] ; IS__TUNIT____-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] ; IS__TUNIT____-NEXT: ret i32 [[ADD]] ; @@ -47,7 +47,7 @@ ; 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: [[CALL:%.*]] = call i32 @noalias_args_argmem(i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree nonnull readonly align 4 dereferenceable(4) [[B]]) [[ATTR4]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem(i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree nonnull readonly align 4 dereferenceable(4) [[B]]) [[ATTR3]] ; IS__TUNIT____-NEXT: [[ADD2:%.*]] = add nsw i32 [[ADD]], [[CALL]] ; IS__TUNIT____-NEXT: ret i32 [[ADD2]] ; @@ -116,8 +116,8 @@ ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[B:%.*]] = alloca i32, align 4 ; IS__TUNIT____-NEXT: store i32 5, i32* [[B]], align 4 -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(i32* nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) [[ATTR4]] -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(i32* nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) [[ATTR4]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(i32* nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) [[ATTR3]] +; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(i32* nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) [[ATTR3]] ; IS__TUNIT____-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] ; IS__TUNIT____-NEXT: ret i32 [[ADD]] ; @@ -205,7 +205,7 @@ ; IS__TUNIT_OPM-SAME: () [[ATTR2:#.*]] { ; IS__TUNIT_OPM-NEXT: [[B:%.*]] = alloca i32, align 4 ; IS__TUNIT_OPM-NEXT: store i32 5, i32* [[B]], align 4 -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_ro(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) [[ATTR5:#.*]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_ro(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) [[ATTR4:#.*]] ; IS__TUNIT_OPM-NEXT: ret i32 [[CALL]] ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn @@ -215,7 +215,7 @@ ; IS__TUNIT_NPM-NEXT: store i32 5, i32* [[B]], align 4 ; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 ; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[B]], align 4 -; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_ro(i32 [[TMP1]], i32 [[TMP2]]) [[ATTR5:#.*]] +; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_ro(i32 [[TMP1]], i32 [[TMP2]]) [[ATTR4:#.*]] ; IS__TUNIT_NPM-NEXT: ret i32 [[CALL]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -263,12 +263,12 @@ } define i32 @visible_local_3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@visible_local_3 -; IS__TUNIT____-SAME: () [[ATTR3:#.*]] { +; IS__TUNIT____-SAME: () [[ATTR2:#.*]] { ; IS__TUNIT____-NEXT: [[B:%.*]] = alloca i32, align 4 ; IS__TUNIT____-NEXT: store i32 5, i32* [[B]], align 4 -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_rn(i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B]]) [[ATTR6:#.*]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_rn(i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B]]) [[ATTR5:#.*]] ; IS__TUNIT____-NEXT: ret i32 [[CALL]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress 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 @@ -135,7 +135,7 @@ ; CHECK_DISABLED-NEXT: call void @unused_arg(i8 noundef 0) ; CHECK_DISABLED-NEXT: ret void ; -; IS__TUNIT_____ENABLED: Function Attrs: nofree noreturn nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_____ENABLED: Function Attrs: nofree noreturn nosync nounwind readnone willreturn ; IS__TUNIT_____ENABLED-LABEL: define {{[^@]+}}@unused_arg_caller ; IS__TUNIT_____ENABLED-SAME: () [[ATTR1:#.*]] { ; IS__TUNIT_____ENABLED-NEXT: unreachable 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 @@ -84,7 +84,7 @@ ; CHECK-LABEL: define {{[^@]+}}@first_block_no_return ; CHECK-SAME: (i32 [[A:%.*]], i32* nocapture nofree nonnull readnone [[PTR1:%.*]], i32* nocapture nofree readnone [[PTR2:%.*]]) [[ATTR0:#.*]] { ; CHECK-NEXT: entry: -; CHECK-NEXT: call void @no_return_call() [[ATTR3:#.*]] +; CHECK-NEXT: call void @no_return_call() [[ATTR4:#.*]] ; CHECK-NEXT: unreachable ; CHECK: cond.true: ; CHECK-NEXT: unreachable @@ -130,7 +130,7 @@ ; 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: call void @no_return_call() [[ATTR4]] ; CHECK-NEXT: unreachable ; CHECK: cond.false: ; CHECK-NEXT: call void @normal_call() @@ -161,20 +161,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: nofree noreturn nosync nounwind -; CHECK-LABEL: define {{[^@]+}}@all_dead -; CHECK-SAME: (i32 [[A:%.*]]) [[ATTR0]] { -; 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 +; IS________OPM: Function Attrs: nofree noreturn nosync nounwind +; IS________OPM-LABEL: define {{[^@]+}}@all_dead +; IS________OPM-SAME: (i32 [[A:%.*]]) [[ATTR0:#.*]] { +; IS________OPM-NEXT: entry: +; IS________OPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 +; IS________OPM-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; IS________OPM: cond.true: +; IS________OPM-NEXT: call void @no_return_call() [[ATTR3:#.*]] +; IS________OPM-NEXT: unreachable +; IS________OPM: cond.false: +; IS________OPM-NEXT: call void @no_return_call() [[ATTR4:#.*]] +; IS________OPM-NEXT: unreachable +; IS________OPM: cond.end: +; IS________OPM-NEXT: unreachable +; +; NOT_TUNIT_OPM: Function Attrs: nofree noreturn nosync nounwind +; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@all_dead +; NOT_TUNIT_OPM-SAME: (i32 [[A:%.*]]) [[ATTR0:#.*]] { +; NOT_TUNIT_OPM-NEXT: entry: +; NOT_TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 +; NOT_TUNIT_OPM-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; NOT_TUNIT_OPM: cond.true: +; NOT_TUNIT_OPM-NEXT: call void @no_return_call() [[ATTR4:#.*]] +; NOT_TUNIT_OPM-NEXT: unreachable +; NOT_TUNIT_OPM: cond.false: +; NOT_TUNIT_OPM-NEXT: call void @no_return_call() [[ATTR4]] +; NOT_TUNIT_OPM-NEXT: unreachable +; NOT_TUNIT_OPM: cond.end: +; NOT_TUNIT_OPM-NEXT: unreachable ; entry: %cmp = icmp eq i32 %a, 0 @@ -209,7 +224,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]] ; CHECK-NEXT: unreachable ; CHECK: cond.false: ; CHECK-NEXT: call void @normal_call() @@ -300,7 +315,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_nounwind() [[ATTR3]] +; CHECK-NEXT: [[CALL:%.*]] = call i32 @foo_noreturn_nounwind() [[ATTR3:#.*]] ; CHECK-NEXT: unreachable ; CHECK: cond.false: ; CHECK-NEXT: call void @normal_call() @@ -573,16 +588,18 @@ } define void @rec() #0 { -; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@rec -; NOT_CGSCC_NPM-SAME: () [[ATTR10:#.*]] { +; NOT_CGSCC_NPM-SAME: () [[ATTR9]] { ; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: call void @rec() [[ATTR9]] ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; IS__CGSCC____: Function Attrs: nofree noreturn nosync nounwind readnone ; IS__CGSCC____-LABEL: define {{[^@]+}}@rec ; IS__CGSCC____-SAME: () [[ATTR12:#.*]] { ; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: call void @rec() [[ATTR12]] ; IS__CGSCC____-NEXT: unreachable ; entry: @@ -595,9 +612,9 @@ ; and unreachable should be put after call to @rec(). define i32 @test6(i32, i32) #0 { -; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test6 -; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) [[ATTR10]] { +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) [[ATTR9]] { ; NOT_CGSCC_NPM-NEXT: unreachable ; NOT_CGSCC_NPM: cond.if: ; NOT_CGSCC_NPM-NEXT: unreachable @@ -807,22 +824,22 @@ define linkonce_odr void @non_exact1() { ; CHECK-LABEL: define {{[^@]+}}@non_exact1() { -; CHECK-NEXT: call void @non_dead_a0() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_a1() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_a2() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_a3() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_a4() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_a5() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_a6() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_a7() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_a8() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_a9() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_a10() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_a11() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_a12() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_a13() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_a14() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_a15() [[ATTR2]] +; CHECK-NEXT: call void @non_dead_a0() +; CHECK-NEXT: call void @non_dead_a1() +; CHECK-NEXT: call void @non_dead_a2() +; CHECK-NEXT: call void @non_dead_a3() +; CHECK-NEXT: call void @non_dead_a4() +; CHECK-NEXT: call void @non_dead_a5() +; CHECK-NEXT: call void @non_dead_a6() +; CHECK-NEXT: call void @non_dead_a7() +; CHECK-NEXT: call void @non_dead_a8() +; CHECK-NEXT: call void @non_dead_a9() +; CHECK-NEXT: call void @non_dead_a10() +; CHECK-NEXT: call void @non_dead_a11() +; CHECK-NEXT: call void @non_dead_a12() +; CHECK-NEXT: call void @non_dead_a13() +; CHECK-NEXT: call void @non_dead_a14() +; CHECK-NEXT: call void @non_dead_a15() ; CHECK-NEXT: call void @middle() ; CHECK-NEXT: ret void ; @@ -848,28 +865,28 @@ define internal void @middle() { ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@middle() { ; NOT_CGSCC_NPM-NEXT: bb0: -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b0() [[ATTR11:#.*]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b1() [[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b2() [[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b3() [[ATTR11]] +; NOT_CGSCC_NPM-NEXT: call void @non_dead_b0() [[ATTR2:#.*]] +; NOT_CGSCC_NPM-NEXT: call void @non_dead_b1() [[ATTR10:#.*]] +; NOT_CGSCC_NPM-NEXT: call void @non_dead_b2() [[ATTR16:#.*]] +; NOT_CGSCC_NPM-NEXT: call void @non_dead_b3() [[ATTR16]] ; NOT_CGSCC_NPM-NEXT: br label [[BB1:%.*]] ; NOT_CGSCC_NPM: bb1: -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b4() [[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b5() [[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b6() [[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b7() [[ATTR11]] +; NOT_CGSCC_NPM-NEXT: call void @non_dead_b4() [[ATTR16]] +; NOT_CGSCC_NPM-NEXT: call void @non_dead_b5() [[ATTR16]] +; NOT_CGSCC_NPM-NEXT: call void @non_dead_b6() [[ATTR16]] +; NOT_CGSCC_NPM-NEXT: call void @non_dead_b7() [[ATTR16]] ; NOT_CGSCC_NPM-NEXT: br label [[BB2:%.*]] ; NOT_CGSCC_NPM: bb2: -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b8() [[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b9() [[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b10() [[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b11() [[ATTR11]] +; NOT_CGSCC_NPM-NEXT: call void @non_dead_b8() [[ATTR16]] +; NOT_CGSCC_NPM-NEXT: call void @non_dead_b9() [[ATTR16]] +; NOT_CGSCC_NPM-NEXT: call void @non_dead_b10() [[ATTR16]] +; NOT_CGSCC_NPM-NEXT: call void @non_dead_b11() [[ATTR16]] ; NOT_CGSCC_NPM-NEXT: br label [[BB3:%.*]] ; NOT_CGSCC_NPM: bb3: -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b12() [[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b13() [[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b14() [[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b15() [[ATTR11]] +; NOT_CGSCC_NPM-NEXT: call void @non_dead_b12() [[ATTR16]] +; NOT_CGSCC_NPM-NEXT: call void @non_dead_b13() [[ATTR16]] +; NOT_CGSCC_NPM-NEXT: call void @non_dead_b14() [[ATTR16]] +; NOT_CGSCC_NPM-NEXT: call void @non_dead_b15() [[ATTR16]] ; NOT_CGSCC_NPM-NEXT: br label [[BB4:%.*]] ; NOT_CGSCC_NPM: bb4: ; NOT_CGSCC_NPM-NEXT: call void @non_exact2() @@ -877,28 +894,28 @@ ; ; IS__CGSCC____-LABEL: define {{[^@]+}}@middle() { ; IS__CGSCC____-NEXT: bb0: -; IS__CGSCC____-NEXT: call void @non_dead_b0() [[ATTR18]] -; IS__CGSCC____-NEXT: call void @non_dead_b1() [[ATTR18]] -; IS__CGSCC____-NEXT: call void @non_dead_b2() [[ATTR18]] -; IS__CGSCC____-NEXT: call void @non_dead_b3() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @non_dead_b0() [[ATTR19:#.*]] +; IS__CGSCC____-NEXT: call void @non_dead_b1() [[ATTR19]] +; IS__CGSCC____-NEXT: call void @non_dead_b2() [[ATTR19]] +; IS__CGSCC____-NEXT: call void @non_dead_b3() [[ATTR19]] ; IS__CGSCC____-NEXT: br label [[BB1:%.*]] ; IS__CGSCC____: bb1: -; IS__CGSCC____-NEXT: call void @non_dead_b4() [[ATTR18]] -; IS__CGSCC____-NEXT: call void @non_dead_b5() [[ATTR18]] -; IS__CGSCC____-NEXT: call void @non_dead_b6() [[ATTR18]] -; IS__CGSCC____-NEXT: call void @non_dead_b7() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @non_dead_b4() [[ATTR19]] +; IS__CGSCC____-NEXT: call void @non_dead_b5() [[ATTR19]] +; IS__CGSCC____-NEXT: call void @non_dead_b6() [[ATTR19]] +; IS__CGSCC____-NEXT: call void @non_dead_b7() [[ATTR19]] ; IS__CGSCC____-NEXT: br label [[BB2:%.*]] ; IS__CGSCC____: bb2: -; IS__CGSCC____-NEXT: call void @non_dead_b8() [[ATTR18]] -; IS__CGSCC____-NEXT: call void @non_dead_b9() [[ATTR18]] -; IS__CGSCC____-NEXT: call void @non_dead_b10() [[ATTR18]] -; IS__CGSCC____-NEXT: call void @non_dead_b11() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @non_dead_b8() [[ATTR19]] +; IS__CGSCC____-NEXT: call void @non_dead_b9() [[ATTR19]] +; IS__CGSCC____-NEXT: call void @non_dead_b10() [[ATTR19]] +; IS__CGSCC____-NEXT: call void @non_dead_b11() [[ATTR19]] ; IS__CGSCC____-NEXT: br label [[BB3:%.*]] ; IS__CGSCC____: bb3: -; IS__CGSCC____-NEXT: call void @non_dead_b12() [[ATTR18]] -; IS__CGSCC____-NEXT: call void @non_dead_b13() [[ATTR18]] -; IS__CGSCC____-NEXT: call void @non_dead_b14() [[ATTR18]] -; IS__CGSCC____-NEXT: call void @non_dead_b15() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @non_dead_b12() [[ATTR19]] +; IS__CGSCC____-NEXT: call void @non_dead_b13() [[ATTR19]] +; IS__CGSCC____-NEXT: call void @non_dead_b14() [[ATTR19]] +; IS__CGSCC____-NEXT: call void @non_dead_b15() [[ATTR19]] ; IS__CGSCC____-NEXT: br label [[BB4:%.*]] ; IS__CGSCC____: bb4: ; IS__CGSCC____-NEXT: call void @non_exact2() @@ -934,22 +951,22 @@ } define linkonce_odr void @non_exact2() { ; CHECK-LABEL: define {{[^@]+}}@non_exact2() { -; CHECK-NEXT: call void @non_dead_c0() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_c1() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_c2() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_c3() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_c4() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_c5() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_c6() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_c7() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_c8() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_c9() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_c10() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_c11() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_c12() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_c13() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_c14() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_c15() [[ATTR2]] +; CHECK-NEXT: call void @non_dead_c0() +; CHECK-NEXT: call void @non_dead_c1() +; CHECK-NEXT: call void @non_dead_c2() +; CHECK-NEXT: call void @non_dead_c3() +; CHECK-NEXT: call void @non_dead_c4() +; CHECK-NEXT: call void @non_dead_c5() +; CHECK-NEXT: call void @non_dead_c6() +; CHECK-NEXT: call void @non_dead_c7() +; CHECK-NEXT: call void @non_dead_c8() +; CHECK-NEXT: call void @non_dead_c9() +; CHECK-NEXT: call void @non_dead_c10() +; CHECK-NEXT: call void @non_dead_c11() +; CHECK-NEXT: call void @non_dead_c12() +; CHECK-NEXT: call void @non_dead_c13() +; CHECK-NEXT: call void @non_dead_c14() +; CHECK-NEXT: call void @non_dead_c15() ; CHECK-NEXT: call void @non_exact3() ; CHECK-NEXT: ret void ; @@ -974,22 +991,22 @@ } define linkonce_odr void @non_exact3() { ; CHECK-LABEL: define {{[^@]+}}@non_exact3() { -; CHECK-NEXT: call void @non_dead_d0() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_d1() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_d2() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_d3() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_d4() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_d5() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_d6() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_d7() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_d8() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_d9() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_d10() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_d11() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_d12() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_d13() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_d14() [[ATTR2]] -; CHECK-NEXT: call void @non_dead_d15() [[ATTR2]] +; CHECK-NEXT: call void @non_dead_d0() +; CHECK-NEXT: call void @non_dead_d1() +; CHECK-NEXT: call void @non_dead_d2() +; CHECK-NEXT: call void @non_dead_d3() +; CHECK-NEXT: call void @non_dead_d4() +; CHECK-NEXT: call void @non_dead_d5() +; CHECK-NEXT: call void @non_dead_d6() +; CHECK-NEXT: call void @non_dead_d7() +; CHECK-NEXT: call void @non_dead_d8() +; CHECK-NEXT: call void @non_dead_d9() +; CHECK-NEXT: call void @non_dead_d10() +; CHECK-NEXT: call void @non_dead_d11() +; CHECK-NEXT: call void @non_dead_d12() +; CHECK-NEXT: call void @non_dead_d13() +; CHECK-NEXT: call void @non_dead_d14() +; CHECK-NEXT: call void @non_dead_d15() ; CHECK-NEXT: [[NR:%.*]] = call i32 @foo_noreturn() [[ATTR4]] ; CHECK-NEXT: unreachable ; @@ -1015,16 +1032,16 @@ } define internal void @non_dead_a0() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a0 -; NOT_CGSCC_NPM-SAME: () [[ATTR12:#.*]] { +; NOT_CGSCC_NPM-SAME: () [[ATTR10]] { ; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a0 ; IS__CGSCC____-SAME: () [[ATTR15:#.*]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1033,14 +1050,14 @@ define internal void @non_dead_a1() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a1 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11:#.*]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17:#.*]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a1 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1049,14 +1066,14 @@ define internal void @non_dead_a2() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a2 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a2 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1065,14 +1082,14 @@ define internal void @non_dead_a3() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a3 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a3 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1081,14 +1098,14 @@ define internal void @non_dead_a4() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a4 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a4 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1097,14 +1114,14 @@ define internal void @non_dead_a5() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a5 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a5 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1113,14 +1130,14 @@ define internal void @non_dead_a6() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a6 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a6 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1129,14 +1146,14 @@ define internal void @non_dead_a7() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a7 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a7 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1145,14 +1162,14 @@ define internal void @non_dead_a8() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a8 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a8 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1161,14 +1178,14 @@ define internal void @non_dead_a9() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a9 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a9 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1177,14 +1194,14 @@ define internal void @non_dead_a10() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a10 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a10 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1193,14 +1210,14 @@ define internal void @non_dead_a11() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a11 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a11 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1209,14 +1226,14 @@ define internal void @non_dead_a12() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a12 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a12 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1225,14 +1242,14 @@ define internal void @non_dead_a13() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a13 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a13 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1241,14 +1258,14 @@ define internal void @non_dead_a14() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a14 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a14 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1257,14 +1274,14 @@ define internal void @non_dead_a15() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a15 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a15 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1273,14 +1290,14 @@ define internal void @non_dead_b0() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b0 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b0 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1289,14 +1306,14 @@ define internal void @non_dead_b1() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b1 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b1 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1305,14 +1322,14 @@ define internal void @non_dead_b2() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b2 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b2 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1321,14 +1338,14 @@ define internal void @non_dead_b3() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b3 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b3 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1337,14 +1354,14 @@ define internal void @non_dead_b4() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b4 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b4 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1353,14 +1370,14 @@ define internal void @non_dead_b5() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b5 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b5 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1369,14 +1386,14 @@ define internal void @non_dead_b6() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b6 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b6 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1385,14 +1402,14 @@ define internal void @non_dead_b7() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b7 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b7 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1401,14 +1418,14 @@ define internal void @non_dead_b8() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b8 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b8 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1417,14 +1434,14 @@ define internal void @non_dead_b9() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b9 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b9 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1433,14 +1450,14 @@ define internal void @non_dead_b10() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b10 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b10 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1449,14 +1466,14 @@ define internal void @non_dead_b11() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b11 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b11 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1465,14 +1482,14 @@ define internal void @non_dead_b12() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b12 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b12 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1481,14 +1498,14 @@ define internal void @non_dead_b13() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b13 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b13 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1497,14 +1514,14 @@ define internal void @non_dead_b14() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b14 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b14 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1513,30 +1530,30 @@ define internal void @non_dead_b15() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b15 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b15 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c0() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c0 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { +; NOT_CGSCC_NPM-SAME: () [[ATTR10]] { ; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c0 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1545,14 +1562,14 @@ define internal void @non_dead_c1() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c1 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c1 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1561,14 +1578,14 @@ define internal void @non_dead_c2() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c2 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c2 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1577,14 +1594,14 @@ define internal void @non_dead_c3() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c3 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c3 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1593,14 +1610,14 @@ define internal void @non_dead_c4() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c4 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c4 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1609,14 +1626,14 @@ define internal void @non_dead_c5() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c5 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c5 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1625,14 +1642,14 @@ define internal void @non_dead_c6() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c6 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c6 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1641,14 +1658,14 @@ define internal void @non_dead_c7() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c7 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c7 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1657,14 +1674,14 @@ define internal void @non_dead_c8() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c8 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c8 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1673,14 +1690,14 @@ define internal void @non_dead_c9() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c9 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c9 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1689,14 +1706,14 @@ define internal void @non_dead_c10() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c10 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c10 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1705,14 +1722,14 @@ define internal void @non_dead_c11() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c11 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c11 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1721,14 +1738,14 @@ define internal void @non_dead_c12() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c12 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c12 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1737,14 +1754,14 @@ define internal void @non_dead_c13() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c13 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c13 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1753,14 +1770,14 @@ define internal void @non_dead_c14() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c14 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c14 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1769,30 +1786,30 @@ define internal void @non_dead_c15() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c15 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c15 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d0() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d0 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { +; NOT_CGSCC_NPM-SAME: () [[ATTR10]] { ; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d0 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1801,14 +1818,14 @@ define internal void @non_dead_d1() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d1 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d1 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1817,14 +1834,14 @@ define internal void @non_dead_d2() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d2 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d2 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1833,14 +1850,14 @@ define internal void @non_dead_d3() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d3 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d3 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1849,14 +1866,14 @@ define internal void @non_dead_d4() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d4 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d4 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1865,14 +1882,14 @@ define internal void @non_dead_d5() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d5 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d5 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1881,14 +1898,14 @@ define internal void @non_dead_d6() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d6 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d6 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1897,14 +1914,14 @@ define internal void @non_dead_d7() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d7 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d7 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1913,14 +1930,14 @@ define internal void @non_dead_d8() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d8 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d8 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1929,14 +1946,14 @@ define internal void @non_dead_d9() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d9 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d9 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1945,14 +1962,14 @@ define internal void @non_dead_d10() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d10 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d10 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1961,14 +1978,14 @@ define internal void @non_dead_d11() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d11 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d11 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1977,14 +1994,14 @@ define internal void @non_dead_d12() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d12 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d12 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -1993,14 +2010,14 @@ define internal void @non_dead_d13() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d13 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d13 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -2009,14 +2026,14 @@ define internal void @non_dead_d14() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d14 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d14 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -2025,14 +2042,14 @@ define internal void @non_dead_d15() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d15 -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] +; NOT_CGSCC_NPM-SAME: () [[ATTR11]] { +; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR17]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d15 ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -2095,16 +2112,16 @@ } define internal void @useless_arg_sink(i32* %a) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@useless_arg_sink -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { +; NOT_CGSCC_NPM-SAME: () [[ATTR10]] { ; NOT_CGSCC_NPM-NEXT: call void @sink() [[ATTR15]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@useless_arg_sink ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @sink() @@ -2112,16 +2129,16 @@ } define internal void @useless_arg_almost_sink(i32* %a) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@useless_arg_almost_sink -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: call void @useless_arg_sink() [[ATTR11]] +; NOT_CGSCC_NPM-SAME: () [[ATTR10]] { +; NOT_CGSCC_NPM-NEXT: call void @useless_arg_sink() [[ATTR10]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@useless_arg_almost_sink ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: call void @useless_arg_sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @useless_arg_sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret void ; call void @useless_arg_sink(i32* %a) @@ -2130,10 +2147,15 @@ ; Check we do not annotate the function interface of this weak function. define weak_odr void @useless_arg_ext(i32* %a) { -; CHECK-LABEL: define {{[^@]+}}@useless_arg_ext -; CHECK-SAME: (i32* [[A:%.*]]) { -; CHECK-NEXT: call void @useless_arg_almost_sink() [[ATTR2]] -; CHECK-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@useless_arg_ext +; NOT_CGSCC_NPM-SAME: (i32* [[A:%.*]]) { +; NOT_CGSCC_NPM-NEXT: call void @useless_arg_almost_sink() +; NOT_CGSCC_NPM-NEXT: ret void +; +; IS__CGSCC____-LABEL: define {{[^@]+}}@useless_arg_ext +; IS__CGSCC____-SAME: (i32* [[A:%.*]]) { +; IS__CGSCC____-NEXT: call void @useless_arg_almost_sink() [[ATTR20:#.*]] +; IS__CGSCC____-NEXT: ret void ; call void @useless_arg_almost_sink(i32* %a) ret void @@ -2162,9 +2184,9 @@ ; FIXME: We should fold terminators. define internal i32 @switch_default(i64 %i) nounwind { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@switch_default -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { +; NOT_CGSCC_NPM-SAME: () [[ATTR10]] { ; NOT_CGSCC_NPM-NEXT: entry: ; NOT_CGSCC_NPM-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ ; NOT_CGSCC_NPM-NEXT: i64 3, label [[RETURN:%.*]] @@ -2185,7 +2207,7 @@ ; IS__CGSCC____-NEXT: i64 10, label [[RETURN]] ; IS__CGSCC____-NEXT: ] ; IS__CGSCC____: sw.default: -; IS__CGSCC____-NEXT: call void @sink() [[ATTR18]] +; IS__CGSCC____-NEXT: call void @sink() [[ATTR19]] ; IS__CGSCC____-NEXT: ret i32 undef ; IS__CGSCC____: return: ; IS__CGSCC____-NEXT: unreachable @@ -2205,16 +2227,16 @@ } define i32 @switch_default_caller() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@switch_default_caller -; NOT_CGSCC_NPM-SAME: () [[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: [[CALL2:%.*]] = tail call i32 @switch_default() [[ATTR11]] +; NOT_CGSCC_NPM-SAME: () [[ATTR10]] { +; NOT_CGSCC_NPM-NEXT: [[CALL2:%.*]] = tail call i32 @switch_default() [[ATTR10]] ; NOT_CGSCC_NPM-NEXT: ret i32 123 ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@switch_default_caller ; IS__CGSCC____-SAME: () [[ATTR15]] { -; IS__CGSCC____-NEXT: [[CALL2:%.*]] = tail call i32 @switch_default() [[ATTR18]] +; IS__CGSCC____-NEXT: [[CALL2:%.*]] = tail call i32 @switch_default() [[ATTR19]] ; IS__CGSCC____-NEXT: ret i32 123 ; %call2 = tail call i32 @switch_default(i64 0) @@ -2249,9 +2271,9 @@ } define i32 @switch_default_dead_caller() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@switch_default_dead_caller -; NOT_CGSCC_NPM-SAME: () [[ATTR13:#.*]] { +; NOT_CGSCC_NPM-SAME: () [[ATTR12:#.*]] { ; NOT_CGSCC_NPM-NEXT: ret i32 123 ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -2492,7 +2514,7 @@ define i32 @h(i32 %i) { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@h -; NOT_CGSCC_NPM-SAME: (i32 [[I:%.*]]) [[ATTR13]] { +; NOT_CGSCC_NPM-SAME: (i32 [[I:%.*]]) [[ATTR13:#.*]] { ; NOT_CGSCC_NPM-NEXT: ret i32 0 ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -2515,7 +2537,7 @@ ; 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]]) [[ATTR16:#.*]] +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) [[ATTR15]] ; NOT_CGSCC_NPM-NEXT: br label [[EXIT:%.*]] ; NOT_CGSCC_NPM: while.body: ; NOT_CGSCC_NPM-NEXT: unreachable @@ -2524,7 +2546,7 @@ ; 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]]) [[ATTR16]] +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) [[ATTR15]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress @@ -2533,7 +2555,7 @@ ; 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]]) [[ATTR19:#.*]] +; IS__CGSCC____-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) [[ATTR18]] ; IS__CGSCC____-NEXT: br label [[EXIT:%.*]] ; IS__CGSCC____: while.body: ; IS__CGSCC____-NEXT: unreachable @@ -2542,7 +2564,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]]) [[ATTR19]] +; 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: 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 @@ -279,10 +279,10 @@ ; CHECK-NEXT: [[C1:%.*]] = icmp ne i32 [[I]], -42 ; CHECK-NEXT: br i1 [[C1]], label [[EXIT2:%.*]], label [[EXIT]] ; CHECK: cont: -; CHECK-NEXT: call void @dummy(i1 [[F]]) [[ATTR2:#.*]] +; CHECK-NEXT: call void @dummy(i1 [[F]]) ; CHECK-NEXT: br label [[EXIT2]] ; CHECK: do: -; CHECK-NEXT: call void @dummy(i1 [[F]]) [[ATTR2]] +; CHECK-NEXT: call void @dummy(i1 [[F]]) ; CHECK-NEXT: [[CONSUME:%.*]] = call i32 @exit() ; CHECK-NEXT: call void @llvm.assume(i1 noundef [[F]]) ; CHECK-NEXT: [[COND:%.*]] = icmp eq i1 [[F]], false 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 @@ -13,7 +13,7 @@ define dso_local i8* @internal_only(i32 %arg) { ; CHECK: Function Attrs: inaccessiblememonly ; CHECK-LABEL: define {{[^@]+}}@internal_only -; CHECK-SAME: (i32 [[ARG:%.*]]) [[ATTR0:#.*]] { +; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64 ; CHECK-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) @@ -28,7 +28,7 @@ define dso_local i8* @internal_only_rec(i32 %arg) { ; CHECK: Function Attrs: inaccessiblememonly ; CHECK-LABEL: define {{[^@]+}}@internal_only_rec -; CHECK-SAME: (i32 [[ARG:%.*]]) [[ATTR0]] { +; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[REM:%.*]] = srem i32 [[ARG]], 2 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[REM]], 1 @@ -68,7 +68,7 @@ define dso_local i8* @internal_only_rec_static_helper(i32 %arg) { ; CHECK: Function Attrs: inaccessiblememonly ; CHECK-LABEL: define {{[^@]+}}@internal_only_rec_static_helper -; CHECK-SAME: (i32 [[ARG:%.*]]) [[ATTR0]] { +; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CALL:%.*]] = call noalias i8* @internal_only_rec_static(i32 [[ARG]]) ; CHECK-NEXT: ret i8* [[CALL]] @@ -81,7 +81,7 @@ define internal i8* @internal_only_rec_static(i32 %arg) { ; CHECK: Function Attrs: inaccessiblememonly ; CHECK-LABEL: define {{[^@]+}}@internal_only_rec_static -; CHECK-SAME: (i32 [[ARG:%.*]]) [[ATTR0]] { +; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[REM:%.*]] = srem i32 [[ARG]], 2 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[REM]], 1 @@ -176,7 +176,7 @@ define dso_local i8* @internal_argmem_only_read(i32* %arg) { ; CHECK: Function Attrs: inaccessiblemem_or_argmemonly ; CHECK-LABEL: define {{[^@]+}}@internal_argmem_only_read -; CHECK-SAME: (i32* nocapture nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) [[ATTR1:#.*]] { +; CHECK-SAME: (i32* nocapture nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP:%.*]] = load i32, i32* [[ARG]], align 4 ; CHECK-NEXT: [[CONV:%.*]] = sext i32 [[TMP]] to i64 @@ -193,7 +193,7 @@ define dso_local i8* @internal_argmem_only_write(i32* %arg) { ; CHECK: Function Attrs: inaccessiblemem_or_argmemonly ; CHECK-LABEL: define {{[^@]+}}@internal_argmem_only_write -; CHECK-SAME: (i32* nocapture nonnull writeonly align 4 dereferenceable(4) [[ARG:%.*]]) [[ATTR1]] { +; CHECK-SAME: (i32* nocapture nonnull writeonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: store i32 10, i32* [[ARG]], align 4 ; CHECK-NEXT: [[CALL:%.*]] = call noalias dereferenceable_or_null(10) i8* @malloc(i64 noundef 10) @@ -208,14 +208,14 @@ define dso_local i8* @internal_argmem_only_rec(i32* %arg) { ; IS__TUNIT____: Function Attrs: inaccessiblemem_or_argmemonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@internal_argmem_only_rec -; IS__TUNIT____-SAME: (i32* nocapture [[ARG:%.*]]) [[ATTR1:#.*]] { +; IS__TUNIT____-SAME: (i32* nocapture [[ARG:%.*]]) #[[ATTR1]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[CALL:%.*]] = call noalias i8* @internal_argmem_only_rec_1(i32* nocapture align 4 [[ARG]]) ; IS__TUNIT____-NEXT: ret i8* [[CALL]] ; ; IS__CGSCC____: Function Attrs: inaccessiblemem_or_argmemonly ; IS__CGSCC____-LABEL: define {{[^@]+}}@internal_argmem_only_rec -; IS__CGSCC____-SAME: (i32* nocapture nonnull align 4 dereferenceable(4) [[ARG:%.*]]) [[ATTR1:#.*]] { +; IS__CGSCC____-SAME: (i32* nocapture nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: [[CALL:%.*]] = call noalias i8* @internal_argmem_only_rec_1(i32* nocapture nonnull align 4 dereferenceable(4) [[ARG]]) ; IS__CGSCC____-NEXT: ret i8* [[CALL]] @@ -228,7 +228,7 @@ define internal i8* @internal_argmem_only_rec_1(i32* %arg) { ; CHECK: Function Attrs: inaccessiblemem_or_argmemonly ; CHECK-LABEL: define {{[^@]+}}@internal_argmem_only_rec_1 -; CHECK-SAME: (i32* nocapture nonnull align 4 dereferenceable(4) [[ARG:%.*]]) [[ATTR1]] { +; CHECK-SAME: (i32* nocapture nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP:%.*]] = load i32, i32* [[ARG]], align 4 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP]], 0 @@ -284,7 +284,7 @@ define internal i8* @internal_argmem_only_rec_2(i32* %arg) { ; CHECK: Function Attrs: inaccessiblemem_or_argmemonly ; CHECK-LABEL: define {{[^@]+}}@internal_argmem_only_rec_2 -; CHECK-SAME: (i32* nocapture nonnull align 4 dereferenceable(4) [[ARG:%.*]]) [[ATTR1]] { +; CHECK-SAME: (i32* nocapture nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: store i32 0, i32* [[ARG]], align 4 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 -1 @@ -306,7 +306,7 @@ define void @callerA1(i8* %arg) { ; CHECK: Function Attrs: argmemonly ; CHECK-LABEL: define {{[^@]+}}@callerA1 -; CHECK-SAME: (i8* [[ARG:%.*]]) [[ATTR3:#.*]] { +; CHECK-SAME: (i8* [[ARG:%.*]]) #[[ATTR3:[0-9]+]] { ; CHECK-NEXT: [[TMP1:%.*]] = call i8* @argmem_only(i8* [[ARG]]) ; CHECK-NEXT: ret void ; @@ -316,7 +316,7 @@ define void @callerA2(i8* %arg) { ; CHECK: Function Attrs: inaccessiblemem_or_argmemonly ; CHECK-LABEL: define {{[^@]+}}@callerA2 -; CHECK-SAME: (i8* [[ARG:%.*]]) [[ATTR1]] { +; CHECK-SAME: (i8* [[ARG:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: [[TMP1:%.*]] = call i8* @inaccesible_argmem_only_decl(i8* [[ARG]]) ; CHECK-NEXT: ret void ; @@ -326,7 +326,7 @@ define void @callerB1() { ; CHECK: Function Attrs: readnone ; CHECK-LABEL: define {{[^@]+}}@callerB1 -; CHECK-SAME: () [[ATTR2:#.*]] { +; CHECK-SAME: () #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: [[STACK:%.*]] = alloca i8, align 1 ; CHECK-NEXT: [[TMP1:%.*]] = call i8* @argmem_only(i8* noundef nonnull dereferenceable(1) [[STACK]]) ; CHECK-NEXT: ret void @@ -338,7 +338,7 @@ define void @callerB2() { ; CHECK: Function Attrs: inaccessiblememonly ; CHECK-LABEL: define {{[^@]+}}@callerB2 -; CHECK-SAME: () [[ATTR0]] { +; CHECK-SAME: () #[[ATTR0]] { ; CHECK-NEXT: [[STACK:%.*]] = alloca i8, align 1 ; CHECK-NEXT: [[TMP1:%.*]] = call i8* @inaccesible_argmem_only_decl(i8* noundef nonnull dereferenceable(1) [[STACK]]) ; CHECK-NEXT: ret void @@ -391,12 +391,12 @@ define void @callerE(i8* %arg) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@callerE -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) [[ATTR5:#.*]] { +; 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 mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@callerE -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) [[ATTR5:#.*]] { +; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { ; IS__CGSCC____-NEXT: ret void ; call void @llvm.lifetime.start.p0i8(i64 4, i8* %arg) @@ -407,13 +407,13 @@ define void @write_global() { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@write_global -; IS__TUNIT____-SAME: () [[ATTR6:#.*]] { +; 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 mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@write_global -; IS__CGSCC____-SAME: () [[ATTR6:#.*]] { +; IS__CGSCC____-SAME: () #[[ATTR6:[0-9]+]] { ; IS__CGSCC____-NEXT: store i32 0, i32* @G, align 4 ; IS__CGSCC____-NEXT: ret void ; @@ -423,13 +423,13 @@ define void @write_global_via_arg(i32* %GPtr) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@write_global_via_arg -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[GPTR:%.*]]) [[ATTR7:#.*]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree 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 mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@write_global_via_arg -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[GPTR:%.*]]) [[ATTR7:#.*]] { +; IS__CGSCC____-SAME: (i32* nocapture nofree 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 ; @@ -439,13 +439,13 @@ define internal void @write_global_via_arg_internal(i32* %GPtr) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@write_global_via_arg_internal -; IS__TUNIT____-SAME: () [[ATTR6]] { +; 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 mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@write_global_via_arg_internal -; IS__CGSCC____-SAME: () [[ATTR6]] { +; IS__CGSCC____-SAME: () #[[ATTR6]] { ; IS__CGSCC____-NEXT: store i32 0, i32* @G, align 4 ; IS__CGSCC____-NEXT: ret void ; @@ -454,32 +454,32 @@ } define void @writeonly_global() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@writeonly_global -; IS__TUNIT____-SAME: () [[ATTR6]] { -; IS__TUNIT____-NEXT: call void @write_global() [[ATTR10:#.*]] +; IS__TUNIT____-SAME: () #[[ATTR8:[0-9]+]] { +; IS__TUNIT____-NEXT: call void @write_global() #[[ATTR8]] ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@writeonly_global -; IS__CGSCC____-SAME: () [[ATTR6]] { -; IS__CGSCC____-NEXT: call void @write_global() [[ATTR10:#.*]] +; IS__CGSCC____-SAME: () #[[ATTR6]] { +; IS__CGSCC____-NEXT: call void @write_global() #[[ATTR10:[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 mustprogress +; IS__TUNIT____: Function Attrs: nofree 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) [[ATTR10]] +; IS__TUNIT____-SAME: () #[[ATTR8]] { +; IS__TUNIT____-NEXT: call void @write_global_via_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR8]] ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly mustprogress ; 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) [[ATTR10]] +; IS__CGSCC____-SAME: () #[[ATTR6]] { +; IS__CGSCC____-NEXT: call void @write_global_via_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR10]] ; IS__CGSCC____-NEXT: ret void ; call void @write_global_via_arg(i32* @G) @@ -488,16 +488,16 @@ define void @writeonly_global_via_arg_internal() { ; -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly mustprogress +; IS__TUNIT____: Function Attrs: nofree 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() [[ATTR10]] +; IS__TUNIT____-SAME: () #[[ATTR8]] { +; IS__TUNIT____-NEXT: call void @write_global_via_arg_internal() #[[ATTR8]] ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@writeonly_global_via_arg_internal -; IS__CGSCC____-SAME: () [[ATTR6]] { -; IS__CGSCC____-NEXT: call void @write_global_via_arg_internal() [[ATTR10]] +; IS__CGSCC____-SAME: () #[[ATTR6]] { +; IS__CGSCC____-NEXT: call void @write_global_via_arg_internal() #[[ATTR10]] ; IS__CGSCC____-NEXT: ret void ; call void @write_global_via_arg_internal(i32* @G) @@ -505,18 +505,31 @@ } define i8 @recursive_not_readnone(i8* %ptr, i1 %c) { -; CHECK: Function Attrs: argmemonly nofree nosync nounwind -; CHECK-LABEL: define {{[^@]+}}@recursive_not_readnone -; CHECK-SAME: (i8* nocapture nofree writeonly [[PTR:%.*]], i1 [[C:%.*]]) [[ATTR8:#.*]] { -; CHECK-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 -; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; CHECK: t: -; CHECK-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) [[ATTR11:#.*]] -; CHECK-NEXT: [[R:%.*]] = load i8, i8* [[ALLOC]], align 1 -; CHECK-NEXT: ret i8 [[R]] -; CHECK: f: -; CHECK-NEXT: store i8 1, i8* [[PTR]], align 1 -; CHECK-NEXT: ret i8 0 +; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind +; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_not_readnone +; IS__TUNIT____-SAME: (i8* nocapture nofree writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { +; 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) #[[ATTR11:[0-9]+]] +; IS__TUNIT____-NEXT: [[R:%.*]] = load i8, i8* [[ALLOC]], align 1 +; IS__TUNIT____-NEXT: ret i8 [[R]] +; IS__TUNIT____: f: +; IS__TUNIT____-NEXT: store i8 1, i8* [[PTR]], align 1 +; IS__TUNIT____-NEXT: ret i8 0 +; +; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind +; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_not_readnone +; IS__CGSCC____-SAME: (i8* nocapture nofree writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8:[0-9]+]] { +; 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) #[[ATTR11:[0-9]+]] +; IS__CGSCC____-NEXT: [[R:%.*]] = load i8, i8* [[ALLOC]], align 1 +; IS__CGSCC____-NEXT: ret i8 [[R]] +; IS__CGSCC____: f: +; IS__CGSCC____-NEXT: store i8 1, i8* [[PTR]], align 1 +; IS__CGSCC____-NEXT: ret i8 0 ; %alloc = alloca i8 br i1 %c, label %t, label %f @@ -530,18 +543,31 @@ } define internal i8 @recursive_not_readnone_internal(i8* %ptr, i1 %c) { -; CHECK: Function Attrs: argmemonly nofree nosync nounwind -; CHECK-LABEL: define {{[^@]+}}@recursive_not_readnone_internal -; CHECK-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) [[ATTR8]] { -; CHECK-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 -; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; CHECK: t: -; CHECK-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) [[ATTR11]] -; CHECK-NEXT: [[R:%.*]] = load i8, i8* [[ALLOC]], align 1 -; CHECK-NEXT: ret i8 [[R]] -; CHECK: f: -; CHECK-NEXT: store i8 1, i8* [[PTR]], align 1 -; CHECK-NEXT: ret i8 0 +; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind +; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_not_readnone_internal +; IS__TUNIT____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR9]] { +; 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) #[[ATTR11]] +; IS__TUNIT____-NEXT: [[R:%.*]] = load i8, i8* [[ALLOC]], align 1 +; IS__TUNIT____-NEXT: ret i8 [[R]] +; IS__TUNIT____: f: +; IS__TUNIT____-NEXT: store i8 1, i8* [[PTR]], align 1 +; IS__TUNIT____-NEXT: ret i8 0 +; +; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind +; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_not_readnone_internal +; IS__CGSCC____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; IS__CGSCC____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC____: t: +; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]] +; IS__CGSCC____-NEXT: [[R:%.*]] = load i8, i8* [[ALLOC]], align 1 +; IS__CGSCC____-NEXT: ret i8 [[R]] +; IS__CGSCC____: f: +; IS__CGSCC____-NEXT: store i8 1, i8* [[PTR]], align 1 +; IS__CGSCC____-NEXT: ret i8 0 ; %alloc = alloca i8 br i1 %c, label %t, label %f @@ -557,16 +583,16 @@ define i8 @readnone_caller(i1 %c) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@readnone_caller -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR9:#.*]] { +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR10:[0-9]+]] { ; IS__TUNIT____-NEXT: [[A:%.*]] = alloca i8, align 1 -; IS__TUNIT____-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 [[C]]) [[ATTR11:#.*]] +; IS__TUNIT____-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 [[C]]) #[[ATTR11]] ; IS__TUNIT____-NEXT: ret i8 [[R]] ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone ; IS__CGSCC____-LABEL: define {{[^@]+}}@readnone_caller -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) [[ATTR9:#.*]] { +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { ; IS__CGSCC____-NEXT: [[A:%.*]] = alloca i8, align 1 -; IS__CGSCC____-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 [[C]]) [[ATTR12:#.*]] +; IS__CGSCC____-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 [[C]]) #[[ATTR12:[0-9]+]] ; IS__CGSCC____-NEXT: ret i8 [[R]] ; %a = alloca i8 @@ -575,18 +601,31 @@ } define internal i8 @recursive_not_readnone_internal2(i8* %ptr, i1 %c) { -; CHECK: Function Attrs: argmemonly nofree nosync nounwind -; CHECK-LABEL: define {{[^@]+}}@recursive_not_readnone_internal2 -; CHECK-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) [[ATTR8]] { -; CHECK-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 -; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; CHECK: t: -; CHECK-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal2(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) [[ATTR11]] -; CHECK-NEXT: [[R:%.*]] = load i8, i8* [[ALLOC]], align 1 -; CHECK-NEXT: ret i8 [[R]] -; CHECK: f: -; CHECK-NEXT: store i8 1, i8* [[PTR]], align 1 -; CHECK-NEXT: ret i8 0 +; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind +; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_not_readnone_internal2 +; IS__TUNIT____-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR9]] { +; 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_internal2(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]] +; IS__TUNIT____-NEXT: [[R:%.*]] = load i8, i8* [[ALLOC]], align 1 +; IS__TUNIT____-NEXT: ret i8 [[R]] +; IS__TUNIT____: f: +; IS__TUNIT____-NEXT: store i8 1, i8* [[PTR]], align 1 +; IS__TUNIT____-NEXT: ret i8 0 +; +; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind +; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_not_readnone_internal2 +; IS__CGSCC____-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; IS__CGSCC____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC____: t: +; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal2(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]] +; IS__CGSCC____-NEXT: [[R:%.*]] = load i8, i8* [[ALLOC]], align 1 +; IS__CGSCC____-NEXT: ret i8 [[R]] +; IS__CGSCC____: f: +; IS__CGSCC____-NEXT: store i8 1, i8* [[PTR]], align 1 +; IS__CGSCC____-NEXT: ret i8 0 ; %alloc = alloca i8 br i1 %c, label %t, label %f @@ -602,14 +641,14 @@ define i8 @readnone_caller2(i1 %c) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@readnone_caller2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR9]] { -; IS__TUNIT____-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal2(i8* undef, i1 [[C]]) [[ATTR11]] +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR10]] { +; IS__TUNIT____-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR11]] ; IS__TUNIT____-NEXT: ret i8 [[R]] ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone ; IS__CGSCC____-LABEL: define {{[^@]+}}@readnone_caller2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) [[ATTR9]] { -; IS__CGSCC____-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal2(i8* undef, i1 [[C]]) [[ATTR12]] +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { +; IS__CGSCC____-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR12]] ; IS__CGSCC____-NEXT: ret i8 [[R]] ; %r = call i8 @recursive_not_readnone_internal2(i8* undef, i1 %c) @@ -619,13 +658,13 @@ define internal void @argmemonly_before_ipconstprop(i32* %p) argmemonly { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@argmemonly_before_ipconstprop -; IS__TUNIT____-SAME: () [[ATTR6]] { +; 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 mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@argmemonly_before_ipconstprop -; IS__CGSCC____-SAME: () [[ATTR6]] { +; IS__CGSCC____-SAME: () #[[ATTR6]] { ; IS__CGSCC____-NEXT: store i32 0, i32* @G, align 4 ; IS__CGSCC____-NEXT: ret void ; @@ -634,16 +673,16 @@ } define void @argmemonky_caller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly mustprogress +; 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() [[ATTR10]] +; IS__TUNIT____-SAME: () #[[ATTR8]] { +; IS__TUNIT____-NEXT: call void @argmemonly_before_ipconstprop() #[[ATTR8]] ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@argmemonky_caller -; IS__CGSCC____-SAME: () [[ATTR6]] { -; IS__CGSCC____-NEXT: call void @argmemonly_before_ipconstprop() [[ATTR10]] +; IS__CGSCC____-SAME: () #[[ATTR6]] { +; IS__CGSCC____-NEXT: call void @argmemonly_before_ipconstprop() #[[ATTR10]] ; IS__CGSCC____-NEXT: ret void ; call void @argmemonly_before_ipconstprop(i32* @G) 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 @@ -19,10 +19,10 @@ } define i32* @func1() { -; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn ; CHECK-LABEL: define {{[^@]+}}@func1 -; CHECK-SAME: () [[ATTR0]] { -; CHECK-NEXT: [[PTR:%.*]] = call i32* @func1a() [[ATTR2:#.*]] +; CHECK-SAME: () [[ATTR1:#.*]] { +; CHECK-NEXT: [[PTR:%.*]] = call i32* @func1a() [[ATTR1]] ; CHECK-NEXT: ret i32* [[PTR]] ; %ptr = call i32* @func1a([1 x i32]* @var1) @@ -41,7 +41,7 @@ define internal void @func2a(i32* %0) { ; CHECK: Function Attrs: nofree nosync nounwind willreturn writeonly mustprogress ; CHECK-LABEL: define {{[^@]+}}@func2a -; CHECK-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]]) [[ATTR1:#.*]] { +; CHECK-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]]) [[ATTR2:#.*]] { ; CHECK-NEXT: store i32 0, i32* @var2, align 4 ; CHECK-NEXT: ret void ; diff --git a/llvm/test/Transforms/Attributor/mustprogress.ll b/llvm/test/Transforms/Attributor/mustprogress.ll --- a/llvm/test/Transforms/Attributor/mustprogress.ll +++ b/llvm/test/Transforms/Attributor/mustprogress.ll @@ -9,16 +9,27 @@ declare void @sink() nounwind willreturn nosync nofree define internal void @callee(i1 %a) { -; CHECK: Function Attrs: nofree nosync nounwind mustprogress -; CHECK-LABEL: define {{[^@]+}}@callee -; CHECK-SAME: (i1 [[A:%.*]]) [[ATTR1:#.*]] { -; CHECK-NEXT: call void @sink() [[ATTR2:#.*]] -; CHECK-NEXT: br i1 [[A]], label [[T:%.*]], label [[F:%.*]] -; CHECK: t: -; CHECK-NEXT: call void @callee(i1 noundef false) [[ATTR1]] -; CHECK-NEXT: br label [[F]] -; CHECK: f: -; CHECK-NEXT: ret void +; IS__TUNIT____: Function Attrs: nofree nosync nounwind mustprogress +; IS__TUNIT____-LABEL: define {{[^@]+}}@callee +; IS__TUNIT____-SAME: (i1 [[A:%.*]]) [[ATTR1:#.*]] { +; IS__TUNIT____-NEXT: call void @sink() [[ATTR5:#.*]] +; IS__TUNIT____-NEXT: br i1 [[A]], label [[T:%.*]], label [[F:%.*]] +; IS__TUNIT____: t: +; IS__TUNIT____-NEXT: call void @callee(i1 noundef false) [[ATTR1]] +; IS__TUNIT____-NEXT: br label [[F]] +; IS__TUNIT____: f: +; IS__TUNIT____-NEXT: ret void +; +; IS__CGSCC____: Function Attrs: nofree nosync nounwind mustprogress +; IS__CGSCC____-LABEL: define {{[^@]+}}@callee +; IS__CGSCC____-SAME: (i1 [[A:%.*]]) [[ATTR1:#.*]] { +; IS__CGSCC____-NEXT: call void @sink() [[ATTR6:#.*]] +; IS__CGSCC____-NEXT: br i1 [[A]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC____: t: +; IS__CGSCC____-NEXT: call void @callee(i1 noundef false) [[ATTR1]] +; IS__CGSCC____-NEXT: br label [[F]] +; IS__CGSCC____: f: +; IS__CGSCC____-NEXT: ret void ; call void @sink() br i1 %a, label %t, label %f @@ -32,16 +43,91 @@ define void @caller(i1 %a) mustprogress { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@caller -; IS__TUNIT____-SAME: (i1 [[A:%.*]]) [[ATTR1:#.*]] { +; IS__TUNIT____-SAME: (i1 [[A:%.*]]) [[ATTR1]] { ; IS__TUNIT____-NEXT: call void @callee(i1 [[A]]) [[ATTR1]] ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@caller -; IS__CGSCC____-SAME: (i1 [[A:%.*]]) [[ATTR1:#.*]] { -; IS__CGSCC____-NEXT: call void @callee(i1 [[A]]) [[ATTR3:#.*]] +; IS__CGSCC____-SAME: (i1 [[A:%.*]]) [[ATTR1]] { +; IS__CGSCC____-NEXT: call void @callee(i1 [[A]]) [[ATTR7:#.*]] ; IS__CGSCC____-NEXT: ret void ; call void @callee(i1 %a) ret void } + +define void @willreturn_recursion_1() { +; CHECK: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@willreturn_recursion_1 +; CHECK-SAME: () [[ATTR2:#.*]] { +; CHECK-NEXT: tail call void @willreturn_recursion_1() [[ATTR2]] +; CHECK-NEXT: unreachable +; + tail call void @willreturn_recursion_1() willreturn + ret void +} + +define void @willreturn_recursion_2() willreturn { +; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____-LABEL: define {{[^@]+}}@willreturn_recursion_2 +; IS__TUNIT____-SAME: () [[ATTR3:#.*]] { +; IS__TUNIT____-NEXT: unreachable +; +; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn mustprogress +; IS__CGSCC____-LABEL: define {{[^@]+}}@willreturn_recursion_2 +; IS__CGSCC____-SAME: () [[ATTR3:#.*]] { +; IS__CGSCC____-NEXT: unreachable +; + tail call void @willreturn_recursion_2() + ret void +} + +define void @mustprogress_recursion_1() { +; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@mustprogress_recursion_1 +; IS__TUNIT____-SAME: () [[ATTR2:#.*]] { +; IS__TUNIT____-NEXT: unreachable +; +; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@mustprogress_recursion_1 +; IS__CGSCC____-SAME: () [[ATTR4:#.*]] { +; IS__CGSCC____-NEXT: unreachable +; + tail call void @mustprogress_recursion_1() mustprogress + ret void +} + +define void @mustprogress_recursion_2() mustprogress { +; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____-LABEL: define {{[^@]+}}@mustprogress_recursion_2 +; IS__TUNIT____-SAME: () [[ATTR3]] { +; IS__TUNIT____-NEXT: unreachable +; +; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn mustprogress +; IS__CGSCC____-LABEL: define {{[^@]+}}@mustprogress_recursion_2 +; IS__CGSCC____-SAME: () [[ATTR3]] { +; IS__CGSCC____-NEXT: unreachable +; + tail call void @mustprogress_recursion_2() + ret void +} + +; Negativ test case, not willreturn and the call needs to be preserved. +; +define void @not_willreturn_recursion() { +; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone +; IS__TUNIT____-LABEL: define {{[^@]+}}@not_willreturn_recursion +; IS__TUNIT____-SAME: () [[ATTR4:#.*]] { +; IS__TUNIT____-NEXT: tail call void @not_willreturn_recursion() [[ATTR4]] +; IS__TUNIT____-NEXT: unreachable +; +; IS__CGSCC____: Function Attrs: nofree noreturn nosync nounwind readnone +; IS__CGSCC____-LABEL: define {{[^@]+}}@not_willreturn_recursion +; IS__CGSCC____-SAME: () [[ATTR5:#.*]] { +; IS__CGSCC____-NEXT: tail call void @not_willreturn_recursion() [[ATTR5]] +; IS__CGSCC____-NEXT: unreachable +; + tail call void @not_willreturn_recursion() + ret void +} 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 @@ -107,7 +107,7 @@ ; CHECK: Function Attrs: nounwind uwtable ; CHECK-LABEL: define {{[^@]+}}@bar ; CHECK-SAME: () [[ATTR1:#.*]] { -; CHECK-NEXT: [[TMP1:%.*]] = tail call i8* (...) @baz() [[ATTR2:#.*]] +; CHECK-NEXT: [[TMP1:%.*]] = tail call i8* (...) @baz() ; CHECK-NEXT: ret i8* [[TMP1]] ; %1 = tail call i8* (...) @baz() @@ -121,7 +121,7 @@ ; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0]], 0 ; CHECK-NEXT: br i1 [[TMP2]], label [[TMP5:%.*]], label [[TMP3:%.*]] ; CHECK: 3: -; CHECK-NEXT: [[TMP4:%.*]] = tail call i8* (...) @baz() [[ATTR2]] +; CHECK-NEXT: [[TMP4:%.*]] = tail call i8* (...) @baz() ; CHECK-NEXT: br label [[TMP5]] ; CHECK: 5: ; CHECK-NEXT: [[TMP6:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) @@ -160,9 +160,9 @@ ; Returning global pointer. Should not be noalias. define i8** @calle1(){ -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@calle1 -; NOT_CGSCC_NPM-SAME: () [[ATTR0]] { +; NOT_CGSCC_NPM-SAME: () [[ATTR2:#.*]] { ; NOT_CGSCC_NPM-NEXT: ret i8** @G ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -178,16 +178,27 @@ declare noalias i8* @strdup(i8* nocapture) nounwind define i8* @test6() nounwind uwtable ssp { -; CHECK: Function Attrs: nounwind ssp uwtable -; CHECK-LABEL: define {{[^@]+}}@test6 -; CHECK-SAME: () [[ATTR3:#.*]] { -; CHECK-NEXT: [[X:%.*]] = alloca [2 x i8], align 1 -; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i8], [2 x i8]* [[X]], i64 0, i64 0 -; CHECK-NEXT: store i8 97, i8* [[ARRAYIDX]], align 1 -; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [2 x i8], [2 x i8]* [[X]], i64 0, i64 1 -; CHECK-NEXT: store i8 0, i8* [[ARRAYIDX1]], align 1 -; CHECK-NEXT: [[CALL:%.*]] = call noalias i8* @strdup(i8* nocapture noundef nonnull dereferenceable(2) [[ARRAYIDX]]) [[ATTR2]] -; CHECK-NEXT: ret i8* [[CALL]] +; NOT_CGSCC_NPM: Function Attrs: nounwind ssp uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test6 +; NOT_CGSCC_NPM-SAME: () [[ATTR4:#.*]] { +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = alloca [2 x i8], align 1 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i8], [2 x i8]* [[X]], i64 0, i64 0 +; NOT_CGSCC_NPM-NEXT: store i8 97, i8* [[ARRAYIDX]], align 1 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [2 x i8], [2 x i8]* [[X]], i64 0, i64 1 +; NOT_CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX1]], align 1 +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call noalias i8* @strdup(i8* nocapture noundef nonnull dereferenceable(2) [[ARRAYIDX]]) [[ATTR3:#.*]] +; NOT_CGSCC_NPM-NEXT: ret i8* [[CALL]] +; +; IS__CGSCC____: Function Attrs: nounwind ssp uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@test6 +; IS__CGSCC____-SAME: () [[ATTR3:#.*]] { +; IS__CGSCC____-NEXT: [[X:%.*]] = alloca [2 x i8], align 1 +; IS__CGSCC____-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i8], [2 x i8]* [[X]], i64 0, i64 0 +; IS__CGSCC____-NEXT: store i8 97, i8* [[ARRAYIDX]], align 1 +; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [2 x i8], [2 x i8]* [[X]], i64 0, i64 1 +; IS__CGSCC____-NEXT: store i8 0, i8* [[ARRAYIDX1]], align 1 +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call noalias i8* @strdup(i8* nocapture noundef nonnull dereferenceable(2) [[ARRAYIDX]]) [[ATTR2:#.*]] +; IS__CGSCC____-NEXT: ret i8* [[CALL]] ; %x = alloca [2 x i8], align 1 %arrayidx = getelementptr inbounds [2 x i8], [2 x i8]* %x, i64 0, i64 0 @@ -201,19 +212,33 @@ ; TEST 7 define i8* @test7() nounwind { -; CHECK: Function Attrs: nounwind -; CHECK-LABEL: define {{[^@]+}}@test7 -; CHECK-SAME: () [[ATTR2]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[A:%.*]] = call noalias i8* @malloc(i64 noundef 4) [[ATTR2]] -; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i8* [[A]], null -; CHECK-NEXT: br i1 [[TOBOOL]], label [[RETURN:%.*]], label [[IF_END:%.*]] -; CHECK: if.end: -; CHECK-NEXT: store i8 7, i8* [[A]], align 1 -; CHECK-NEXT: br label [[RETURN]] -; CHECK: return: -; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i8* [ [[A]], [[IF_END]] ], [ null, [[ENTRY:%.*]] ] -; CHECK-NEXT: ret i8* [[RETVAL_0]] +; NOT_CGSCC_NPM: Function Attrs: nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test7 +; NOT_CGSCC_NPM-SAME: () [[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = call noalias i8* @malloc(i64 noundef 4) [[ATTR3]] +; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i8* [[A]], null +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[RETURN:%.*]], label [[IF_END:%.*]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: store i8 7, i8* [[A]], align 1 +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i8* [ [[A]], [[IF_END]] ], [ null, [[ENTRY:%.*]] ] +; NOT_CGSCC_NPM-NEXT: ret i8* [[RETVAL_0]] +; +; IS__CGSCC____: Function Attrs: nounwind +; IS__CGSCC____-LABEL: define {{[^@]+}}@test7 +; IS__CGSCC____-SAME: () [[ATTR2]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[A:%.*]] = call noalias i8* @malloc(i64 noundef 4) [[ATTR2]] +; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp eq i8* [[A]], null +; IS__CGSCC____-NEXT: br i1 [[TOBOOL]], label [[RETURN:%.*]], label [[IF_END:%.*]] +; IS__CGSCC____: if.end: +; IS__CGSCC____-NEXT: store i8 7, i8* [[A]], align 1 +; IS__CGSCC____-NEXT: br label [[RETURN]] +; IS__CGSCC____: return: +; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i8* [ [[A]], [[IF_END]] ], [ null, [[ENTRY:%.*]] ] +; IS__CGSCC____-NEXT: ret i8* [[RETVAL_0]] ; entry: %A = call noalias i8* @malloc(i64 4) nounwind @@ -523,11 +548,11 @@ define i32 @i2p(i32* %arg) { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readonly willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@i2p -; NOT_CGSCC_NPM-SAME: (i32* nofree readonly [[ARG:%.*]]) [[ATTR4:#.*]] { -; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @p2i(i32* noalias nofree readnone [[ARG]]) [[ATTR11:#.*]] +; NOT_CGSCC_NPM-SAME: (i32* nofree readonly [[ARG:%.*]]) [[ATTR5:#.*]] { +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @p2i(i32* noalias nofree readnone [[ARG]]) [[ATTR2]] ; 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]]) [[ATTR5]] ; NOT_CGSCC_NPM-NEXT: ret i32 [[CALL]] ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn @@ -548,7 +573,7 @@ define internal i32 @ret(i32* %arg) { ; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ret -; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) [[ATTR5:#.*]] { +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) [[ATTR6:#.*]] { ; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[ARG]], align 4 ; NOT_CGSCC_NPM-NEXT: ret i32 [[L]] ; @@ -577,7 +602,7 @@ ; 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]]) [[ATTR12:#.*]] +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) [[ATTR13:#.*]] ; 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) @@ -644,7 +669,7 @@ define void @make_alias(i32* %p) { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@make_alias -; NOT_CGSCC_NPM-SAME: (i32* nofree writeonly [[P:%.*]]) [[ATTR7:#.*]] { +; NOT_CGSCC_NPM-SAME: (i32* nofree writeonly [[P:%.*]]) [[ATTR8:#.*]] { ; NOT_CGSCC_NPM-NEXT: store i32* [[P]], i32** @alias_of_p, align 8 ; NOT_CGSCC_NPM-NEXT: ret void ; @@ -661,7 +686,7 @@ define void @only_store(i32* %p) { ; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@only_store -; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) [[ATTR8:#.*]] { +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) [[ATTR9:#.*]] { ; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[P]], align 4 ; NOT_CGSCC_NPM-NEXT: ret void ; @@ -676,13 +701,13 @@ } define void @test15_caller(i32* noalias %p, i32 %c) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly mustprogress +; NOT_CGSCC_NPM: Function Attrs: nofree 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-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) [[ATTR10:#.*]] { ; 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* noalias nocapture nofree writeonly align 4 [[P]]) [[ATTR10:#.*]] +; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* noalias nocapture nofree writeonly align 4 [[P]]) [[ATTR10]] ; 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]]) [[ATTR10]] @@ -733,9 +758,9 @@ ; 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 mustprogress +; NOT_CGSCC_NPM: Function Attrs: nofree 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-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C1:%.*]], i32 [[C2:%.*]]) [[ATTR10]] { ; 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: @@ -790,9 +815,9 @@ } define void @test16_caller(i32* %p, i32 %c) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly mustprogress +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind writeonly ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test16_caller -; NOT_CGSCC_NPM-SAME: (i32* nofree writeonly [[P:%.*]], i32 [[C:%.*]]) [[ATTR7]] { +; NOT_CGSCC_NPM-SAME: (i32* nofree writeonly [[P:%.*]], i32 [[C:%.*]]) [[ATTR11:#.*]] { ; NOT_CGSCC_NPM-NEXT: tail call void @test16_sub(i32* noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) [[ATTR10]] ; NOT_CGSCC_NPM-NEXT: ret void ; @@ -826,9 +851,9 @@ ; } define void @test17_caller(i32* noalias %p, i32 %c) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly mustprogress +; NOT_CGSCC_NPM: Function Attrs: nofree 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-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) [[ATTR10]] { ; 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:%.*]] @@ -884,14 +909,16 @@ ; } define void @noreturn() { -; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@noreturn -; NOT_CGSCC_NPM-SAME: () [[ATTR9:#.*]] { +; NOT_CGSCC_NPM-SAME: () [[ATTR12:#.*]] { +; NOT_CGSCC_NPM-NEXT: call void @noreturn() [[ATTR12]] ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; IS__CGSCC____: Function Attrs: nofree noreturn nosync nounwind readnone ; IS__CGSCC____-LABEL: define {{[^@]+}}@noreturn ; IS__CGSCC____-SAME: () [[ATTR9:#.*]] { +; IS__CGSCC____-NEXT: call void @noreturn() [[ATTR9]] ; IS__CGSCC____-NEXT: unreachable ; call void @noreturn() @@ -899,9 +926,9 @@ } 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 nosync nounwind writeonly ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test18_caller -; NOT_CGSCC_NPM-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) [[ATTR10]] { +; NOT_CGSCC_NPM-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) [[ATTR11]] { ; 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:%.*]] @@ -909,7 +936,7 @@ ; NOT_CGSCC_NPM-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) [[ATTR10]] ; NOT_CGSCC_NPM-NEXT: unreachable ; NOT_CGSCC_NPM: l2: -; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) [[ATTR10]] +; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) [[ATTR11]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly mustprogress 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 @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM +; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM +; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM @@ -39,10 +39,10 @@ } define void @c3(i32* %q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly mustprogress +; IS__TUNIT____: Function Attrs: nofree 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]]) [[ATTR14:#.*]] +; IS__TUNIT____-SAME: (i32* nofree writeonly [[Q:%.*]]) [[ATTR2:#.*]] { +; IS__TUNIT____-NEXT: call void @c2(i32* nofree writeonly [[Q]]) [[ATTR2]] ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly mustprogress @@ -131,7 +131,7 @@ define i1 @c5(i32* %q, i32 %bitno) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@c5 -; IS__TUNIT____-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) [[ATTR2:#.*]] { +; IS__TUNIT____-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) [[ATTR3:#.*]] { ; 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 @@ -161,17 +161,29 @@ declare void @throw_if_bit_set(i8*, i8) readonly define i1 @c6(i8* %q, i8 %bit) personality i32 (...)* @__gxx_personality_v0 { -; CHECK: Function Attrs: nounwind readonly -; CHECK-LABEL: define {{[^@]+}}@c6 -; CHECK-SAME: (i8* readonly [[Q:%.*]], i8 [[BIT:%.*]]) [[ATTR4:#.*]] personality i32 (...)* @__gxx_personality_v0 { -; CHECK-NEXT: invoke void @throw_if_bit_set(i8* readonly [[Q]], i8 [[BIT]]) [[ATTR3:#.*]] -; CHECK-NEXT: to label [[RET0:%.*]] unwind label [[RET1:%.*]] -; CHECK: ret0: -; CHECK-NEXT: ret i1 false -; CHECK: ret1: -; CHECK-NEXT: [[EXN:%.*]] = landingpad { i8*, i32 } -; CHECK-NEXT: cleanup -; CHECK-NEXT: ret i1 true +; IS__TUNIT____: Function Attrs: nounwind readonly +; IS__TUNIT____-LABEL: define {{[^@]+}}@c6 +; IS__TUNIT____-SAME: (i8* readonly [[Q:%.*]], i8 [[BIT:%.*]]) [[ATTR5:#.*]] personality i32 (...)* @__gxx_personality_v0 { +; IS__TUNIT____-NEXT: invoke void @throw_if_bit_set(i8* readonly [[Q]], i8 [[BIT]]) [[ATTR4:#.*]] +; IS__TUNIT____-NEXT: to label [[RET0:%.*]] unwind label [[RET1:%.*]] +; IS__TUNIT____: ret0: +; IS__TUNIT____-NEXT: ret i1 false +; IS__TUNIT____: ret1: +; IS__TUNIT____-NEXT: [[EXN:%.*]] = landingpad { i8*, i32 } +; IS__TUNIT____-NEXT: cleanup +; IS__TUNIT____-NEXT: ret i1 true +; +; IS__CGSCC____: Function Attrs: nounwind readonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@c6 +; IS__CGSCC____-SAME: (i8* readonly [[Q:%.*]], i8 [[BIT:%.*]]) [[ATTR4:#.*]] personality i32 (...)* @__gxx_personality_v0 { +; IS__CGSCC____-NEXT: invoke void @throw_if_bit_set(i8* readonly [[Q]], i8 [[BIT]]) [[ATTR3:#.*]] +; IS__CGSCC____-NEXT: to label [[RET0:%.*]] unwind label [[RET1:%.*]] +; IS__CGSCC____: ret0: +; IS__CGSCC____-NEXT: ret i1 false +; IS__CGSCC____: ret1: +; IS__CGSCC____-NEXT: [[EXN:%.*]] = landingpad { i8*, i32 } +; IS__CGSCC____-NEXT: cleanup +; IS__CGSCC____-NEXT: ret i1 true ; invoke void @throw_if_bit_set(i8* %q, i8 %bit) to label %ret0 unwind label %ret1 @@ -214,8 +226,8 @@ define i1 @c7(i32* %q, i32 %bitno) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn mustprogress ; 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]]) [[ATTR15:#.*]] +; IS__TUNIT____-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) [[ATTR3]] { +; IS__TUNIT____-NEXT: [[PTR:%.*]] = call i1* @lookup_bit(i32* noalias nofree readnone [[Q]], i32 [[BITNO]]) [[ATTR16:#.*]] ; IS__TUNIT____-NEXT: [[VAL:%.*]] = load i1, i1* [[PTR]], align 1 ; IS__TUNIT____-NEXT: ret i1 [[VAL]] ; @@ -235,7 +247,7 @@ define i32 @nc1(i32* %q, i32* %p, i1 %b) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@nc1 -; IS__TUNIT____-SAME: (i32* nofree [[Q:%.*]], i32* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) [[ATTR5:#.*]] { +; IS__TUNIT____-SAME: (i32* nofree [[Q:%.*]], i32* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) [[ATTR6:#.*]] { ; IS__TUNIT____-NEXT: e: ; IS__TUNIT____-NEXT: br label [[L:%.*]] ; IS__TUNIT____: l: @@ -279,7 +291,7 @@ define i32 @nc1_addrspace(i32* %q, i32 addrspace(1)* %p, i1 %b) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@nc1_addrspace -; IS__TUNIT____-SAME: (i32* nofree [[Q:%.*]], i32 addrspace(1)* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) [[ATTR5]] { +; IS__TUNIT____-SAME: (i32* nofree [[Q:%.*]], i32 addrspace(1)* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) [[ATTR6]] { ; IS__TUNIT____-NEXT: e: ; IS__TUNIT____-NEXT: br label [[L:%.*]] ; IS__TUNIT____: l: @@ -321,10 +333,10 @@ } define void @nc2(i32* %p, i32* %q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree 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) [[ATTR16:#.*]] +; IS__TUNIT____-SAME: (i32* nocapture nofree [[P:%.*]], i32* nofree [[Q:%.*]]) [[ATTR7:#.*]] { +; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @nc1(i32* nofree [[Q]], i32* nocapture nofree [[P]], i1 noundef false) [[ATTR7]] ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn mustprogress @@ -352,17 +364,11 @@ ; FIXME: readonly and nocapture missing on the pointer. declare void @external(i8* readonly) nounwind argmemonly define void @nc4(i8* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@nc4 -; IS__TUNIT____-SAME: (i8* [[P:%.*]]) [[ATTR6:#.*]] { -; IS__TUNIT____-NEXT: call void @external(i8* readonly [[P]]) [[ATTR11:#.*]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@nc4 -; IS__CGSCC____-SAME: (i8* [[P:%.*]]) [[ATTR6:#.*]] { -; IS__CGSCC____-NEXT: call void @external(i8* readonly [[P]]) [[ATTR13:#.*]] -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: argmemonly nounwind +; CHECK-LABEL: define {{[^@]+}}@nc4 +; CHECK-SAME: (i8* [[P:%.*]]) [[ATTR6:#.*]] { +; CHECK-NEXT: call void @external(i8* readonly [[P]]) +; CHECK-NEXT: ret void ; call void @external(i8* %p) ret void @@ -381,12 +387,19 @@ ; It would be acceptable to add readnone to %y1_1 and %y1_2. define void @test1_1(i8* %x1_1, i8* %y1_1, i1 %c) { -; CHECK: Function Attrs: nofree nosync nounwind writeonly -; CHECK-LABEL: define {{[^@]+}}@test1_1 -; CHECK-SAME: (i8* nocapture nofree readnone [[X1_1:%.*]], i8* nocapture nofree readnone [[Y1_1:%.*]], i1 [[C:%.*]]) [[ATTR7:#.*]] { -; CHECK-NEXT: [[TMP1:%.*]] = call i8* @test1_2(i8* noalias nocapture nofree readnone undef, i8* noalias nofree readnone "no-capture-maybe-returned" [[Y1_1]], i1 [[C]]) [[ATTR7]] -; CHECK-NEXT: store i32* null, i32** @g, align 8 -; CHECK-NEXT: ret void +; IS__TUNIT____: Function Attrs: nofree nosync nounwind writeonly +; IS__TUNIT____-LABEL: define {{[^@]+}}@test1_1 +; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[X1_1:%.*]], i8* nocapture nofree readnone [[Y1_1:%.*]], i1 [[C:%.*]]) [[ATTR9:#.*]] { +; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8* @test1_2(i8* noalias nocapture nofree readnone undef, i8* noalias nofree readnone "no-capture-maybe-returned" [[Y1_1]], i1 [[C]]) [[ATTR9]] +; IS__TUNIT____-NEXT: store i32* null, i32** @g, align 8 +; IS__TUNIT____-NEXT: ret void +; +; IS__CGSCC____: Function Attrs: nofree nosync nounwind writeonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@test1_1 +; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[X1_1:%.*]], i8* nocapture nofree readnone [[Y1_1:%.*]], i1 [[C:%.*]]) [[ATTR7:#.*]] { +; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8* @test1_2(i8* noalias nocapture nofree readnone undef, i8* noalias nofree readnone "no-capture-maybe-returned" [[Y1_1]], i1 [[C]]) [[ATTR7]] +; IS__CGSCC____-NEXT: store i32* null, i32** @g, align 8 +; IS__CGSCC____-NEXT: ret void ; call i8* @test1_2(i8* %x1_1, i8* %y1_1, i1 %c) store i32* null, i32** @g @@ -394,27 +407,49 @@ } define i8* @test1_2(i8* %x1_2, i8* %y1_2, i1 %c) { -; IS________OPM: Function Attrs: nofree nosync nounwind writeonly -; IS________OPM-LABEL: define {{[^@]+}}@test1_2 -; IS________OPM-SAME: (i8* nocapture nofree readnone [[X1_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 [[C:%.*]]) [[ATTR7:#.*]] { -; IS________OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS________OPM: t: -; IS________OPM-NEXT: call void @test1_1(i8* noalias nocapture nofree readnone undef, i8* noalias nocapture nofree readnone [[Y1_2]], i1 [[C]]) [[ATTR7]] -; IS________OPM-NEXT: store i32* null, i32** @g, align 8 -; IS________OPM-NEXT: br label [[F]] -; IS________OPM: f: -; IS________OPM-NEXT: ret i8* [[Y1_2]] -; -; IS________NPM: Function Attrs: nofree nosync nounwind writeonly -; IS________NPM-LABEL: define {{[^@]+}}@test1_2 -; IS________NPM-SAME: (i8* nocapture nofree readnone [[X1_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 [[C:%.*]]) [[ATTR7:#.*]] { -; IS________NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS________NPM: t: -; IS________NPM-NEXT: call void @test1_1(i8* noalias nocapture nofree readnone undef, i8* noalias nocapture nofree readnone [[Y1_2]], i1 noundef [[C]]) [[ATTR7]] -; IS________NPM-NEXT: store i32* null, i32** @g, align 8 -; IS________NPM-NEXT: br label [[F]] -; IS________NPM: f: -; IS________NPM-NEXT: ret i8* [[Y1_2]] +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind writeonly +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test1_2 +; IS__TUNIT_OPM-SAME: (i8* nocapture nofree readnone [[X1_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 [[C:%.*]]) [[ATTR9:#.*]] { +; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__TUNIT_OPM: t: +; IS__TUNIT_OPM-NEXT: call void @test1_1(i8* noalias nocapture nofree readnone undef, i8* noalias nocapture nofree readnone [[Y1_2]], i1 [[C]]) [[ATTR9]] +; IS__TUNIT_OPM-NEXT: store i32* null, i32** @g, align 8 +; IS__TUNIT_OPM-NEXT: br label [[F]] +; IS__TUNIT_OPM: f: +; IS__TUNIT_OPM-NEXT: ret i8* [[Y1_2]] +; +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind writeonly +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test1_2 +; IS__TUNIT_NPM-SAME: (i8* nocapture nofree readnone [[X1_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 [[C:%.*]]) [[ATTR9:#.*]] { +; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__TUNIT_NPM: t: +; IS__TUNIT_NPM-NEXT: call void @test1_1(i8* noalias nocapture nofree readnone undef, i8* noalias nocapture nofree readnone [[Y1_2]], i1 noundef [[C]]) [[ATTR9]] +; IS__TUNIT_NPM-NEXT: store i32* null, i32** @g, align 8 +; IS__TUNIT_NPM-NEXT: br label [[F]] +; IS__TUNIT_NPM: f: +; IS__TUNIT_NPM-NEXT: ret i8* [[Y1_2]] +; +; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test1_2 +; IS__CGSCC_OPM-SAME: (i8* nocapture nofree readnone [[X1_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 [[C:%.*]]) [[ATTR7:#.*]] { +; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC_OPM: t: +; IS__CGSCC_OPM-NEXT: call void @test1_1(i8* noalias nocapture nofree readnone undef, i8* noalias nocapture nofree readnone [[Y1_2]], i1 [[C]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: store i32* null, i32** @g, align 8 +; IS__CGSCC_OPM-NEXT: br label [[F]] +; IS__CGSCC_OPM: f: +; IS__CGSCC_OPM-NEXT: ret i8* [[Y1_2]] +; +; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind writeonly +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test1_2 +; IS__CGSCC_NPM-SAME: (i8* nocapture nofree readnone [[X1_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 [[C:%.*]]) [[ATTR7:#.*]] { +; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC_NPM: t: +; IS__CGSCC_NPM-NEXT: call void @test1_1(i8* noalias nocapture nofree readnone undef, i8* noalias nocapture nofree readnone [[Y1_2]], i1 noundef [[C]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: store i32* null, i32** @g, align 8 +; IS__CGSCC_NPM-NEXT: br label [[F]] +; IS__CGSCC_NPM: f: +; IS__CGSCC_NPM-NEXT: ret i8* [[Y1_2]] ; br i1 %c, label %t, label %f t: @@ -426,14 +461,16 @@ } define void @test2(i8* %x2) { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[X2:%.*]]) [[ATTR8:#.*]] { +; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[X2:%.*]]) [[ATTR10:#.*]] { +; IS__TUNIT____-NEXT: call void @test2(i8* noalias nocapture nofree readnone undef) [[ATTR10]] ; IS__TUNIT____-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; IS__CGSCC____: Function Attrs: nofree noreturn nosync nounwind readnone ; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 ; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[X2:%.*]]) [[ATTR8:#.*]] { +; IS__CGSCC____-NEXT: call void @test2(i8* noalias nocapture nofree readnone undef) [[ATTR8]] ; IS__CGSCC____-NEXT: unreachable ; call void @test2(i8* %x2) @@ -442,14 +479,16 @@ } define void @test3(i8* %x3, i8* %y3, i8* %z3) { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@test3 -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[X3:%.*]], i8* nocapture nofree readnone [[Y3:%.*]], i8* nocapture nofree readnone [[Z3:%.*]]) [[ATTR8]] { +; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[X3:%.*]], i8* nocapture nofree readnone [[Y3:%.*]], i8* nocapture nofree readnone [[Z3:%.*]]) [[ATTR10]] { +; IS__TUNIT____-NEXT: call void @test3(i8* noalias nocapture nofree readnone undef, i8* noalias nocapture nofree readnone undef, i8* noalias nocapture nofree readnone undef) [[ATTR10]] ; IS__TUNIT____-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; IS__CGSCC____: Function Attrs: nofree noreturn nosync nounwind readnone ; IS__CGSCC____-LABEL: define {{[^@]+}}@test3 ; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[X3:%.*]], i8* nocapture nofree readnone [[Y3:%.*]], i8* nocapture nofree readnone [[Z3:%.*]]) [[ATTR8]] { +; IS__CGSCC____-NEXT: call void @test3(i8* noalias nocapture nofree readnone undef, i8* noalias nocapture nofree readnone undef, i8* noalias nocapture nofree readnone undef) [[ATTR8]] ; IS__CGSCC____-NEXT: unreachable ; call void @test3(i8* %z3, i8* %y3, i8* %x3) @@ -458,12 +497,19 @@ } define void @test4_1(i8* %x4_1, i1 %c) { -; CHECK: Function Attrs: nofree nosync nounwind writeonly -; CHECK-LABEL: define {{[^@]+}}@test4_1 -; CHECK-SAME: (i8* nocapture nofree readnone [[X4_1:%.*]], i1 [[C:%.*]]) [[ATTR7]] { -; CHECK-NEXT: [[TMP1:%.*]] = call i8* @test4_2(i8* noalias nocapture nofree readnone undef, i8* noalias nofree readnone "no-capture-maybe-returned" [[X4_1]], i8* noalias nocapture nofree readnone undef, i1 [[C]]) [[ATTR7]] -; CHECK-NEXT: store i32* null, i32** @g, align 8 -; CHECK-NEXT: ret void +; IS__TUNIT____: Function Attrs: nofree nosync nounwind writeonly +; IS__TUNIT____-LABEL: define {{[^@]+}}@test4_1 +; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[X4_1:%.*]], i1 [[C:%.*]]) [[ATTR9]] { +; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8* @test4_2(i8* noalias nocapture nofree readnone undef, i8* noalias nofree readnone "no-capture-maybe-returned" [[X4_1]], i8* noalias nocapture nofree readnone undef, i1 [[C]]) [[ATTR9]] +; IS__TUNIT____-NEXT: store i32* null, i32** @g, align 8 +; IS__TUNIT____-NEXT: ret void +; +; IS__CGSCC____: Function Attrs: nofree nosync nounwind writeonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@test4_1 +; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[X4_1:%.*]], i1 [[C:%.*]]) [[ATTR7]] { +; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8* @test4_2(i8* noalias nocapture nofree readnone undef, i8* noalias nofree readnone "no-capture-maybe-returned" [[X4_1]], i8* noalias nocapture nofree readnone undef, i1 [[C]]) [[ATTR7]] +; IS__CGSCC____-NEXT: store i32* null, i32** @g, align 8 +; IS__CGSCC____-NEXT: ret void ; call i8* @test4_2(i8* %x4_1, i8* %x4_1, i8* %x4_1, i1 %c) store i32* null, i32** @g @@ -471,27 +517,49 @@ } define i8* @test4_2(i8* %x4_2, i8* %y4_2, i8* %z4_2, i1 %c) { -; IS________OPM: Function Attrs: nofree nosync nounwind writeonly -; IS________OPM-LABEL: define {{[^@]+}}@test4_2 -; IS________OPM-SAME: (i8* nocapture nofree readnone [[X4_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], i8* nocapture nofree readnone [[Z4_2:%.*]], i1 [[C:%.*]]) [[ATTR7]] { -; IS________OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS________OPM: t: -; IS________OPM-NEXT: call void @test4_1(i8* noalias nocapture nofree noundef readnone align 536870912 null, i1 [[C]]) [[ATTR7]] -; IS________OPM-NEXT: store i32* null, i32** @g, align 8 -; IS________OPM-NEXT: br label [[F]] -; IS________OPM: f: -; IS________OPM-NEXT: ret i8* [[Y4_2]] -; -; IS________NPM: Function Attrs: nofree nosync nounwind writeonly -; IS________NPM-LABEL: define {{[^@]+}}@test4_2 -; IS________NPM-SAME: (i8* nocapture nofree readnone [[X4_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], i8* nocapture nofree readnone [[Z4_2:%.*]], i1 [[C:%.*]]) [[ATTR7]] { -; IS________NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS________NPM: t: -; IS________NPM-NEXT: call void @test4_1(i8* noalias nocapture nofree noundef readnone align 536870912 null, i1 noundef [[C]]) [[ATTR7]] -; IS________NPM-NEXT: store i32* null, i32** @g, align 8 -; IS________NPM-NEXT: br label [[F]] -; IS________NPM: f: -; IS________NPM-NEXT: ret i8* [[Y4_2]] +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind writeonly +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test4_2 +; IS__TUNIT_OPM-SAME: (i8* nocapture nofree readnone [[X4_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], i8* nocapture nofree readnone [[Z4_2:%.*]], i1 [[C:%.*]]) [[ATTR9]] { +; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__TUNIT_OPM: t: +; IS__TUNIT_OPM-NEXT: call void @test4_1(i8* noalias nocapture nofree noundef readnone align 536870912 null, i1 [[C]]) [[ATTR9]] +; IS__TUNIT_OPM-NEXT: store i32* null, i32** @g, align 8 +; IS__TUNIT_OPM-NEXT: br label [[F]] +; IS__TUNIT_OPM: f: +; IS__TUNIT_OPM-NEXT: ret i8* [[Y4_2]] +; +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind writeonly +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test4_2 +; IS__TUNIT_NPM-SAME: (i8* nocapture nofree readnone [[X4_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], i8* nocapture nofree readnone [[Z4_2:%.*]], i1 [[C:%.*]]) [[ATTR9]] { +; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__TUNIT_NPM: t: +; IS__TUNIT_NPM-NEXT: call void @test4_1(i8* noalias nocapture nofree noundef readnone align 536870912 null, i1 noundef [[C]]) [[ATTR9]] +; IS__TUNIT_NPM-NEXT: store i32* null, i32** @g, align 8 +; IS__TUNIT_NPM-NEXT: br label [[F]] +; IS__TUNIT_NPM: f: +; IS__TUNIT_NPM-NEXT: ret i8* [[Y4_2]] +; +; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test4_2 +; IS__CGSCC_OPM-SAME: (i8* nocapture nofree readnone [[X4_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], i8* nocapture nofree readnone [[Z4_2:%.*]], i1 [[C:%.*]]) [[ATTR7]] { +; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC_OPM: t: +; IS__CGSCC_OPM-NEXT: call void @test4_1(i8* noalias nocapture nofree noundef readnone align 536870912 null, i1 [[C]]) [[ATTR7]] +; IS__CGSCC_OPM-NEXT: store i32* null, i32** @g, align 8 +; IS__CGSCC_OPM-NEXT: br label [[F]] +; IS__CGSCC_OPM: f: +; IS__CGSCC_OPM-NEXT: ret i8* [[Y4_2]] +; +; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind writeonly +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test4_2 +; IS__CGSCC_NPM-SAME: (i8* nocapture nofree readnone [[X4_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], i8* nocapture nofree readnone [[Z4_2:%.*]], i1 [[C:%.*]]) [[ATTR7]] { +; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC_NPM: t: +; IS__CGSCC_NPM-NEXT: call void @test4_1(i8* noalias nocapture nofree noundef readnone align 536870912 null, i1 noundef [[C]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: store i32* null, i32** @g, align 8 +; IS__CGSCC_NPM-NEXT: br label [[F]] +; IS__CGSCC_NPM: f: +; IS__CGSCC_NPM-NEXT: ret i8* [[Y4_2]] ; br i1 %c, label %t, label %f t: @@ -533,7 +601,7 @@ define void @test_cmpxchg(i32* %p) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_cmpxchg -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull dereferenceable(4) [[P:%.*]]) [[ATTR9:#.*]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull dereferenceable(4) [[P:%.*]]) [[ATTR11:#.*]] { ; IS__TUNIT____-NEXT: [[TMP1:%.*]] = cmpxchg i32* [[P]], i32 0, i32 1 acquire monotonic ; IS__TUNIT____-NEXT: ret void ; @@ -550,7 +618,7 @@ define void @test_cmpxchg_ptr(i32** %p, i32* %q) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_cmpxchg_ptr -; IS__TUNIT____-SAME: (i32** nocapture nofree nonnull dereferenceable(8) [[P:%.*]], i32* nofree [[Q:%.*]]) [[ATTR9]] { +; IS__TUNIT____-SAME: (i32** nocapture nofree nonnull dereferenceable(8) [[P:%.*]], i32* nofree [[Q:%.*]]) [[ATTR11]] { ; IS__TUNIT____-NEXT: [[TMP1:%.*]] = cmpxchg i32** [[P]], i32* null, i32* [[Q]] acquire monotonic ; IS__TUNIT____-NEXT: ret void ; @@ -567,7 +635,7 @@ define void @test_atomicrmw(i32* %p) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_atomicrmw -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull dereferenceable(4) [[P:%.*]]) [[ATTR9]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull dereferenceable(4) [[P:%.*]]) [[ATTR11]] { ; IS__TUNIT____-NEXT: [[TMP1:%.*]] = atomicrmw add i32* [[P]], i32 1 seq_cst ; IS__TUNIT____-NEXT: ret void ; @@ -584,7 +652,7 @@ define void @test_volatile(i32* %x) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_volatile -; IS__TUNIT____-SAME: (i32* nofree align 4 [[X:%.*]]) [[ATTR9]] { +; IS__TUNIT____-SAME: (i32* nofree align 4 [[X:%.*]]) [[ATTR11]] { ; 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 @@ -753,7 +821,7 @@ 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 mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@captureDereferenceableOrNullICmp -; IS__TUNIT____-SAME: (i32* nofree readnone dereferenceable_or_null(4) [[X:%.*]]) [[ATTR10:#.*]] { +; IS__TUNIT____-SAME: (i32* nofree readnone dereferenceable_or_null(4) [[X:%.*]]) [[ATTR12:#.*]] { ; IS__TUNIT____-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* ; IS__TUNIT____-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null ; IS__TUNIT____-NEXT: ret i1 [[TMP2]] @@ -787,7 +855,7 @@ define i8* @test_returned1(i8* %A, i8* returned %B) nounwind readonly { ; CHECK: Function Attrs: nounwind readonly ; CHECK-LABEL: define {{[^@]+}}@test_returned1 -; CHECK-SAME: (i8* nocapture readonly [[A:%.*]], i8* readonly returned [[B:%.*]]) [[ATTR4]] { +; CHECK-SAME: (i8* nocapture readonly [[A:%.*]], i8* readonly returned [[B:%.*]]) [[ATTR4:#.*]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[P:%.*]] = call i8* @unknownpi8pi8(i8* [[A]], i8* [[B]]) ; CHECK-NEXT: ret i8* [[P]] @@ -798,12 +866,19 @@ } define i8* @test_returned2(i8* %A, i8* %B) { -; CHECK: Function Attrs: nounwind readonly -; CHECK-LABEL: define {{[^@]+}}@test_returned2 -; CHECK-SAME: (i8* nocapture readonly [[A:%.*]], i8* readonly returned [[B:%.*]]) [[ATTR4]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[P:%.*]] = call i8* @unknownpi8pi8(i8* readonly [[A]], i8* readonly [[B]]) [[ATTR4]] -; CHECK-NEXT: ret i8* [[P]] +; IS__TUNIT____: Function Attrs: nounwind readonly +; IS__TUNIT____-LABEL: define {{[^@]+}}@test_returned2 +; IS__TUNIT____-SAME: (i8* nocapture readonly [[A:%.*]], i8* readonly returned [[B:%.*]]) [[ATTR5]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[P:%.*]] = call i8* @unknownpi8pi8(i8* readonly [[A]], i8* readonly [[B]]) [[ATTR5]] +; IS__TUNIT____-NEXT: ret i8* [[P]] +; +; IS__CGSCC____: Function Attrs: nounwind readonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@test_returned2 +; IS__CGSCC____-SAME: (i8* nocapture readonly [[A:%.*]], i8* readonly returned [[B:%.*]]) [[ATTR4]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[P:%.*]] = call i8* @unknownpi8pi8(i8* readonly [[A]], i8* readonly [[B]]) [[ATTR4]] +; IS__CGSCC____-NEXT: ret i8* [[P]] ; entry: %p = call i8* @unknownpi8pi8(i8* %A, i8* %B) nounwind readonly 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 @@ -132,16 +132,18 @@ ; } ; define double* @srec0(double* %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable ; IS__TUNIT____-LABEL: define {{[^@]+}}@srec0 ; IS__TUNIT____-SAME: (double* nocapture nofree readnone [[A:%.*]]) [[ATTR1:#.*]] { ; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call double* @srec0(double* noalias nocapture nofree readnone undef) [[ATTR10:#.*]] ; IS__TUNIT____-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; IS__CGSCC____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable ; IS__CGSCC____-LABEL: define {{[^@]+}}@srec0 ; IS__CGSCC____-SAME: (double* nocapture nofree readnone [[A:%.*]]) [[ATTR1:#.*]] { ; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call double* @srec0(double* noalias nocapture nofree readnone undef) [[ATTR9:#.*]] ; IS__CGSCC____-NEXT: unreachable ; entry: @@ -163,17 +165,11 @@ ; Other arguments are possible here due to the no-return behavior. ; 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* nocapture nofree readnone [[A:%.*]]) [[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; 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* nocapture nofree readnone [[A:%.*]]) [[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; CHECK-LABEL: define {{[^@]+}}@srec16 +; CHECK-SAME: (i32* nocapture nofree readnone [[A:%.*]]) [[ATTR1:#.*]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: unreachable ; entry: %call = call i32* @srec16(i32* %a) @@ -462,20 +458,20 @@ ; } ; define void @test_not_captured_but_returned_calls(i64* %a) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly mustprogress +; IS__TUNIT____: Function Attrs: argmemonly nofree noinline 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:%.*]]) [[ATTR4]] { +; IS__TUNIT____-SAME: (i64* nocapture nofree writeonly align 8 [[A:%.*]]) [[ATTR5:#.*]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) [[ATTR9:#.*]] -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) [[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) [[ATTR11:#.*]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) [[ATTR11]] ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@test_not_captured_but_returned_calls ; IS__CGSCC____-SAME: (i64* nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[A:%.*]]) [[ATTR4]] { ; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) [[ATTR9:#.*]] -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i64* @not_captured_but_returned_1(i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) [[ATTR9]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) [[ATTR10:#.*]] +; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i64* @not_captured_but_returned_1(i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) [[ATTR10]] ; IS__CGSCC____-NEXT: ret void ; entry: @@ -492,18 +488,18 @@ ; ; 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 mustprogress +; IS__TUNIT____: Function Attrs: argmemonly nofree noinline 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:%.*]]) [[ATTR4]] { +; IS__TUNIT____-SAME: (i64* nofree returned writeonly align 8 "no-capture-maybe-returned" [[A:%.*]]) [[ATTR5]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) [[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) [[ATTR11]] ; IS__TUNIT____-NEXT: ret i64* [[CALL]] ; ; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0a ; IS__CGSCC____-SAME: (i64* nofree nonnull returned writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A:%.*]]) [[ATTR4]] { ; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree nonnull writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A]]) [[ATTR9]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree nonnull writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A]]) [[ATTR10]] ; IS__CGSCC____-NEXT: ret i64* [[CALL]] ; entry: @@ -519,11 +515,11 @@ ; ; 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 mustprogress +; IS__TUNIT____: Function Attrs: argmemonly nofree noinline 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:%.*]]) [[ATTR4]] { +; IS__TUNIT____-SAME: (i64* nofree writeonly align 8 [[A:%.*]]) [[ATTR5]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) [[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) [[ATTR11]] ; IS__TUNIT____-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[CALL]] to i64 ; IS__TUNIT____-NEXT: store i64 [[TMP0]], i64* [[A]], align 8 ; IS__TUNIT____-NEXT: ret void @@ -532,7 +528,7 @@ ; IS__CGSCC____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0b ; IS__CGSCC____-SAME: (i64* nofree nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) [[ATTR4]] { ; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree nonnull writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A]]) [[ATTR9]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree nonnull writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A]]) [[ATTR10]] ; IS__CGSCC____-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[CALL]] to i64 ; IS__CGSCC____-NEXT: store i64 [[TMP0]], i64* [[A]], align 8 ; IS__CGSCC____-NEXT: ret void @@ -552,18 +548,18 @@ ; ; 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 mustprogress +; IS__TUNIT____: Function Attrs: argmemonly nofree noinline 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:%.*]]) [[ATTR4]] { +; IS__TUNIT____-SAME: (i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A:%.*]]) [[ATTR5]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call nonnull align 8 dereferenceable(8) i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) [[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call nonnull align 8 dereferenceable(8) i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) [[ATTR11]] ; IS__TUNIT____-NEXT: ret i64* [[CALL]] ; ; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1a ; IS__CGSCC____-SAME: (i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A:%.*]]) [[ATTR4]] { ; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call nonnull align 8 dereferenceable(8) i64* @not_captured_but_returned_1(i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) [[ATTR9]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call nonnull align 8 dereferenceable(8) i64* @not_captured_but_returned_1(i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) [[ATTR10]] ; IS__CGSCC____-NEXT: ret i64* [[CALL]] ; entry: @@ -579,11 +575,11 @@ ; ; 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 mustprogress +; IS__TUNIT____: Function Attrs: nofree noinline 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:%.*]]) [[ATTR5:#.*]] { +; IS__TUNIT____-SAME: (i64* nofree writeonly align 8 [[A:%.*]]) [[ATTR6:#.*]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call align 8 i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) [[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call align 8 i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) [[ATTR11]] ; IS__TUNIT____-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[CALL]] to i64 ; IS__TUNIT____-NEXT: store i64 [[TMP0]], i64* [[CALL]], align 8 ; IS__TUNIT____-NEXT: ret void @@ -592,7 +588,7 @@ ; IS__CGSCC____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1b ; IS__CGSCC____-SAME: (i64* nofree nonnull writeonly align 8 dereferenceable(16) [[A:%.*]]) [[ATTR5:#.*]] { ; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call align 8 i64* @not_captured_but_returned_1(i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) [[ATTR9]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call align 8 i64* @not_captured_but_returned_1(i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) [[ATTR10]] ; IS__CGSCC____-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[CALL]] to i64 ; IS__CGSCC____-NEXT: store i64 [[TMP0]], i64* [[CALL]], align 8 ; IS__CGSCC____-NEXT: ret void @@ -678,12 +674,19 @@ declare i32* @readonly_unknown(i32*, i32*) readonly define void @not_captured_by_readonly_call(i32* %b) #0 { -; CHECK: Function Attrs: noinline nounwind readonly uwtable -; CHECK-LABEL: define {{[^@]+}}@not_captured_by_readonly_call -; CHECK-SAME: (i32* nocapture readonly [[B:%.*]]) [[ATTR7:#.*]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown(i32* readonly [[B]], i32* readonly [[B]]) [[ATTR6:#.*]] -; CHECK-NEXT: ret void +; IS__TUNIT____: Function Attrs: noinline nounwind readonly uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@not_captured_by_readonly_call +; IS__TUNIT____-SAME: (i32* nocapture readonly [[B:%.*]]) [[ATTR8:#.*]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown(i32* readonly [[B]], i32* readonly [[B]]) [[ATTR7:#.*]] +; IS__TUNIT____-NEXT: ret void +; +; IS__CGSCC____: Function Attrs: noinline nounwind readonly uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@not_captured_by_readonly_call +; IS__CGSCC____-SAME: (i32* nocapture readonly [[B:%.*]]) [[ATTR7:#.*]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown(i32* readonly [[B]], i32* readonly [[B]]) [[ATTR6:#.*]] +; IS__CGSCC____-NEXT: ret void ; entry: %call = call i32* @readonly_unknown(i32* %b, i32* %b) @@ -696,12 +699,19 @@ ; Make sure the returned flag on %r is strong enough to justify nocapture on %b but **not** on %r. ; define i32* @not_captured_by_readonly_call_not_returned_either1(i32* %b, i32* returned %r) { -; CHECK: Function Attrs: nounwind readonly -; CHECK-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either1 -; CHECK-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) [[ATTR8:#.*]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown(i32* readonly [[B]], i32* readonly [[R]]) [[ATTR8]] -; CHECK-NEXT: ret i32* [[CALL]] +; IS__TUNIT____: Function Attrs: nounwind readonly +; IS__TUNIT____-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either1 +; IS__TUNIT____-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) [[ATTR9:#.*]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown(i32* readonly [[B]], i32* readonly [[R]]) [[ATTR9]] +; IS__TUNIT____-NEXT: ret i32* [[CALL]] +; +; IS__CGSCC____: Function Attrs: nounwind readonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either1 +; IS__CGSCC____-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) [[ATTR8:#.*]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown(i32* readonly [[B]], i32* readonly [[R]]) [[ATTR8]] +; IS__CGSCC____-NEXT: ret i32* [[CALL]] ; entry: %call = call i32* @readonly_unknown(i32* %b, i32* %r) nounwind @@ -710,12 +720,19 @@ declare i32* @readonly_unknown_r1a(i32*, i32* returned) readonly define i32* @not_captured_by_readonly_call_not_returned_either2(i32* %b, i32* %r) { -; CHECK: Function Attrs: nounwind readonly -; CHECK-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either2 -; CHECK-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) [[ATTR8]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1a(i32* readonly [[B]], i32* readonly [[R]]) [[ATTR8]] -; CHECK-NEXT: ret i32* [[CALL]] +; IS__TUNIT____: Function Attrs: nounwind readonly +; IS__TUNIT____-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either2 +; IS__TUNIT____-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) [[ATTR9]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1a(i32* readonly [[B]], i32* readonly [[R]]) [[ATTR9]] +; IS__TUNIT____-NEXT: ret i32* [[CALL]] +; +; IS__CGSCC____: Function Attrs: nounwind readonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either2 +; IS__CGSCC____-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) [[ATTR8]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1a(i32* readonly [[B]], i32* readonly [[R]]) [[ATTR8]] +; IS__CGSCC____-NEXT: ret i32* [[CALL]] ; entry: %call = call i32* @readonly_unknown_r1a(i32* %b, i32* %r) nounwind @@ -724,12 +741,19 @@ declare i32* @readonly_unknown_r1b(i32*, i32* returned) readonly nounwind define i32* @not_captured_by_readonly_call_not_returned_either3(i32* %b, i32* %r) { -; CHECK: Function Attrs: nounwind readonly -; CHECK-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either3 -; CHECK-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) [[ATTR8]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1b(i32* nocapture readonly [[B]], i32* readonly [[R]]) [[ATTR6]] -; CHECK-NEXT: ret i32* [[CALL]] +; IS__TUNIT____: Function Attrs: nounwind readonly +; IS__TUNIT____-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either3 +; IS__TUNIT____-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) [[ATTR9]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1b(i32* nocapture readonly [[B]], i32* readonly [[R]]) [[ATTR7]] +; IS__TUNIT____-NEXT: ret i32* [[CALL]] +; +; IS__CGSCC____: Function Attrs: nounwind readonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either3 +; IS__CGSCC____-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) [[ATTR8]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1b(i32* nocapture readonly [[B]], i32* readonly [[R]]) [[ATTR6]] +; IS__CGSCC____-NEXT: ret i32* [[CALL]] ; entry: %call = call i32* @readonly_unknown_r1b(i32* %b, i32* %r) @@ -737,12 +761,19 @@ } define i32* @not_captured_by_readonly_call_not_returned_either4(i32* %b, i32* %r) nounwind { -; CHECK: Function Attrs: nounwind readonly -; CHECK-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either4 -; CHECK-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) [[ATTR8]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1a(i32* readonly [[B]], i32* readonly [[R]]) [[ATTR6]] -; CHECK-NEXT: ret i32* [[CALL]] +; IS__TUNIT____: Function Attrs: nounwind readonly +; IS__TUNIT____-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either4 +; IS__TUNIT____-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) [[ATTR9]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1a(i32* readonly [[B]], i32* readonly [[R]]) [[ATTR7]] +; IS__TUNIT____-NEXT: ret i32* [[CALL]] +; +; IS__CGSCC____: Function Attrs: nounwind readonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either4 +; IS__CGSCC____-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) [[ATTR8]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1a(i32* readonly [[B]], i32* readonly [[R]]) [[ATTR6]] +; IS__CGSCC____-NEXT: ret i32* [[CALL]] ; entry: %call = call i32* @readonly_unknown_r1a(i32* %b, i32* %r) @@ -767,12 +798,19 @@ declare i32* @readonly_i32p(i32*) readonly define void @nocapture_is_not_subsumed_2(i32* nocapture %b) { -; CHECK-LABEL: define {{[^@]+}}@nocapture_is_not_subsumed_2 -; CHECK-SAME: (i32* nocapture [[B:%.*]]) { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @readonly_i32p(i32* readonly [[B]]) [[ATTR6]] -; CHECK-NEXT: store i32 0, i32* [[CALL]], align 4 -; CHECK-NEXT: ret void +; IS__TUNIT____-LABEL: define {{[^@]+}}@nocapture_is_not_subsumed_2 +; IS__TUNIT____-SAME: (i32* nocapture [[B:%.*]]) { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @readonly_i32p(i32* readonly [[B]]) [[ATTR7]] +; IS__TUNIT____-NEXT: store i32 0, i32* [[CALL]], align 4 +; IS__TUNIT____-NEXT: ret void +; +; IS__CGSCC____-LABEL: define {{[^@]+}}@nocapture_is_not_subsumed_2 +; IS__CGSCC____-SAME: (i32* nocapture [[B:%.*]]) { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @readonly_i32p(i32* readonly [[B]]) [[ATTR6]] +; IS__CGSCC____-NEXT: store i32 0, i32* [[CALL]], align 4 +; IS__CGSCC____-NEXT: ret void ; entry: %call = call i32* @readonly_i32p(i32* %b) 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 @@ -82,7 +82,7 @@ ; CHECK-NEXT: tail call void @free(i8* nocapture [[TMP0]]) [[ATTR0]] ; CHECK-NEXT: br label [[END:%.*]] ; CHECK: rec: -; CHECK-NEXT: tail call void @free_in_scc1(i8* nocapture [[TMP0]]) [[ATTR0]] +; CHECK-NEXT: tail call void @free_in_scc1(i8* nocapture [[TMP0]]) ; CHECK-NEXT: br label [[END]] ; CHECK: end: ; CHECK-NEXT: ret void @@ -111,30 +111,22 @@ define void @mutual_recursion1() #0 { -; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; NOT_CGSCC_NPM-SAME: () [[ATTR4:#.*]] { -; NOT_CGSCC_NPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn mustprogress -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__CGSCC_NPM-SAME: () [[ATTR4:#.*]] { -; IS__CGSCC_NPM-NEXT: unreachable +; CHECK: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; CHECK-LABEL: define {{[^@]+}}@mutual_recursion1 +; CHECK-SAME: () [[ATTR4:#.*]] { +; CHECK-NEXT: call void @mutual_recursion2() [[ATTR12:#.*]] +; CHECK-NEXT: unreachable ; call void @mutual_recursion2() ret void } define void @mutual_recursion2() #0 { -; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; NOT_CGSCC_NPM-SAME: () [[ATTR4]] { -; NOT_CGSCC_NPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn mustprogress -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__CGSCC_NPM-SAME: () [[ATTR4]] { -; IS__CGSCC_NPM-NEXT: unreachable +; CHECK: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; CHECK-LABEL: define {{[^@]+}}@mutual_recursion2 +; CHECK-SAME: () [[ATTR4]] { +; CHECK-NEXT: call void @mutual_recursion1() [[ATTR12]] +; CHECK-NEXT: unreachable ; call void @mutual_recursion1() ret void @@ -221,7 +213,7 @@ ; CHECK: Function Attrs: noinline nounwind uwtable ; CHECK-LABEL: define {{[^@]+}}@call_maybe_free ; CHECK-SAME: () [[ATTR1]] { -; CHECK-NEXT: tail call void @maybe_free() [[ATTR0]] +; CHECK-NEXT: tail call void @maybe_free() ; CHECK-NEXT: ret void ; tail call void @maybe_free() @@ -236,7 +228,7 @@ ; CHECK: Function Attrs: noinline nounwind uwtable ; CHECK-LABEL: define {{[^@]+}}@call_both ; CHECK-SAME: () [[ATTR1]] { -; CHECK-NEXT: tail call void @maybe_free() [[ATTR0]] +; CHECK-NEXT: tail call void @maybe_free() ; CHECK-NEXT: ret void ; tail call void @maybe_free() @@ -267,17 +259,11 @@ } define float @call_floor2(float %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn mustprogress -; IS__TUNIT____-LABEL: define {{[^@]+}}@call_floor2 -; IS__TUNIT____-SAME: (float [[A:%.*]]) [[ATTR3]] { -; IS__TUNIT____-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) [[ATTR11:#.*]] -; IS__TUNIT____-NEXT: ret float [[C]] -; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn mustprogress -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_floor2 -; IS__CGSCC____-SAME: (float [[A:%.*]]) [[ATTR7:#.*]] { -; IS__CGSCC____-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) [[ATTR12:#.*]] -; IS__CGSCC____-NEXT: ret float [[C]] +; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn mustprogress +; CHECK-LABEL: define {{[^@]+}}@call_floor2 +; CHECK-SAME: (float [[A:%.*]]) [[ATTR7:#.*]] { +; CHECK-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) [[ATTR13:#.*]] +; CHECK-NEXT: ret float [[C]] ; %c = tail call float @llvm.floor.f32(float %a) ret float %c @@ -302,9 +288,9 @@ } define void @f2() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@f2 -; IS__TUNIT____-SAME: () [[ATTR3]] { +; IS__TUNIT____-SAME: () [[ATTR7:#.*]] { ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn mustprogress @@ -373,17 +359,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]] [ "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]] [ "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) [[ATTR13]] [ "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) @@ -425,16 +405,16 @@ ; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_call ; CHECK-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) { ; CHECK-NEXT: call void @unknown(i8* [[ARG1]], i8* [[ARG2]], i8* [[ARG3]], i8* [[ARG4]]) -; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture readnone [[ARG1]]) [[ATTR0]] -; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture readnone [[ARG2]]) [[ATTR0]] +; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture readnone [[ARG1]]) +; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture readnone [[ARG2]]) ; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ] -; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG3]]) [[ATTR0]] -; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture readnone [[ARG4]]) [[ATTR0]] -; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree readnone [[ARG1]]) [[ATTR0]] -; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture readnone [[ARG2]]) [[ATTR0]] +; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG3]]) +; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture readnone [[ARG4]]) +; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree readnone [[ARG1]]) +; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture readnone [[ARG2]]) ; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG4]]) ] -; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree readnone [[ARG3]]) [[ATTR0]] -; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree readnone [[ARG4]]) [[ATTR0]] +; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree readnone [[ARG3]]) +; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree readnone [[ARG4]]) ; CHECK-NEXT: ret void ; call void @unknown(i8* %arg1, i8* %arg2, i8* %arg3, i8* %arg4) 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 @@ -37,16 +37,27 @@ define i8* @test2A(i1 %c, i8* %ret) { ; ATTRIBUTOR: define nonnull i8* @test2A(i1 %c, i8* nofree nonnull readnone returned %ret) -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2A -; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) [[ATTR2:#.*]] { -; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] -; NOT_CGSCC_NPM: A: -; NOT_CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) [[ATTR15:#.*]] [ "nonnull"(i8* [[RET]]) ] -; NOT_CGSCC_NPM-NEXT: ret i8* [[RET]] -; NOT_CGSCC_NPM: B: -; NOT_CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) [[ATTR15]] [ "nonnull"(i8* [[RET]]) ] -; NOT_CGSCC_NPM-NEXT: ret i8* [[RET]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn mustprogress +; IS__TUNIT____-LABEL: define {{[^@]+}}@test2A +; IS__TUNIT____-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) [[ATTR2:#.*]] { +; IS__TUNIT____-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] +; IS__TUNIT____: A: +; IS__TUNIT____-NEXT: call void @llvm.assume(i1 noundef true) [[ATTR16:#.*]] [ "nonnull"(i8* [[RET]]) ] +; IS__TUNIT____-NEXT: ret i8* [[RET]] +; IS__TUNIT____: B: +; IS__TUNIT____-NEXT: call void @llvm.assume(i1 noundef true) [[ATTR16]] [ "nonnull"(i8* [[RET]]) ] +; IS__TUNIT____-NEXT: ret i8* [[RET]] +; +; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn mustprogress +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test2A +; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) [[ATTR2:#.*]] { +; 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) [[ATTR15:#.*]] [ "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) [[ATTR15]] [ "nonnull"(i8* [[RET]]) ] +; IS__CGSCC_OPM-NEXT: ret i8* [[RET]] ; ; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test2A @@ -70,16 +81,27 @@ define i8* @test2B(i1 %c, i8* %ret) { ; ATTRIBUTOR: define nonnull dereferenceable(4) i8* @test2B(i1 %c, i8* nofree nonnull readnone returned dereferenceable(4) %ret) -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2B -; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) [[ATTR2]] { -; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] -; NOT_CGSCC_NPM: A: -; NOT_CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) [[ATTR15]] [ "dereferenceable"(i8* [[RET]], i32 4) ] -; NOT_CGSCC_NPM-NEXT: ret i8* [[RET]] -; NOT_CGSCC_NPM: B: -; NOT_CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) [[ATTR15]] [ "dereferenceable"(i8* [[RET]], i32 4) ] -; NOT_CGSCC_NPM-NEXT: ret i8* [[RET]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn mustprogress +; IS__TUNIT____-LABEL: define {{[^@]+}}@test2B +; IS__TUNIT____-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) [[ATTR2]] { +; IS__TUNIT____-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] +; IS__TUNIT____: A: +; IS__TUNIT____-NEXT: call void @llvm.assume(i1 noundef true) [[ATTR16]] [ "dereferenceable"(i8* [[RET]], i32 4) ] +; IS__TUNIT____-NEXT: ret i8* [[RET]] +; IS__TUNIT____: B: +; IS__TUNIT____-NEXT: call void @llvm.assume(i1 noundef true) [[ATTR16]] [ "dereferenceable"(i8* [[RET]], i32 4) ] +; IS__TUNIT____-NEXT: ret i8* [[RET]] +; +; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn mustprogress +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test2B +; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) [[ATTR2]] { +; 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) [[ATTR15]] [ "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) [[ATTR15]] [ "dereferenceable"(i8* [[RET]], i32 4) ] +; IS__CGSCC_OPM-NEXT: ret i8* [[RET]] ; ; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test2B @@ -178,14 +200,25 @@ ; 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) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test5_helper -; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) [[ATTR4:#.*]] { -; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; NOT_CGSCC_NPM: rec: -; NOT_CGSCC_NPM-NEXT: br label [[END]] -; NOT_CGSCC_NPM: end: -; NOT_CGSCC_NPM-NEXT: ret i8* null +; IS________OPM: Function Attrs: nofree nosync nounwind readnone +; IS________OPM-LABEL: define {{[^@]+}}@test5_helper +; IS________OPM-SAME: (i1 [[C:%.*]]) [[ATTR4:#.*]] { +; IS________OPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] +; IS________OPM: rec: +; IS________OPM-NEXT: [[RET:%.*]] = call i8* @test5(i1 [[C]]) [[ATTR4]] +; IS________OPM-NEXT: br label [[END]] +; IS________OPM: end: +; IS________OPM-NEXT: ret i8* null +; +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test5_helper +; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) [[ATTR4:#.*]] { +; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] +; IS__TUNIT_NPM: rec: +; IS__TUNIT_NPM-NEXT: [[RET:%.*]] = call i8* @test5(i1 noundef [[C]]) [[ATTR4]] +; IS__TUNIT_NPM-NEXT: br label [[END]] +; IS__TUNIT_NPM: end: +; IS__TUNIT_NPM-NEXT: ret i8* null ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test5_helper @@ -205,9 +238,9 @@ } define i8* @test5(i1 %c) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test5 -; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) [[ATTR4]] { +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) [[ATTR4:#.*]] { ; NOT_CGSCC_NPM-NEXT: ret i8* null ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -318,12 +351,19 @@ ; ATTRIBUTOR_OPM: define i8* @test10 ; ATTRIBUTOR_NPM: define nonnull i8* @test10 define i8* @test10(i8* %a, i64 %n) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test10 -; NOT_CGSCC_NPM-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) [[ATTR2]] { -; NOT_CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) [[ATTR15]] -; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] -; NOT_CGSCC_NPM-NEXT: ret i8* [[B]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn mustprogress +; IS__TUNIT____-LABEL: define {{[^@]+}}@test10 +; IS__TUNIT____-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) [[ATTR2]] { +; IS__TUNIT____-NEXT: call void @llvm.assume(i1 noundef true) [[ATTR16]] +; IS__TUNIT____-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] +; IS__TUNIT____-NEXT: ret i8* [[B]] +; +; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn mustprogress +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test10 +; IS__CGSCC_OPM-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) [[ATTR2]] { +; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) [[ATTR15]] +; IS__CGSCC_OPM-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] +; IS__CGSCC_OPM-NEXT: ret i8* [[B]] ; ; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test10 @@ -384,19 +424,12 @@ ; Simple Argument Tests declare i8* @unknown() define void @test13_helper() { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test13_helper() { -; NOT_CGSCC_NPM-NEXT: [[NONNULLPTR:%.*]] = tail call nonnull i8* @ret_nonnull() -; NOT_CGSCC_NPM-NEXT: [[MAYBENULLPTR:%.*]] = tail call i8* @unknown() -; NOT_CGSCC_NPM-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]]) [[ATTR6:#.*]] -; NOT_CGSCC_NPM-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]]) [[ATTR6]] -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test13_helper() { -; IS__CGSCC_NPM-NEXT: [[NONNULLPTR:%.*]] = tail call nonnull i8* @ret_nonnull() -; IS__CGSCC_NPM-NEXT: [[MAYBENULLPTR:%.*]] = tail call i8* @unknown() -; IS__CGSCC_NPM-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]]) [[ATTR5:#.*]] -; IS__CGSCC_NPM-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]]) [[ATTR5]] -; IS__CGSCC_NPM-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]]) +; 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]]) +; CHECK-NEXT: ret void ; %nonnullptr = tail call i8* @ret_nonnull() %maybenullptr = tail call i8* @unknown() @@ -407,7 +440,7 @@ define internal void @test13(i8* %a, i8* %b, i8* %c) { ; NOT_CGSCC_NPM: Function Attrs: nounwind ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test13 -; NOT_CGSCC_NPM-SAME: (i8* noalias nocapture nofree nonnull readnone [[A:%.*]], i8* noalias nocapture nofree readnone [[B:%.*]], i8* noalias nocapture nofree readnone [[C:%.*]]) [[ATTR6]] { +; NOT_CGSCC_NPM-SAME: (i8* noalias nocapture nofree nonnull readnone [[A:%.*]], i8* noalias nocapture nofree readnone [[B:%.*]], i8* noalias nocapture nofree readnone [[C:%.*]]) [[ATTR6:#.*]] { ; NOT_CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[A]]) [[ATTR6]] ; NOT_CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[B]]) [[ATTR6]] ; NOT_CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[C]]) [[ATTR6]] @@ -415,7 +448,7 @@ ; ; IS__CGSCC_NPM: Function Attrs: nounwind ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test13 -; IS__CGSCC_NPM-SAME: (i8* noalias nocapture nofree nonnull readnone [[A:%.*]], i8* noalias nocapture nofree readnone [[B:%.*]], i8* noalias nocapture nofree readnone [[C:%.*]]) [[ATTR5]] { +; IS__CGSCC_NPM-SAME: (i8* noalias nocapture nofree nonnull readnone [[A:%.*]], i8* noalias nocapture nofree readnone [[B:%.*]], i8* noalias nocapture nofree readnone [[C:%.*]]) [[ATTR5:#.*]] { ; IS__CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[A]]) [[ATTR5]] ; IS__CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[B]]) [[ATTR5]] ; IS__CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[C]]) [[ATTR5]] @@ -443,27 +476,49 @@ define internal i32* @f1(i32* %arg) { ; FIXME: missing nonnull It should be nonnull @f1(i32* nonnull readonly %arg) -; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f1 -; NOT_CGSCC_NPM-SAME: (i32* nofree readonly [[ARG:%.*]]) [[ATTR7:#.*]] { -; NOT_CGSCC_NPM-NEXT: bb: -; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = icmp eq i32* [[ARG]], null -; NOT_CGSCC_NPM-NEXT: br i1 [[TMP]], label [[BB9:%.*]], label [[BB1:%.*]] -; NOT_CGSCC_NPM: bb1: -; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARG]], align 4 -; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP2]], 0 -; NOT_CGSCC_NPM-NEXT: br i1 [[TMP3]], label [[BB6:%.*]], label [[BB4:%.*]] -; NOT_CGSCC_NPM: bb4: -; NOT_CGSCC_NPM-NEXT: [[TMP5:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 1 -; NOT_CGSCC_NPM-NEXT: [[TMP5B:%.*]] = tail call i32* @f3(i32* nofree nonnull readonly [[TMP5]]) [[ATTR16:#.*]] -; NOT_CGSCC_NPM-NEXT: [[TMP5C:%.*]] = getelementptr inbounds i32, i32* [[TMP5B]], i64 -1 -; NOT_CGSCC_NPM-NEXT: br label [[BB9]] -; NOT_CGSCC_NPM: bb6: -; NOT_CGSCC_NPM-NEXT: [[TMP7:%.*]] = tail call nonnull i32* @f2(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) [[ATTR16]] -; NOT_CGSCC_NPM-NEXT: ret i32* [[TMP7]] -; NOT_CGSCC_NPM: bb9: -; NOT_CGSCC_NPM-NEXT: [[TMP10:%.*]] = phi i32* [ [[TMP5C]], [[BB4]] ], [ inttoptr (i64 4 to i32*), [[BB:%.*]] ] -; NOT_CGSCC_NPM-NEXT: ret i32* [[TMP10]] +; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly +; IS__TUNIT____-LABEL: define {{[^@]+}}@f1 +; IS__TUNIT____-SAME: (i32* nofree readonly [[ARG:%.*]]) [[ATTR7:#.*]] { +; IS__TUNIT____-NEXT: bb: +; IS__TUNIT____-NEXT: [[TMP:%.*]] = icmp eq i32* [[ARG]], null +; IS__TUNIT____-NEXT: br i1 [[TMP]], label [[BB9:%.*]], label [[BB1:%.*]] +; IS__TUNIT____: bb1: +; IS__TUNIT____-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARG]], align 4 +; IS__TUNIT____-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP2]], 0 +; IS__TUNIT____-NEXT: br i1 [[TMP3]], label [[BB6:%.*]], label [[BB4:%.*]] +; IS__TUNIT____: bb4: +; IS__TUNIT____-NEXT: [[TMP5:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 1 +; IS__TUNIT____-NEXT: [[TMP5B:%.*]] = tail call i32* @f3(i32* nofree nonnull readonly [[TMP5]]) [[ATTR17:#.*]] +; IS__TUNIT____-NEXT: [[TMP5C:%.*]] = getelementptr inbounds i32, i32* [[TMP5B]], i64 -1 +; IS__TUNIT____-NEXT: br label [[BB9]] +; IS__TUNIT____: bb6: +; IS__TUNIT____-NEXT: [[TMP7:%.*]] = tail call nonnull i32* @f2(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) [[ATTR17]] +; IS__TUNIT____-NEXT: ret i32* [[TMP7]] +; IS__TUNIT____: bb9: +; IS__TUNIT____-NEXT: [[TMP10:%.*]] = phi i32* [ [[TMP5C]], [[BB4]] ], [ inttoptr (i64 4 to i32*), [[BB:%.*]] ] +; IS__TUNIT____-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:%.*]]) [[ATTR7:#.*]] { +; 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]]) [[ATTR16:#.*]] +; 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 nonnull i32* @f2(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) [[ATTR16]] +; 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]] ; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f1 @@ -513,12 +568,19 @@ } define internal i32* @f2(i32* %arg) { -; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f2 -; NOT_CGSCC_NPM-SAME: (i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) [[ATTR7]] { -; NOT_CGSCC_NPM-NEXT: bb: -; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = tail call nonnull i32* @f1(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) [[ATTR16]] -; NOT_CGSCC_NPM-NEXT: ret i32* [[TMP]] +; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly +; IS__TUNIT____-LABEL: define {{[^@]+}}@f2 +; IS__TUNIT____-SAME: (i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) [[ATTR7]] { +; IS__TUNIT____-NEXT: bb: +; IS__TUNIT____-NEXT: [[TMP:%.*]] = tail call nonnull i32* @f1(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) [[ATTR17]] +; IS__TUNIT____-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:%.*]]) [[ATTR7]] { +; IS__CGSCC_OPM-NEXT: bb: +; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = tail call nonnull i32* @f1(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) [[ATTR16]] +; IS__CGSCC_OPM-NEXT: ret i32* [[TMP]] ; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f2 @@ -534,12 +596,19 @@ define dso_local noalias i32* @f3(i32* %arg) { ; FIXME: missing nonnull. It should be nonnull @f3(i32* nonnull readonly %arg) -; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f3 -; NOT_CGSCC_NPM-SAME: (i32* nofree readonly [[ARG:%.*]]) [[ATTR7]] { -; NOT_CGSCC_NPM-NEXT: bb: -; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = call nonnull i32* @f1(i32* nofree readonly [[ARG]]) [[ATTR16]] -; NOT_CGSCC_NPM-NEXT: ret i32* [[TMP]] +; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly +; IS__TUNIT____-LABEL: define {{[^@]+}}@f3 +; IS__TUNIT____-SAME: (i32* nofree readonly [[ARG:%.*]]) [[ATTR7]] { +; IS__TUNIT____-NEXT: bb: +; IS__TUNIT____-NEXT: [[TMP:%.*]] = call nonnull i32* @f1(i32* nofree readonly [[ARG]]) [[ATTR17]] +; IS__TUNIT____-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:%.*]]) [[ATTR7]] { +; IS__CGSCC_OPM-NEXT: bb: +; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = call nonnull i32* @f1(i32* nofree readonly [[ARG]]) [[ATTR16]] +; IS__CGSCC_OPM-NEXT: ret i32* [[TMP]] ; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f3 @@ -577,28 +646,40 @@ ; 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_NPM: Function Attrs: nounwind willreturn mustprogress -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f16 -; NOT_CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) [[ATTR9:#.*]] { -; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 -; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; NOT_CGSCC_NPM: if.then: -; NOT_CGSCC_NPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* nonnull [[B]]) [[ATTR8:#.*]] -; NOT_CGSCC_NPM-NEXT: ret void -; NOT_CGSCC_NPM: if.else: -; NOT_CGSCC_NPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) [[ATTR8]] -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nounwind willreturn mustprogress +; IS__TUNIT____: Function Attrs: nounwind willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@f16 +; IS__TUNIT____-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) [[ATTR8:#.*]] { +; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 +; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; IS__TUNIT____: if.then: +; IS__TUNIT____-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* nonnull [[B]]) [[ATTR16]] +; IS__TUNIT____-NEXT: ret void +; IS__TUNIT____: if.else: +; IS__TUNIT____-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) [[ATTR16]] +; IS__TUNIT____-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:%.*]]) [[ATTR8:#.*]] { +; 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]]) [[ATTR15]] +; IS__CGSCC_OPM-NEXT: ret void +; IS__CGSCC_OPM: if.else: +; IS__CGSCC_OPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) [[ATTR15]] +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: nounwind willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f16 -; IS__CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) [[ATTR8:#.*]] { +; IS__CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) [[ATTR7:#.*]] { ; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 ; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; IS__CGSCC_NPM: if.then: -; IS__CGSCC_NPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* nonnull [[B]]) [[ATTR7:#.*]] +; IS__CGSCC_NPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* nonnull [[B]]) [[ATTR14]] ; IS__CGSCC_NPM-NEXT: ret void ; IS__CGSCC_NPM: if.else: -; IS__CGSCC_NPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) [[ATTR14]] ; IS__CGSCC_NPM-NEXT: ret void ; %cmp = icmp eq i8 %c, 0 @@ -618,34 +699,49 @@ ; fun1(nonnull %a) ; We can say that %a is nonnull define void @f17(i8* %a, i8 %c) { -; NOT_CGSCC_NPM: Function Attrs: nounwind willreturn mustprogress -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f17 -; NOT_CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) [[ATTR9]] { -; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 -; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; NOT_CGSCC_NPM: if.then: -; NOT_CGSCC_NPM-NEXT: tail call void @fun0() [[ATTR8]] -; NOT_CGSCC_NPM-NEXT: br label [[CONT:%.*]] -; NOT_CGSCC_NPM: if.else: -; NOT_CGSCC_NPM-NEXT: tail call void @fun0() [[ATTR8]] -; NOT_CGSCC_NPM-NEXT: br label [[CONT]] -; NOT_CGSCC_NPM: cont: -; NOT_CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) [[ATTR8]] -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nounwind willreturn mustprogress +; IS__TUNIT____: Function Attrs: nounwind willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@f17 +; IS__TUNIT____-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) [[ATTR8]] { +; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 +; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; IS__TUNIT____: if.then: +; IS__TUNIT____-NEXT: tail call void @fun0() [[ATTR16]] +; IS__TUNIT____-NEXT: br label [[CONT:%.*]] +; IS__TUNIT____: if.else: +; IS__TUNIT____-NEXT: tail call void @fun0() [[ATTR16]] +; IS__TUNIT____-NEXT: br label [[CONT]] +; IS__TUNIT____: cont: +; IS__TUNIT____-NEXT: tail call void @fun1(i8* nonnull [[A]]) [[ATTR16]] +; IS__TUNIT____-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:%.*]]) [[ATTR8]] { +; 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() [[ATTR15]] +; IS__CGSCC_OPM-NEXT: br label [[CONT:%.*]] +; IS__CGSCC_OPM: if.else: +; IS__CGSCC_OPM-NEXT: tail call void @fun0() [[ATTR15]] +; IS__CGSCC_OPM-NEXT: br label [[CONT]] +; IS__CGSCC_OPM: cont: +; IS__CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) [[ATTR15]] +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: nounwind willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f17 -; IS__CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) [[ATTR8]] { +; IS__CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) [[ATTR7]] { ; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 ; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; IS__CGSCC_NPM: if.then: -; IS__CGSCC_NPM-NEXT: tail call void @fun0() [[ATTR7]] +; IS__CGSCC_NPM-NEXT: tail call void @fun0() [[ATTR14]] ; IS__CGSCC_NPM-NEXT: br label [[CONT:%.*]] ; IS__CGSCC_NPM: if.else: -; IS__CGSCC_NPM-NEXT: tail call void @fun0() [[ATTR7]] +; IS__CGSCC_NPM-NEXT: tail call void @fun0() [[ATTR14]] ; IS__CGSCC_NPM-NEXT: br label [[CONT]] ; IS__CGSCC_NPM: cont: -; IS__CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) [[ATTR14]] ; IS__CGSCC_NPM-NEXT: ret void ; %cmp = icmp eq i8 %c, 0 @@ -672,52 +768,76 @@ ; fun1(nonnull %a) define void @f18(i8* %a, i8* %b, i8 %c) { -; NOT_CGSCC_NPM: Function Attrs: nounwind willreturn mustprogress -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f18 -; NOT_CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) [[ATTR9]] { -; NOT_CGSCC_NPM-NEXT: [[CMP1:%.*]] = icmp eq i8 [[C]], 0 -; NOT_CGSCC_NPM-NEXT: br i1 [[CMP1]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; NOT_CGSCC_NPM: if.then: -; NOT_CGSCC_NPM-NEXT: tail call void @fun0() [[ATTR8]] -; NOT_CGSCC_NPM-NEXT: br label [[CONT:%.*]] -; NOT_CGSCC_NPM: if.else: -; NOT_CGSCC_NPM-NEXT: tail call void @fun0() [[ATTR8]] -; NOT_CGSCC_NPM-NEXT: br label [[CONT]] -; NOT_CGSCC_NPM: cont: -; NOT_CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 1 -; NOT_CGSCC_NPM-NEXT: br i1 [[CMP2]], label [[CONT_THEN:%.*]], label [[CONT_ELSE:%.*]] -; NOT_CGSCC_NPM: cont.then: -; NOT_CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) [[ATTR8]] -; NOT_CGSCC_NPM-NEXT: br label [[CONT2:%.*]] -; NOT_CGSCC_NPM: cont.else: -; NOT_CGSCC_NPM-NEXT: tail call void @fun0() [[ATTR8]] -; NOT_CGSCC_NPM-NEXT: br label [[CONT2]] -; NOT_CGSCC_NPM: cont2: -; NOT_CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) [[ATTR8]] -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nounwind willreturn mustprogress +; IS__TUNIT____: Function Attrs: nounwind willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@f18 +; IS__TUNIT____-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) [[ATTR8]] { +; IS__TUNIT____-NEXT: [[CMP1:%.*]] = icmp eq i8 [[C]], 0 +; IS__TUNIT____-NEXT: br i1 [[CMP1]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; IS__TUNIT____: if.then: +; IS__TUNIT____-NEXT: tail call void @fun0() [[ATTR16]] +; IS__TUNIT____-NEXT: br label [[CONT:%.*]] +; IS__TUNIT____: if.else: +; IS__TUNIT____-NEXT: tail call void @fun0() [[ATTR16]] +; IS__TUNIT____-NEXT: br label [[CONT]] +; IS__TUNIT____: cont: +; IS__TUNIT____-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 1 +; IS__TUNIT____-NEXT: br i1 [[CMP2]], label [[CONT_THEN:%.*]], label [[CONT_ELSE:%.*]] +; IS__TUNIT____: cont.then: +; IS__TUNIT____-NEXT: tail call void @fun1(i8* nonnull [[B]]) [[ATTR16]] +; IS__TUNIT____-NEXT: br label [[CONT2:%.*]] +; IS__TUNIT____: cont.else: +; IS__TUNIT____-NEXT: tail call void @fun0() [[ATTR16]] +; IS__TUNIT____-NEXT: br label [[CONT2]] +; IS__TUNIT____: cont2: +; IS__TUNIT____-NEXT: tail call void @fun1(i8* nonnull [[A]]) [[ATTR16]] +; IS__TUNIT____-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:%.*]]) [[ATTR8]] { +; 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() [[ATTR15]] +; IS__CGSCC_OPM-NEXT: br label [[CONT:%.*]] +; IS__CGSCC_OPM: if.else: +; IS__CGSCC_OPM-NEXT: tail call void @fun0() [[ATTR15]] +; 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]]) [[ATTR15]] +; IS__CGSCC_OPM-NEXT: br label [[CONT2:%.*]] +; IS__CGSCC_OPM: cont.else: +; IS__CGSCC_OPM-NEXT: tail call void @fun0() [[ATTR15]] +; IS__CGSCC_OPM-NEXT: br label [[CONT2]] +; IS__CGSCC_OPM: cont2: +; IS__CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) [[ATTR15]] +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: nounwind willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f18 -; IS__CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) [[ATTR8]] { +; IS__CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) [[ATTR7]] { ; IS__CGSCC_NPM-NEXT: [[CMP1:%.*]] = icmp eq i8 [[C]], 0 ; IS__CGSCC_NPM-NEXT: br i1 [[CMP1]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; IS__CGSCC_NPM: if.then: -; IS__CGSCC_NPM-NEXT: tail call void @fun0() [[ATTR7]] +; IS__CGSCC_NPM-NEXT: tail call void @fun0() [[ATTR14]] ; IS__CGSCC_NPM-NEXT: br label [[CONT:%.*]] ; IS__CGSCC_NPM: if.else: -; IS__CGSCC_NPM-NEXT: tail call void @fun0() [[ATTR7]] +; IS__CGSCC_NPM-NEXT: tail call void @fun0() [[ATTR14]] ; IS__CGSCC_NPM-NEXT: br label [[CONT]] ; IS__CGSCC_NPM: cont: ; IS__CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 1 ; IS__CGSCC_NPM-NEXT: br i1 [[CMP2]], label [[CONT_THEN:%.*]], label [[CONT_ELSE:%.*]] ; IS__CGSCC_NPM: cont.then: -; IS__CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) [[ATTR14]] ; IS__CGSCC_NPM-NEXT: br label [[CONT2:%.*]] ; IS__CGSCC_NPM: cont.else: -; IS__CGSCC_NPM-NEXT: tail call void @fun0() [[ATTR7]] +; IS__CGSCC_NPM-NEXT: tail call void @fun0() [[ATTR14]] ; IS__CGSCC_NPM-NEXT: br label [[CONT2]] ; IS__CGSCC_NPM: cont2: -; IS__CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) [[ATTR14]] ; IS__CGSCC_NPM-NEXT: ret void ; %cmp1 = icmp eq i8 %c, 0 @@ -745,35 +865,20 @@ ; TEST 19: Loop define void @f19(i8* %a, i8* %b, i8 %c) { -; NOT_CGSCC_NPM: Function Attrs: nounwind -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f19 -; NOT_CGSCC_NPM-SAME: (i8* [[A:%.*]], i8* nonnull [[B:%.*]], i8 [[C:%.*]]) [[ATTR6]] { -; NOT_CGSCC_NPM-NEXT: br label [[LOOP_HEADER:%.*]] -; NOT_CGSCC_NPM: loop.header: -; NOT_CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 0 -; NOT_CGSCC_NPM-NEXT: br i1 [[CMP2]], label [[LOOP_BODY:%.*]], label [[LOOP_EXIT:%.*]] -; NOT_CGSCC_NPM: loop.body: -; NOT_CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) [[ATTR6]] -; NOT_CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) [[ATTR6]] -; NOT_CGSCC_NPM-NEXT: br label [[LOOP_HEADER]] -; NOT_CGSCC_NPM: loop.exit: -; NOT_CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) [[ATTR6]] -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nounwind -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f19 -; IS__CGSCC_NPM-SAME: (i8* [[A:%.*]], i8* nonnull [[B:%.*]], i8 [[C:%.*]]) [[ATTR5]] { -; IS__CGSCC_NPM-NEXT: br label [[LOOP_HEADER:%.*]] -; IS__CGSCC_NPM: loop.header: -; IS__CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP2]], label [[LOOP_BODY:%.*]], label [[LOOP_EXIT:%.*]] -; IS__CGSCC_NPM: loop.body: -; IS__CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) [[ATTR5]] -; IS__CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) [[ATTR5]] -; IS__CGSCC_NPM-NEXT: br label [[LOOP_HEADER]] -; IS__CGSCC_NPM: loop.exit: -; IS__CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) [[ATTR5]] -; IS__CGSCC_NPM-NEXT: ret void +; CHECK: Function Attrs: nounwind +; CHECK-LABEL: define {{[^@]+}}@f19 +; CHECK-SAME: (i8* [[A:%.*]], i8* nonnull [[B:%.*]], i8 [[C:%.*]]) [[ATTR5:#.*]] { +; 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]]) +; CHECK-NEXT: tail call void @fun1(i8* nonnull [[A]]) +; CHECK-NEXT: br label [[LOOP_HEADER]] +; CHECK: loop.exit: +; CHECK-NEXT: tail call void @fun1(i8* nonnull [[B]]) +; CHECK-NEXT: ret void ; br label %loop.header loop.header: @@ -906,11 +1011,17 @@ ; The nonnull callsite is guaranteed to execute, so the argument must be nonnull throughout the parent. define i8 @parent7(i8* %a) { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@parent7 -; NOT_CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]]) { -; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = call i8 @use1safecall(i8* nonnull readonly [[A]]) [[ATTR17:#.*]] -; NOT_CGSCC_NPM-NEXT: call void @use1nonnull(i8* nonnull [[A]]) -; NOT_CGSCC_NPM-NEXT: ret i8 [[RET]] +; IS__TUNIT____-LABEL: define {{[^@]+}}@parent7 +; IS__TUNIT____-SAME: (i8* nonnull [[A:%.*]]) { +; IS__TUNIT____-NEXT: [[RET:%.*]] = call i8 @use1safecall(i8* nonnull readonly [[A]]) [[ATTR18:#.*]] +; IS__TUNIT____-NEXT: call void @use1nonnull(i8* nonnull [[A]]) +; IS__TUNIT____-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]]) [[ATTR17:#.*]] +; IS__CGSCC_OPM-NEXT: call void @use1nonnull(i8* nonnull [[A]]) +; IS__CGSCC_OPM-NEXT: ret i8 [[RET]] ; ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@parent7 ; IS__CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]]) { @@ -932,7 +1043,7 @@ define i1 @parent8(i8* %a, i8* %bogus1, i8* %b) personality i8* bitcast (i32 (...)* @esfp to i8*){ ; CHECK: Function Attrs: nounwind ; CHECK-LABEL: define {{[^@]+}}@parent8 -; CHECK-SAME: (i8* nonnull [[A:%.*]], i8* nocapture nofree readnone [[BOGUS1:%.*]], i8* nonnull [[B:%.*]]) [[ATTR5:#.*]] personality i8* bitcast (i32 (...)* @esfp to i8*) { +; CHECK-SAME: (i8* nonnull [[A:%.*]], i8* nocapture nofree readnone [[BOGUS1:%.*]], i8* nonnull [[B:%.*]]) [[ATTR5]] 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:%.*]] @@ -979,13 +1090,13 @@ ; Should't be able to derive nonnull based on gep. ; IS__TUNIT____: Function Attrs: nofree nosync nounwind null_pointer_is_valid readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@gep1_no_null_opt -; IS__TUNIT____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) [[ATTR11:#.*]] { +; IS__TUNIT____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) [[ATTR10:#.*]] { ; 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 null_pointer_is_valid readnone willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@gep1_no_null_opt -; IS__CGSCC____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) [[ATTR10:#.*]] { +; IS__CGSCC____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) [[ATTR9:#.*]] { ; IS__CGSCC____-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 ; IS__CGSCC____-NEXT: ret i32* [[Q]] ; @@ -1036,9 +1147,9 @@ } define i32* @g1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@g1 -; IS__TUNIT____-SAME: () [[ATTR1]] { +; IS__TUNIT____-SAME: () [[ATTR11:#.*]] { ; IS__TUNIT____-NEXT: ret i32* inttoptr (i64 4 to i32*) ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -1052,17 +1163,11 @@ declare void @use_i32_ptr(i32* readnone nocapture) nounwind define internal void @called_by_weak(i32* %a) { -; NOT_CGSCC_NPM: Function Attrs: nounwind -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@called_by_weak -; NOT_CGSCC_NPM-SAME: (i32* noalias nocapture nonnull readnone [[A:%.*]]) [[ATTR6]] { -; NOT_CGSCC_NPM-NEXT: call void @use_i32_ptr(i32* noalias nocapture nonnull readnone [[A]]) [[ATTR6]] -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nounwind -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@called_by_weak -; IS__CGSCC_NPM-SAME: (i32* noalias nocapture nonnull readnone [[A:%.*]]) [[ATTR5]] { -; IS__CGSCC_NPM-NEXT: call void @use_i32_ptr(i32* noalias nocapture nonnull readnone [[A]]) [[ATTR5]] -; IS__CGSCC_NPM-NEXT: ret void +; CHECK: Function Attrs: nounwind +; CHECK-LABEL: define {{[^@]+}}@called_by_weak +; CHECK-SAME: (i32* noalias nocapture nonnull readnone [[A:%.*]]) [[ATTR5]] { +; CHECK-NEXT: call void @use_i32_ptr(i32* noalias nocapture nonnull readnone [[A]]) +; CHECK-NEXT: ret void ; call void @use_i32_ptr(i32* %a) ret void @@ -1070,15 +1175,10 @@ ; Check we do not annotate the function interface of this weak function. define weak_odr void @weak_caller(i32* nonnull %a) { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@weak_caller -; NOT_CGSCC_NPM-SAME: (i32* nonnull [[A:%.*]]) { -; NOT_CGSCC_NPM-NEXT: call void @called_by_weak(i32* noalias nocapture nonnull readnone [[A]]) [[ATTR6]] -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@weak_caller -; IS__CGSCC_NPM-SAME: (i32* nonnull [[A:%.*]]) { -; IS__CGSCC_NPM-NEXT: call void @called_by_weak(i32* noalias nocapture nonnull readnone [[A]]) [[ATTR5]] -; IS__CGSCC_NPM-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]]) +; CHECK-NEXT: ret void ; call void @called_by_weak(i32* %a) ret void @@ -1105,7 +1205,7 @@ define internal void @naked(i32* dereferenceable(4) %a) naked { ; CHECK: Function Attrs: naked ; CHECK-LABEL: define {{[^@]+}}@naked -; CHECK-SAME: (i32* dereferenceable(4) [[A:%.*]]) [[ATTR11:#.*]] { +; CHECK-SAME: (i32* dereferenceable(4) [[A:%.*]]) [[ATTR10:#.*]] { ; CHECK-NEXT: call void @use_i32_ptr(i32* [[A]]) ; CHECK-NEXT: ret void ; @@ -1116,7 +1216,7 @@ define internal void @optnone(i32* dereferenceable(4) %a) optnone noinline { ; CHECK: Function Attrs: noinline optnone ; CHECK-LABEL: define {{[^@]+}}@optnone -; CHECK-SAME: (i32* dereferenceable(4) [[A:%.*]]) [[ATTR12:#.*]] { +; CHECK-SAME: (i32* dereferenceable(4) [[A:%.*]]) [[ATTR11:#.*]] { ; CHECK-NEXT: call void @use_i32_ptr(i32* [[A]]) ; CHECK-NEXT: ret void ; @@ -1124,19 +1224,12 @@ ret void } define void @make_live(i32* nonnull dereferenceable(8) %a) { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@make_live -; NOT_CGSCC_NPM-SAME: (i32* nonnull align 16 dereferenceable(8) [[A:%.*]]) { -; NOT_CGSCC_NPM-NEXT: call void @naked(i32* nonnull align 16 dereferenceable(8) [[A]]) -; NOT_CGSCC_NPM-NEXT: call void @control(i32* noalias nocapture nonnull readnone align 16 dereferenceable(8) [[A]]) [[ATTR6]] -; NOT_CGSCC_NPM-NEXT: call void @optnone(i32* nonnull align 16 dereferenceable(8) [[A]]) -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@make_live -; IS__CGSCC_NPM-SAME: (i32* nonnull align 16 dereferenceable(8) [[A:%.*]]) { -; IS__CGSCC_NPM-NEXT: call void @naked(i32* nonnull align 16 dereferenceable(8) [[A]]) -; IS__CGSCC_NPM-NEXT: call void @control(i32* noalias nocapture nonnull readnone align 16 dereferenceable(8) [[A]]) [[ATTR5]] -; IS__CGSCC_NPM-NEXT: call void @optnone(i32* nonnull align 16 dereferenceable(8) [[A]]) -; IS__CGSCC_NPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@make_live +; CHECK-SAME: (i32* nonnull align 16 dereferenceable(8) [[A:%.*]]) { +; CHECK-NEXT: call void @naked(i32* nonnull align 16 dereferenceable(8) [[A]]) +; CHECK-NEXT: call void @control(i32* noalias nocapture nonnull readnone align 16 dereferenceable(8) [[A]]) +; CHECK-NEXT: call void @optnone(i32* 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) @@ -1162,43 +1255,43 @@ ; 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]]) [[ATTR6]] +; IS________OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) ; 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]]) [[ATTR6]] +; IS________OPM-NEXT: tail call void @h(i32* [[A]]) ; 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__TUNIT_NPM: Function Attrs: nounwind willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nounwind willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1 -; IS__TUNIT_NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) [[ATTR9:#.*]] { +; IS__TUNIT_NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) [[ATTR8:#.*]] { ; IS__TUNIT_NPM-NEXT: en: ; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 ; IS__TUNIT_NPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] ; IS__TUNIT_NPM: ex: -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) [[ATTR8:#.*]] +; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) [[ATTR16:#.*]] ; IS__TUNIT_NPM-NEXT: ret i32 [[TMP5]] ; IS__TUNIT_NPM: hd: ; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; IS__TUNIT_NPM-NEXT: tail call void @h(i32* [[A]]) [[ATTR8]] +; IS__TUNIT_NPM-NEXT: tail call void @h(i32* [[A]]) [[ATTR16]] ; IS__TUNIT_NPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 ; IS__TUNIT_NPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] ; IS__TUNIT_NPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] ; -; IS__CGSCC_NPM: Function Attrs: nounwind willreturn mustprogress +; IS__CGSCC_NPM: Function Attrs: nounwind willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1 -; IS__CGSCC_NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) [[ATTR8]] { +; IS__CGSCC_NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) [[ATTR7]] { ; IS__CGSCC_NPM-NEXT: en: ; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 ; IS__CGSCC_NPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] ; IS__CGSCC_NPM: ex: -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) [[ATTR14]] ; IS__CGSCC_NPM-NEXT: ret i32 [[TMP5]] ; IS__CGSCC_NPM: hd: ; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; IS__CGSCC_NPM-NEXT: tail call void @h(i32* [[A]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: tail call void @h(i32* [[A]]) [[ATTR14]] ; IS__CGSCC_NPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 ; IS__CGSCC_NPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] ; IS__CGSCC_NPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] @@ -1228,47 +1321,47 @@ ; 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]]) [[ATTR6]] +; IS________OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) ; 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]]) [[ATTR6]] +; IS________OPM-NEXT: tail call void @h(i32* [[A]]) ; 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__TUNIT_NPM: Function Attrs: nounwind willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nounwind willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b -; IS__TUNIT_NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) [[ATTR9]] { +; IS__TUNIT_NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) [[ATTR8]] { ; IS__TUNIT_NPM-NEXT: en: ; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 ; IS__TUNIT_NPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] ; IS__TUNIT_NPM: ex: -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) [[ATTR8]] +; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) [[ATTR16]] ; IS__TUNIT_NPM-NEXT: ret i32 [[TMP5]] ; IS__TUNIT_NPM: hd: ; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; IS__TUNIT_NPM-NEXT: tail call void @h(i32* [[A]]) [[ATTR8]] +; IS__TUNIT_NPM-NEXT: tail call void @h(i32* [[A]]) [[ATTR16]] ; IS__TUNIT_NPM-NEXT: br label [[HD2]] ; IS__TUNIT_NPM: hd2: ; IS__TUNIT_NPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 ; IS__TUNIT_NPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] ; IS__TUNIT_NPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] ; -; IS__CGSCC_NPM: Function Attrs: nounwind willreturn mustprogress +; IS__CGSCC_NPM: Function Attrs: nounwind willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b -; IS__CGSCC_NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) [[ATTR8]] { +; IS__CGSCC_NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) [[ATTR7]] { ; IS__CGSCC_NPM-NEXT: en: ; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 ; IS__CGSCC_NPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] ; IS__CGSCC_NPM: ex: -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) [[ATTR14]] ; IS__CGSCC_NPM-NEXT: ret i32 [[TMP5]] ; IS__CGSCC_NPM: hd: ; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; IS__CGSCC_NPM-NEXT: tail call void @h(i32* [[A]]) [[ATTR7]] +; IS__CGSCC_NPM-NEXT: tail call void @h(i32* [[A]]) [[ATTR14]] ; IS__CGSCC_NPM-NEXT: br label [[HD2]] ; IS__CGSCC_NPM: hd2: ; IS__CGSCC_NPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 @@ -1296,34 +1389,50 @@ define i32 @nonnull_exec_ctx_2(i32* %a, i32 %b) willreturn nounwind { ; -; NOT_CGSCC_NPM: Function Attrs: nounwind willreturn mustprogress -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2 -; NOT_CGSCC_NPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) [[ATTR9]] { -; NOT_CGSCC_NPM-NEXT: en: -; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; NOT_CGSCC_NPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; NOT_CGSCC_NPM: ex: -; NOT_CGSCC_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) [[ATTR6]] -; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP5]] -; NOT_CGSCC_NPM: hd: -; NOT_CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; NOT_CGSCC_NPM-NEXT: tail call void @h(i32* nonnull [[A]]) [[ATTR6]] -; NOT_CGSCC_NPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; NOT_CGSCC_NPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; NOT_CGSCC_NPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] +; IS__TUNIT____: Function Attrs: nounwind willreturn mustprogress +; IS__TUNIT____-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2 +; IS__TUNIT____-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) [[ATTR14:#.*]] { +; IS__TUNIT____-NEXT: en: +; IS__TUNIT____-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 +; IS__TUNIT____-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] +; IS__TUNIT____: ex: +; IS__TUNIT____-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) [[ATTR19:#.*]] +; IS__TUNIT____-NEXT: ret i32 [[TMP5]] +; IS__TUNIT____: hd: +; IS__TUNIT____-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] +; IS__TUNIT____-NEXT: tail call void @h(i32* nonnull [[A]]) [[ATTR19]] +; IS__TUNIT____-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 +; IS__TUNIT____-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] +; IS__TUNIT____-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] +; +; IS__CGSCC_OPM: Function Attrs: nounwind willreturn mustprogress +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2 +; IS__CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) [[ATTR13:#.*]] { +; 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]]) [[ATTR18:#.*]] +; 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]]) [[ATTR18]] +; 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]] ; ; IS__CGSCC_NPM: Function Attrs: nounwind willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2 -; IS__CGSCC_NPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) [[ATTR8]] { +; IS__CGSCC_NPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) [[ATTR12:#.*]] { ; IS__CGSCC_NPM-NEXT: en: ; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 ; IS__CGSCC_NPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] ; IS__CGSCC_NPM: ex: -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) [[ATTR5]] +; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) [[ATTR17:#.*]] ; IS__CGSCC_NPM-NEXT: ret i32 [[TMP5]] ; IS__CGSCC_NPM: hd: ; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; IS__CGSCC_NPM-NEXT: tail call void @h(i32* nonnull [[A]]) [[ATTR5]] +; IS__CGSCC_NPM-NEXT: tail call void @h(i32* nonnull [[A]]) [[ATTR17]] ; IS__CGSCC_NPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 ; IS__CGSCC_NPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] ; IS__CGSCC_NPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] @@ -1346,36 +1455,54 @@ define i32 @nonnull_exec_ctx_2b(i32* %a, i32 %b) willreturn nounwind { ; -; NOT_CGSCC_NPM: Function Attrs: nounwind willreturn mustprogress -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b -; NOT_CGSCC_NPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) [[ATTR9]] { -; NOT_CGSCC_NPM-NEXT: en: -; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; NOT_CGSCC_NPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; NOT_CGSCC_NPM: ex: -; NOT_CGSCC_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) [[ATTR6]] -; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP5]] -; NOT_CGSCC_NPM: hd: -; NOT_CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; NOT_CGSCC_NPM-NEXT: tail call void @h(i32* nonnull [[A]]) [[ATTR6]] -; NOT_CGSCC_NPM-NEXT: br label [[HD2]] -; NOT_CGSCC_NPM: hd2: -; NOT_CGSCC_NPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; NOT_CGSCC_NPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; NOT_CGSCC_NPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] +; IS__TUNIT____: Function Attrs: nounwind willreturn mustprogress +; IS__TUNIT____-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b +; IS__TUNIT____-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) [[ATTR14]] { +; IS__TUNIT____-NEXT: en: +; IS__TUNIT____-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 +; IS__TUNIT____-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] +; IS__TUNIT____: ex: +; IS__TUNIT____-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) [[ATTR19]] +; IS__TUNIT____-NEXT: ret i32 [[TMP5]] +; IS__TUNIT____: hd: +; IS__TUNIT____-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] +; IS__TUNIT____-NEXT: tail call void @h(i32* nonnull [[A]]) [[ATTR19]] +; IS__TUNIT____-NEXT: br label [[HD2]] +; IS__TUNIT____: hd2: +; IS__TUNIT____-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 +; IS__TUNIT____-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] +; IS__TUNIT____-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] +; +; IS__CGSCC_OPM: Function Attrs: nounwind willreturn mustprogress +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b +; IS__CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) [[ATTR13]] { +; 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]]) [[ATTR18]] +; 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]]) [[ATTR18]] +; 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]] ; ; IS__CGSCC_NPM: Function Attrs: nounwind willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b -; IS__CGSCC_NPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) [[ATTR8]] { +; IS__CGSCC_NPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) [[ATTR12]] { ; IS__CGSCC_NPM-NEXT: en: ; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 ; IS__CGSCC_NPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] ; IS__CGSCC_NPM: ex: -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) [[ATTR5]] +; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) [[ATTR17]] ; IS__CGSCC_NPM-NEXT: ret i32 [[TMP5]] ; IS__CGSCC_NPM: hd: ; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; IS__CGSCC_NPM-NEXT: tail call void @h(i32* nonnull [[A]]) [[ATTR5]] +; IS__CGSCC_NPM-NEXT: tail call void @h(i32* nonnull [[A]]) [[ATTR17]] ; IS__CGSCC_NPM-NEXT: br label [[HD2]] ; IS__CGSCC_NPM: hd2: ; IS__CGSCC_NPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 @@ -1517,14 +1644,23 @@ ; We should not mark the return of @strrchr as `nonnull`, it may well be NULL! define i8* @mybasename(i8* nofree readonly %str) { -; NOT_CGSCC_NPM: Function Attrs: nofree nounwind readonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@mybasename -; NOT_CGSCC_NPM-SAME: (i8* nofree readonly [[STR:%.*]]) [[ATTR14:#.*]] { -; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i8* @strrchr(i8* nofree readonly [[STR]], i32 noundef 47) [[ATTR17]] -; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i8* [[CALL]], null -; NOT_CGSCC_NPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[CALL]], i64 1 -; NOT_CGSCC_NPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i8* [[ADD_PTR]], i8* [[STR]] -; NOT_CGSCC_NPM-NEXT: ret i8* [[COND]] +; IS__TUNIT____: Function Attrs: nofree nounwind readonly +; IS__TUNIT____-LABEL: define {{[^@]+}}@mybasename +; IS__TUNIT____-SAME: (i8* nofree readonly [[STR:%.*]]) [[ATTR15:#.*]] { +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i8* @strrchr(i8* nofree readonly [[STR]], i32 noundef 47) [[ATTR18]] +; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp ne i8* [[CALL]], null +; IS__TUNIT____-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[CALL]], i64 1 +; IS__TUNIT____-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i8* [[ADD_PTR]], i8* [[STR]] +; IS__TUNIT____-NEXT: ret i8* [[COND]] +; +; IS__CGSCC_OPM: Function Attrs: nofree nounwind readonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@mybasename +; IS__CGSCC_OPM-SAME: (i8* nofree readonly [[STR:%.*]]) [[ATTR14:#.*]] { +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i8* @strrchr(i8* nofree readonly [[STR]], i32 noundef 47) [[ATTR17]] +; 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]] ; ; IS__CGSCC_NPM: Function Attrs: nofree nounwind readonly ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@mybasename @@ -1550,17 +1686,24 @@ ; ATTRIBUTOR-NEXT: [[TMP1:%.*]] = call i8* @unknown() ; ATTRIBUTOR-NEXT: ret void ; -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_assume_pos -; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree nonnull readnone [[ARG:%.*]]) { -; NOT_CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) [[ATTR15]] [ "nonnull"(i8* [[ARG]]) ] -; NOT_CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) [[ATTR6]] -; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i8* @unknown() -; NOT_CGSCC_NPM-NEXT: ret void +; IS__TUNIT____-LABEL: define {{[^@]+}}@nonnull_assume_pos +; IS__TUNIT____-SAME: (i8* nocapture nofree nonnull readnone [[ARG:%.*]]) { +; IS__TUNIT____-NEXT: call void @llvm.assume(i1 noundef true) [[ATTR16]] [ "nonnull"(i8* [[ARG]]) ] +; IS__TUNIT____-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) +; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8* @unknown() +; IS__TUNIT____-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) [[ATTR15]] [ "nonnull"(i8* [[ARG]]) ] +; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) +; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = call i8* @unknown() +; IS__CGSCC_OPM-NEXT: ret void ; ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_assume_pos ; IS__CGSCC_NPM-SAME: (i8* nocapture nofree nonnull readnone [[ARG:%.*]]) { ; IS__CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) [[ATTR14]] [ "nonnull"(i8* [[ARG]]) ] -; IS__CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) [[ATTR5]] +; IS__CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) ; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i8* @unknown() ; IS__CGSCC_NPM-NEXT: ret void ; @@ -1582,29 +1725,17 @@ ; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) ; ATTRIBUTOR-NEXT: ret void ; -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_assume_neg -; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) { -; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i8* @unknown() -; NOT_CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG]]) [[ATTR6]] -; NOT_CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ] -; NOT_CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) [[ATTR6]] -; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = call i8* @unknown() -; NOT_CGSCC_NPM-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) [[ATTR6]] -; NOT_CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ] -; NOT_CGSCC_NPM-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) [[ATTR6]] -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_assume_neg -; IS__CGSCC_NPM-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) { -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i8* @unknown() -; IS__CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG]]) [[ATTR5]] -; IS__CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ] -; IS__CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) [[ATTR5]] -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = call i8* @unknown() -; IS__CGSCC_NPM-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) [[ATTR5]] -; IS__CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ] -; IS__CGSCC_NPM-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) [[ATTR5]] -; IS__CGSCC_NPM-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]]) +; 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]]) +; CHECK-NEXT: [[TMP2:%.*]] = call i8* @unknown() +; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) +; 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]]) +; CHECK-NEXT: ret void ; call i8* @unknown() call void @use_i8_ptr(i8* %arg) 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 @@ -7,27 +7,23 @@ define i32 @leaf() { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@leaf -; IS__TUNIT____-SAME: () [[ATTR0:#.*]] { +; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { ; IS__TUNIT____-NEXT: ret i32 1 ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@leaf -; IS__CGSCC____-SAME: () [[ATTR0:#.*]] { +; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { ; IS__CGSCC____-NEXT: ret i32 1 ; ret i32 1 } define i32 @self_rec() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@self_rec -; IS__TUNIT____-SAME: () [[ATTR1:#.*]] { -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@self_rec -; IS__CGSCC____-SAME: () [[ATTR1:#.*]] { -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree noreturn nosync nounwind readnone +; CHECK-LABEL: define {{[^@]+}}@self_rec +; CHECK-SAME: () #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: [[A:%.*]] = call i32 @self_rec() #[[ATTR1]] +; CHECK-NEXT: unreachable ; %a = call i32 @self_rec() ret i32 4 @@ -36,12 +32,12 @@ define i32 @indirect_rec() { ; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@indirect_rec -; NOT_CGSCC_NPM-SAME: () [[ATTR2:#.*]] { +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { ; NOT_CGSCC_NPM-NEXT: unreachable ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@indirect_rec -; IS__CGSCC_NPM-SAME: () [[ATTR2:#.*]] { +; IS__CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { ; IS__CGSCC_NPM-NEXT: unreachable ; %a = call i32 @indirect_rec2() @@ -50,12 +46,12 @@ define i32 @indirect_rec2() { ; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@indirect_rec2 -; NOT_CGSCC_NPM-SAME: () [[ATTR2]] { +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { ; NOT_CGSCC_NPM-NEXT: unreachable ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@indirect_rec2 -; IS__CGSCC_NPM-SAME: () [[ATTR2]] { +; IS__CGSCC_NPM-SAME: () #[[ATTR2]] { ; IS__CGSCC_NPM-NEXT: unreachable ; %a = call i32 @indirect_rec() @@ -63,11 +59,17 @@ } define i32 @extern() { -; CHECK: Function Attrs: nosync readnone -; CHECK-LABEL: define {{[^@]+}}@extern -; CHECK-SAME: () [[ATTR3:#.*]] { -; CHECK-NEXT: [[A:%.*]] = call i32 @k() -; CHECK-NEXT: ret i32 [[A]] +; NOT_CGSCC_NPM: Function Attrs: nosync readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@extern +; NOT_CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @k() +; NOT_CGSCC_NPM-NEXT: ret i32 [[A]] +; +; IS__CGSCC_NPM: Function Attrs: nosync readnone +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@extern +; IS__CGSCC_NPM-SAME: () #[[ATTR3:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @k() +; IS__CGSCC_NPM-NEXT: ret i32 [[A]] ; %a = call i32 @k() ret i32 %a @@ -80,14 +82,14 @@ define void @intrinsic(i8* %dest, i8* %src, i32 %len) { ; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn mustprogress ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@intrinsic -; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree writeonly [[DEST:%.*]], i8* nocapture nofree readonly [[SRC:%.*]], i32 [[LEN:%.*]]) [[ATTR5:#.*]] { -; NOT_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) [[ATTR11:#.*]] +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree writeonly [[DEST:%.*]], i8* nocapture nofree readonly [[SRC:%.*]], i32 [[LEN:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_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) #[[ATTR10:[0-9]+]] ; NOT_CGSCC_NPM-NEXT: ret void ; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@intrinsic -; IS__CGSCC_NPM-SAME: (i8* nocapture nofree writeonly [[DEST:%.*]], i8* nocapture nofree readonly [[SRC:%.*]], i32 [[LEN:%.*]]) [[ATTR5:#.*]] { -; 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) [[ATTR10:#.*]] +; IS__CGSCC_NPM-SAME: (i8* nocapture nofree writeonly [[DEST:%.*]], i8* nocapture nofree readonly [[SRC:%.*]], i32 [[LEN:%.*]]) #[[ATTR5:[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) #[[ATTR10:[0-9]+]] ; IS__CGSCC_NPM-NEXT: ret void ; call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i1 false) @@ -101,15 +103,21 @@ define internal i32 @called_by_norecurse() { ; IS__TUNIT____: Function Attrs: nosync readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@called_by_norecurse -; IS__TUNIT____-SAME: () [[ATTR3:#.*]] { +; IS__TUNIT____-SAME: () #[[ATTR2]] { ; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @k() ; IS__TUNIT____-NEXT: ret i32 undef ; -; IS__CGSCC____: Function Attrs: norecurse nosync readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@called_by_norecurse -; IS__CGSCC____-SAME: () [[ATTR7:#.*]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = call i32 @k() -; IS__CGSCC____-NEXT: ret i32 undef +; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@called_by_norecurse +; IS__CGSCC_OPM-SAME: () #[[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: () #[[ATTR7:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @k() +; IS__CGSCC_NPM-NEXT: ret i32 undef ; %a = call i32 @k() ret i32 %a @@ -117,26 +125,38 @@ define void @m() norecurse { ; IS__TUNIT____: Function Attrs: norecurse nosync readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@m -; IS__TUNIT____-SAME: () [[ATTR7:#.*]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() [[ATTR3]] +; IS__TUNIT____-SAME: () #[[ATTR6:[0-9]+]] { +; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() #[[ATTR2]] ; IS__TUNIT____-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: norecurse nosync readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@m -; IS__CGSCC____-SAME: () [[ATTR7]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() -; IS__CGSCC____-NEXT: ret void +; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@m +; IS__CGSCC_OPM-SAME: () #[[ATTR6]] { +; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() #[[ATTR3:[0-9]+]] +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: norecurse nosync readnone +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@m +; IS__CGSCC_NPM-SAME: () #[[ATTR7]] { +; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() #[[ATTR4:[0-9]+]] +; IS__CGSCC_NPM-NEXT: ret void ; %a = call i32 @called_by_norecurse() ret void } define internal i32 @called_by_norecurse_indirectly() { -; CHECK: Function Attrs: nosync readnone -; CHECK-LABEL: define {{[^@]+}}@called_by_norecurse_indirectly -; CHECK-SAME: () [[ATTR3]] { -; CHECK-NEXT: [[A:%.*]] = call i32 @k() -; CHECK-NEXT: ret i32 [[A]] +; NOT_CGSCC_NPM: Function Attrs: nosync readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@called_by_norecurse_indirectly +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @k() +; NOT_CGSCC_NPM-NEXT: ret i32 [[A]] +; +; IS__CGSCC_NPM: Function Attrs: nosync readnone +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@called_by_norecurse_indirectly +; IS__CGSCC_NPM-SAME: () #[[ATTR3]] { +; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @k() +; IS__CGSCC_NPM-NEXT: ret i32 [[A]] ; %a = call i32 @k() ret i32 %a @@ -144,15 +164,21 @@ define internal i32 @o() { ; IS__TUNIT____: Function Attrs: nosync readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@o -; IS__TUNIT____-SAME: () [[ATTR3]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() [[ATTR3]] +; IS__TUNIT____-SAME: () #[[ATTR2]] { +; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() #[[ATTR2]] ; IS__TUNIT____-NEXT: ret i32 [[A]] ; -; IS__CGSCC____: Function Attrs: norecurse nosync readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@o -; IS__CGSCC____-SAME: () [[ATTR7]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() -; IS__CGSCC____-NEXT: ret i32 [[A]] +; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@o +; IS__CGSCC_OPM-SAME: () #[[ATTR6]] { +; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() #[[ATTR3]] +; 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: () #[[ATTR7]] { +; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() #[[ATTR4]] +; IS__CGSCC_NPM-NEXT: ret i32 [[A]] ; %a = call i32 @called_by_norecurse_indirectly() ret i32 %a @@ -160,15 +186,21 @@ define i32 @p() norecurse { ; IS__TUNIT____: Function Attrs: norecurse nosync readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@p -; IS__TUNIT____-SAME: () [[ATTR7]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @o() [[ATTR3]] +; IS__TUNIT____-SAME: () #[[ATTR6]] { +; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @o() #[[ATTR2]] ; IS__TUNIT____-NEXT: ret i32 [[A]] ; -; IS__CGSCC____: Function Attrs: norecurse nosync readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@p -; IS__CGSCC____-SAME: () [[ATTR7]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = call i32 @o() -; IS__CGSCC____-NEXT: ret i32 [[A]] +; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@p +; IS__CGSCC_OPM-SAME: () #[[ATTR6]] { +; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @o() #[[ATTR11:[0-9]+]] +; 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: () #[[ATTR7]] { +; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @o() #[[ATTR11:[0-9]+]] +; IS__CGSCC_NPM-NEXT: ret i32 [[A]] ; %a = call i32 @o() ret i32 %a @@ -177,7 +209,7 @@ define void @f(i32 %x) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@f -; IS__TUNIT____-SAME: (i32 [[X:%.*]]) [[ATTR8:#.*]] { +; IS__TUNIT____-SAME: (i32 [[X:%.*]]) #[[ATTR7:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 ; IS__TUNIT____-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 @@ -185,14 +217,14 @@ ; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 ; IS__TUNIT____-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: call void @g() [[ATTR9:#.*]] +; IS__TUNIT____-NEXT: call void @g() #[[ATTR8:[0-9]+]] ; 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 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) [[ATTR8:#.*]] { +; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR7:[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 @@ -206,7 +238,7 @@ ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_NPM-SAME: (i32 [[X:%.*]]) [[ATTR8:#.*]] { +; IS__CGSCC_NPM-SAME: (i32 [[X:%.*]]) #[[ATTR8:[0-9]+]] { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 ; IS__CGSCC_NPM-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 @@ -236,20 +268,20 @@ define void @g() norecurse { ; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@g -; IS__TUNIT____-SAME: () [[ATTR9]] { +; IS__TUNIT____-SAME: () #[[ATTR8]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@g -; IS__CGSCC_OPM-SAME: () [[ATTR9:#.*]] { +; IS__CGSCC_OPM-SAME: () #[[ATTR8:[0-9]+]] { ; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: call void @f(i32 noundef 0) [[ATTR8]] +; IS__CGSCC_OPM-NEXT: call void @f(i32 noundef 0) #[[ATTR7]] ; IS__CGSCC_OPM-NEXT: ret void ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@g -; IS__CGSCC_NPM-SAME: () [[ATTR0:#.*]] { +; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: ret void ; @@ -279,7 +311,7 @@ define i32 @eval_func2(i32 (i32)* , i32) local_unnamed_addr null_pointer_is_valid{ ; CHECK: Function Attrs: null_pointer_is_valid ; CHECK-LABEL: define {{[^@]+}}@eval_func2 -; CHECK-SAME: (i32 (i32)* nocapture nofree [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr [[ATTR9:#.*]] { +; CHECK-SAME: (i32 (i32)* nocapture nofree [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR9:[0-9]+]] { ; CHECK-NEXT: [[TMP3:%.*]] = tail call i32 [[TMP0]](i32 [[TMP1]]) ; CHECK-NEXT: ret i32 [[TMP3]] ; @@ -292,14 +324,14 @@ define i32 @call_unknown_in_dead_block() local_unnamed_addr { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@call_unknown_in_dead_block -; IS__TUNIT____-SAME: () local_unnamed_addr [[ATTR0]] { +; 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 mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@call_unknown_in_dead_block -; IS__CGSCC____-SAME: () local_unnamed_addr [[ATTR0]] { +; IS__CGSCC____-SAME: () local_unnamed_addr #[[ATTR0]] { ; IS__CGSCC____-NEXT: ret i32 0 ; IS__CGSCC____: Dead: ; IS__CGSCC____-NEXT: unreachable @@ -310,3 +342,40 @@ ret i32 1 } +; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn mustprogress } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree noreturn nosync nounwind readnone } +; IS__TUNIT____: attributes #[[ATTR2]] = { nosync readnone } +; IS__TUNIT____: attributes #[[ATTR3:[0-9]+]] = { readnone } +; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn mustprogress } +; IS__TUNIT____: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR6]] = { norecurse nosync readnone } +; IS__TUNIT____: attributes #[[ATTR7]] = { nofree nosync nounwind readnone } +; IS__TUNIT____: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone } +; IS__TUNIT____: attributes #[[ATTR9]] = { null_pointer_is_valid } +; IS__TUNIT____: attributes #[[ATTR10]] = { willreturn } +;. +; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn mustprogress } +; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree noreturn nosync nounwind readnone } +; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nosync readnone } +; IS__CGSCC_OPM: attributes #[[ATTR3]] = { readnone } +; IS__CGSCC_OPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn mustprogress } +; IS__CGSCC_OPM: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR6]] = { norecurse nosync readnone } +; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nofree nosync nounwind readnone } +; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone } +; IS__CGSCC_OPM: attributes #[[ATTR9]] = { null_pointer_is_valid } +; IS__CGSCC_OPM: attributes #[[ATTR10]] = { willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR11]] = { norecurse readnone } +;. +; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn mustprogress } +; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree noreturn nosync nounwind readnone } +; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree norecurse noreturn nosync nounwind readnone willreturn mustprogress } +; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nosync readnone } +; IS__CGSCC_NPM: attributes #[[ATTR4]] = { readnone } +; IS__CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind willreturn mustprogress } +; IS__CGSCC_NPM: attributes #[[ATTR6:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR7]] = { norecurse nosync readnone } +; IS__CGSCC_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR9]] = { null_pointer_is_valid } +; IS__CGSCC_NPM: attributes #[[ATTR10]] = { willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR11]] = { norecurse readnone } 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 @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes -; 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 ; @@ -17,16 +17,18 @@ ; } ; define void @srec0() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable ; IS__TUNIT____-LABEL: define {{[^@]+}}@srec0 ; IS__TUNIT____-SAME: () [[ATTR0:#.*]] { ; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: call void @srec0() [[ATTR2:#.*]] ; IS__TUNIT____-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; IS__CGSCC____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable ; IS__CGSCC____-LABEL: define {{[^@]+}}@srec0 ; IS__CGSCC____-SAME: () [[ATTR0:#.*]] { ; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: call void @srec0() [[ATTR4:#.*]] ; IS__CGSCC____-NEXT: unreachable ; entry: @@ -42,21 +44,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:%.*]]) [[ATTR0]] { -; 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:%.*]]) [[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; CHECK-LABEL: define {{[^@]+}}@srec16 +; CHECK-SAME: (i32 [[A:%.*]]) [[ATTR0:#.*]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: unreachable +; CHECK: exit: +; CHECK-NEXT: unreachable ; entry: %call = call i32 @srec16(i32 %a) @@ -91,7 +85,7 @@ 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:%.*]]) [[ATTR1:#.*]] { +; IS__TUNIT____-SAME: (i32 [[A:%.*]]) [[ATTR0]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: br label [[WHILE_BODY:%.*]] ; IS__TUNIT____: while.body: @@ -124,7 +118,7 @@ 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:%.*]]) [[ATTR1]] { +; IS__TUNIT____-SAME: (i32 [[A:%.*]]) [[ATTR0]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: br label [[WHILE_BODY:%.*]] ; IS__TUNIT____: while.body: @@ -160,7 +154,7 @@ ; } ; define i32 @multiple_noreturn_calls(i32 %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable ; IS__TUNIT____-LABEL: define {{[^@]+}}@multiple_noreturn_calls ; IS__TUNIT____-SAME: (i32 [[A:%.*]]) [[ATTR0]] { ; IS__TUNIT____-NEXT: entry: @@ -210,7 +204,7 @@ define i32 @endless_loop_but_willreturn() willreturn { ; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@endless_loop_but_willreturn -; IS__TUNIT____-SAME: () [[ATTR2:#.*]] { +; IS__TUNIT____-SAME: () [[ATTR1:#.*]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: br label [[WHILE_BODY:%.*]] ; IS__TUNIT____: while.body: @@ -235,7 +229,7 @@ define i32 @UB_and_willreturn() willreturn { ; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@UB_and_willreturn -; IS__TUNIT____-SAME: () [[ATTR2]] { +; IS__TUNIT____-SAME: () [[ATTR1]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: unreachable ; 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 @@ -205,15 +205,17 @@ ; volatile operation in same scc but dead. Call volatile_load defined in TEST 8. define i32 @scc1(i32* %0) noinline nounwind uwtable { -; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@scc1 -; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) [[ATTR5:#.*]] { -; NOT_CGSCC_NPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn mustprogress -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@scc1 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) [[ATTR5:#.*]] { -; IS__CGSCC_NPM-NEXT: unreachable +; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@scc1 +; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) [[ATTR5:#.*]] { +; IS__TUNIT____-NEXT: tail call void @scc2(i32* noalias nocapture nofree readnone undef) [[ATTR19:#.*]] +; IS__TUNIT____-NEXT: unreachable +; +; IS__CGSCC____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@scc1 +; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) [[ATTR5:#.*]] { +; IS__CGSCC____-NEXT: tail call void @scc2(i32* noalias nocapture nofree readnone undef) [[ATTR20:#.*]] +; IS__CGSCC____-NEXT: unreachable ; tail call void @scc2(i32* %0); %val = tail call i32 @volatile_load(i32* %0); @@ -221,15 +223,17 @@ } define void @scc2(i32* %0) noinline nounwind uwtable { -; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@scc2 -; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) [[ATTR5]] { -; NOT_CGSCC_NPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn mustprogress -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@scc2 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) [[ATTR5]] { -; IS__CGSCC_NPM-NEXT: unreachable +; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@scc2 +; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) [[ATTR5]] { +; IS__TUNIT____-NEXT: [[TMP2:%.*]] = tail call i32 @scc1(i32* noalias nocapture nofree readnone undef) [[ATTR19]] +; IS__TUNIT____-NEXT: unreachable +; +; IS__CGSCC____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@scc2 +; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) [[ATTR5]] { +; IS__CGSCC____-NEXT: [[TMP2:%.*]] = tail call i32 @scc1(i32* noalias nocapture nofree readnone undef) [[ATTR20]] +; IS__CGSCC____-NEXT: unreachable ; tail call i32 @scc1(i32* %0); ret void; @@ -404,13 +408,13 @@ ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@memcpy_volatile ; IS__TUNIT____-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) [[ATTR10:#.*]] { -; 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) [[ATTR19:#.*]] +; 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) [[ATTR20:#.*]] ; IS__TUNIT____-NEXT: ret i32 4 ; ; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@memcpy_volatile ; IS__CGSCC____-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) [[ATTR10:#.*]] { -; IS__CGSCC____-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:#.*]] +; IS__CGSCC____-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:#.*]] ; IS__CGSCC____-NEXT: ret i32 4 ; call void @llvm.memcpy(i8* %ptr1, i8* %ptr2, i32 8, i1 1) @@ -425,13 +429,13 @@ ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@memset_non_volatile ; IS__TUNIT____-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) [[ATTR11:#.*]] { -; IS__TUNIT____-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) [[ATTR20:#.*]] +; IS__TUNIT____-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) [[ATTR21:#.*]] ; IS__TUNIT____-NEXT: ret i32 4 ; ; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@memset_non_volatile ; IS__CGSCC____-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) [[ATTR11:#.*]] { -; IS__CGSCC____-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) [[ATTR21:#.*]] +; IS__CGSCC____-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) [[ATTR22:#.*]] ; IS__CGSCC____-NEXT: ret i32 4 ; call void @llvm.memset(i8* %ptr1, i8 %val, i32 8, i1 0) @@ -505,13 +509,13 @@ ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@cos_test2 ; IS__TUNIT____-SAME: (float [[X:%.*]]) [[ATTR15]] { -; IS__TUNIT____-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) [[ATTR19]] +; IS__TUNIT____-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) [[ATTR20]] ; IS__TUNIT____-NEXT: ret float [[C]] ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@cos_test2 ; IS__CGSCC____-SAME: (float [[X:%.*]]) [[ATTR16:#.*]] { -; IS__CGSCC____-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) [[ATTR20]] +; IS__CGSCC____-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) [[ATTR21]] ; IS__CGSCC____-NEXT: ret float [[C]] ; %c = call float @llvm.cos(float %x) diff --git a/llvm/test/Transforms/Attributor/noundef.ll b/llvm/test/Transforms/Attributor/noundef.ll --- a/llvm/test/Transforms/Attributor/noundef.ll +++ b/llvm/test/Transforms/Attributor/noundef.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes -; 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=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/nounwind.ll b/llvm/test/Transforms/Attributor/nounwind.ll --- a/llvm/test/Transforms/Attributor/nounwind.ll +++ b/llvm/test/Transforms/Attributor/nounwind.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes -; 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 @@ -21,15 +21,11 @@ ; TEST 2 define i32 @scc1_foo() { -; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@scc1_foo -; NOT_CGSCC_NPM-SAME: () [[ATTR1:#.*]] { -; NOT_CGSCC_NPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn mustprogress -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@scc1_foo -; IS__CGSCC_NPM-SAME: () [[ATTR1:#.*]] { -; IS__CGSCC_NPM-NEXT: unreachable +; CHECK: Function Attrs: nofree noreturn nosync nounwind readnone +; CHECK-LABEL: define {{[^@]+}}@scc1_foo +; CHECK-SAME: () [[ATTR1:#.*]] { +; CHECK-NEXT: [[TMP1:%.*]] = call i32 @scc1_bar() [[ATTR1]] +; CHECK-NEXT: unreachable ; %1 = call i32 @scc1_bar() ret i32 1 @@ -38,15 +34,11 @@ ; TEST 3 define i32 @scc1_bar() { -; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@scc1_bar -; NOT_CGSCC_NPM-SAME: () [[ATTR1]] { -; NOT_CGSCC_NPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn mustprogress -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@scc1_bar -; IS__CGSCC_NPM-SAME: () [[ATTR1]] { -; IS__CGSCC_NPM-NEXT: unreachable +; CHECK: Function Attrs: nofree noreturn nosync nounwind readnone +; CHECK-LABEL: define {{[^@]+}}@scc1_bar +; CHECK-SAME: () [[ATTR1]] { +; CHECK-NEXT: [[TMP1:%.*]] = call i32 @scc1_foo() [[ATTR1]] +; CHECK-NEXT: unreachable ; %1 = call i32 @scc1_foo() ret i32 1 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,7 +21,7 @@ } define i1 @potential_test1(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test1 ; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR0:#.*]] { ; IS__TUNIT____-NEXT: ret i1 false @@ -70,7 +70,7 @@ } define i32 @potential_test2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test2 ; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR1:#.*]] { ; IS__TUNIT____-NEXT: ret i32 0 @@ -100,7 +100,7 @@ define internal i32 @iszero3(i32 %c) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@iszero3 -; IS__TUNIT____-SAME: (i32 noundef [[C:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i32 noundef [[C:%.*]]) [[ATTR2:#.*]] { ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 ; IS__TUNIT____-NEXT: [[RET:%.*]] = zext i1 [[CMP]] to i32 ; IS__TUNIT____-NEXT: ret i32 [[RET]] @@ -120,7 +120,7 @@ define internal i32 @less_than_two(i32 %c) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@less_than_two -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i32 [[C:%.*]]) [[ATTR2]] { ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp slt i32 [[C]], 2 ; IS__TUNIT____-NEXT: [[RET:%.*]] = zext i1 [[CMP]] to i32 ; IS__TUNIT____-NEXT: ret i32 [[RET]] @@ -140,21 +140,21 @@ define i32 @potential_test3() { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@potential_test3 -; IS__TUNIT_OPM-SAME: () [[ATTR1:#.*]] { -; IS__TUNIT_OPM-NEXT: [[CMP1:%.*]] = call i32 @iszero3(i32 noundef 0) [[ATTR1]] -; IS__TUNIT_OPM-NEXT: [[TRUE1:%.*]] = call i32 @less_than_two(i32 [[CMP1]]) [[ATTR1]] -; IS__TUNIT_OPM-NEXT: [[CMP2:%.*]] = call i32 @iszero3(i32 noundef 1) [[ATTR1]] -; IS__TUNIT_OPM-NEXT: [[TRUE2:%.*]] = call i32 @less_than_two(i32 [[CMP2]]) [[ATTR1]] +; IS__TUNIT_OPM-SAME: () [[ATTR0:#.*]] { +; IS__TUNIT_OPM-NEXT: [[CMP1:%.*]] = call i32 @iszero3(i32 noundef 0) [[ATTR0]] +; IS__TUNIT_OPM-NEXT: [[TRUE1:%.*]] = call i32 @less_than_two(i32 [[CMP1]]) [[ATTR0]] +; IS__TUNIT_OPM-NEXT: [[CMP2:%.*]] = call i32 @iszero3(i32 noundef 1) [[ATTR0]] +; IS__TUNIT_OPM-NEXT: [[TRUE2:%.*]] = call i32 @less_than_two(i32 [[CMP2]]) [[ATTR0]] ; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = add i32 [[TRUE1]], [[TRUE2]] ; IS__TUNIT_OPM-NEXT: ret i32 [[RET]] ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test3 -; IS__TUNIT_NPM-SAME: () [[ATTR1:#.*]] { -; IS__TUNIT_NPM-NEXT: [[CMP1:%.*]] = call i32 @iszero3(i32 noundef 0) [[ATTR1]], [[RNG0:!range !.*]] -; IS__TUNIT_NPM-NEXT: [[TRUE1:%.*]] = call i32 @less_than_two(i32 [[CMP1]]) [[ATTR1]], [[RNG0]] -; IS__TUNIT_NPM-NEXT: [[CMP2:%.*]] = call i32 @iszero3(i32 noundef 1) [[ATTR1]], [[RNG0]] -; IS__TUNIT_NPM-NEXT: [[TRUE2:%.*]] = call i32 @less_than_two(i32 [[CMP2]]) [[ATTR1]], [[RNG0]] +; IS__TUNIT_NPM-SAME: () [[ATTR0:#.*]] { +; IS__TUNIT_NPM-NEXT: [[CMP1:%.*]] = call i32 @iszero3(i32 noundef 0) [[ATTR0]], [[RNG0:!range !.*]] +; IS__TUNIT_NPM-NEXT: [[TRUE1:%.*]] = call i32 @less_than_two(i32 [[CMP1]]) [[ATTR0]], [[RNG0]] +; IS__TUNIT_NPM-NEXT: [[CMP2:%.*]] = call i32 @iszero3(i32 noundef 1) [[ATTR0]], [[RNG0]] +; IS__TUNIT_NPM-NEXT: [[TRUE2:%.*]] = call i32 @less_than_two(i32 [[CMP2]]) [[ATTR0]], [[RNG0]] ; IS__TUNIT_NPM-NEXT: [[RET:%.*]] = add i32 [[TRUE1]], [[TRUE2]] ; IS__TUNIT_NPM-NEXT: ret i32 [[RET]] ; @@ -200,7 +200,7 @@ 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:%.*]]) [[ATTR1]] { +; IS__TUNIT____-SAME: (i32 [[C:%.*]]) [[ATTR0]] { ; IS__TUNIT____-NEXT: ret i32 0 ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn @@ -217,7 +217,7 @@ 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:%.*]]) [[ATTR1]] { +; IS__TUNIT____-SAME: (i32 [[C:%.*]]) [[ATTR0]] { ; IS__TUNIT____-NEXT: ret i32 0 ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn @@ -233,17 +233,17 @@ } define i1 @potential_test6(i32 %c) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@potential_test6 -; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]]) [[ATTR0:#.*]] { -; IS__TUNIT_OPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) [[ATTR1]], [[RNG0:!range !.*]] +; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]]) [[ATTR0]] { +; IS__TUNIT_OPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) [[ATTR0]], [[RNG0:!range !.*]] ; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], 3 ; IS__TUNIT_OPM-NEXT: ret i1 [[RET]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test6 -; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]]) [[ATTR0:#.*]] { -; IS__TUNIT_NPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) [[ATTR1]], [[RNG1:!range !.*]] +; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]]) [[ATTR0]] { +; IS__TUNIT_NPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) [[ATTR0]], [[RNG1:!range !.*]] ; IS__TUNIT_NPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], 3 ; IS__TUNIT_NPM-NEXT: ret i1 [[RET]] ; @@ -267,19 +267,19 @@ } define i1 @potential_test7(i32 %c) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree 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]]) [[ATTR1]], [[RNG0]] -; IS__TUNIT_OPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) [[ATTR1]], [[RNG1:!range !.*]] +; IS__TUNIT_OPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) [[ATTR0]], [[RNG0]] +; IS__TUNIT_OPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) [[ATTR0]], [[RNG1:!range !.*]] ; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] ; IS__TUNIT_OPM-NEXT: ret i1 [[RET]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nofree 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]], [[RNG1]] -; IS__TUNIT_NPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) [[ATTR1]], [[RNG2:!range !.*]] +; IS__TUNIT_NPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) [[ATTR0]], [[RNG1]] +; IS__TUNIT_NPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) [[ATTR0]], [[RNG2:!range !.*]] ; IS__TUNIT_NPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] ; IS__TUNIT_NPM-NEXT: ret i1 [[RET]] ; @@ -308,7 +308,7 @@ define internal i32 @return1or3(i32 %c) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@return1or3 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i32 [[C:%.*]]) [[ATTR2]] { ; 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]] @@ -339,7 +339,7 @@ define internal i32 @return3or4(i32 %c) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@return3or4 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i32 [[C:%.*]]) [[ATTR2]] { ; 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]] @@ -383,7 +383,7 @@ define i1 @potential_test8() { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test8 -; IS__TUNIT____-SAME: () [[ATTR1]] { +; IS__TUNIT____-SAME: () [[ATTR0]] { ; IS__TUNIT____-NEXT: ret i1 false ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -402,7 +402,7 @@ define i1 @potential_test9() { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@potential_test9 -; IS__TUNIT_OPM-SAME: () [[ATTR2:#.*]] { +; IS__TUNIT_OPM-SAME: () [[ATTR1:#.*]] { ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: br label [[COND:%.*]] ; IS__TUNIT_OPM: cond: @@ -421,7 +421,7 @@ ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test9 -; IS__TUNIT_NPM-SAME: () [[ATTR0]] { +; IS__TUNIT_NPM-SAME: () [[ATTR2:#.*]] { ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: br label [[COND:%.*]] ; IS__TUNIT_NPM: cond: @@ -512,7 +512,7 @@ define i1 @potential_test10(i32 %c) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test10 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) [[ATTR1]] { +; IS__TUNIT____-SAME: (i32 [[C:%.*]]) [[ATTR0]] { ; IS__TUNIT____-NEXT: ret i1 false ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -528,7 +528,7 @@ define i32 @optimize_undef_1(i1 %c) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@optimize_undef_1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR2]] { ; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT____: t: ; IS__TUNIT____-NEXT: ret i32 0 @@ -555,7 +555,7 @@ define i32 @optimize_undef_2(i1 %c) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@optimize_undef_2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR2]] { ; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT____: t: ; IS__TUNIT____-NEXT: ret i32 0 @@ -582,7 +582,7 @@ define i32 @optimize_undef_3(i1 %c) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@optimize_undef_3 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR2]] { ; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT____: t: ; IS__TUNIT____-NEXT: ret i32 0 @@ -612,18 +612,18 @@ define i32 @potential_test11(i1 %c) { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@potential_test11 -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) [[ATTR1]] { -; IS__TUNIT_OPM-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) [[ATTR1]], [[RNG2:!range !.*]] -; IS__TUNIT_OPM-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) [[ATTR1]], [[RNG3:!range !.*]] +; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) [[ATTR0]] { +; IS__TUNIT_OPM-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) [[ATTR0]], [[RNG2:!range !.*]] +; IS__TUNIT_OPM-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) [[ATTR0]], [[RNG3:!range !.*]] ; IS__TUNIT_OPM-NEXT: [[ACC1:%.*]] = add i32 [[ZERO1]], [[ZERO2]] ; IS__TUNIT_OPM-NEXT: [[ACC2:%.*]] = add i32 [[ACC1]], 0 ; IS__TUNIT_OPM-NEXT: ret i32 [[ACC2]] ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test11 -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) [[ATTR1]] { -; IS__TUNIT_NPM-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) [[ATTR1]], [[RNG0]] -; IS__TUNIT_NPM-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) [[ATTR1]], [[RNG3:!range !.*]] +; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) [[ATTR0]] { +; IS__TUNIT_NPM-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) [[ATTR0]], [[RNG0]] +; IS__TUNIT_NPM-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) [[ATTR0]], [[RNG3:!range !.*]] ; IS__TUNIT_NPM-NEXT: [[ACC1:%.*]] = add i32 [[ZERO1]], [[ZERO2]] ; IS__TUNIT_NPM-NEXT: [[ACC2:%.*]] = add i32 [[ACC1]], 0 ; IS__TUNIT_NPM-NEXT: ret i32 [[ACC2]] @@ -659,7 +659,7 @@ define i32 @optimize_poison_1(i1 %c) { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@optimize_poison_1 -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) [[ATTR0]] { +; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) [[ATTR2:#.*]] { ; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT_OPM: t: ; IS__TUNIT_OPM-NEXT: ret i32 0 @@ -668,7 +668,7 @@ ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@optimize_poison_1 -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) [[ATTR0]] { +; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) [[ATTR2]] { ; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT_NPM: t: ; IS__TUNIT_NPM-NEXT: ret i32 0 @@ -703,15 +703,15 @@ ; FIXME: returned value can be simplified to 0 define i32 @potential_test12(i1 %c) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; 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]]) [[ATTR1]], [[RNG3]] +; IS__TUNIT_OPM-NEXT: [[ZERO:%.*]] = call noundef i32 @optimize_poison_1(i1 [[C]]) [[ATTR0]], [[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:%.*]]) [[ATTR1]] { +; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) [[ATTR0]] { ; IS__TUNIT_NPM-NEXT: ret i32 0 ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -737,7 +737,7 @@ define internal i32 @potential_test13_callee(i32 %c) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test13_callee -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i32 [[C:%.*]]) [[ATTR2]] { ; IS__TUNIT____-NEXT: [[RET:%.*]] = and i32 [[C]], 3 ; IS__TUNIT____-NEXT: ret i32 [[RET]] ; @@ -752,16 +752,16 @@ } define i32 @potential_test13_caller1() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree 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) [[ATTR1]], [[RNG2]] +; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 0) [[ATTR0]], [[RNG2]] ; IS__TUNIT_OPM-NEXT: ret i32 [[RET]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nofree 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]], [[RNG0]] +; IS__TUNIT_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 0) [[ATTR0]], [[RNG0]] ; IS__TUNIT_NPM-NEXT: ret i32 [[RET]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -781,16 +781,16 @@ } define i32 @potential_test13_caller2() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree 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) [[ATTR1]], [[RNG2]] +; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 1) [[ATTR0]], [[RNG2]] ; IS__TUNIT_OPM-NEXT: ret i32 [[RET]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nofree 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]], [[RNG0]] +; IS__TUNIT_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 1) [[ATTR0]], [[RNG0]] ; IS__TUNIT_NPM-NEXT: ret i32 [[RET]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -810,16 +810,16 @@ } define i32 @potential_test13_caller3() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree 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) [[ATTR1]], [[RNG2]] +; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) [[ATTR0]], [[RNG2]] ; IS__TUNIT_OPM-NEXT: ret i32 [[RET]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nofree 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]], [[RNG0]] +; IS__TUNIT_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) [[ATTR0]], [[RNG0]] ; IS__TUNIT_NPM-NEXT: ret i32 [[RET]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -841,7 +841,7 @@ define i1 @potential_test14(i1 %c0, i1 %c1, i1 %c2, i1 %c3) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test14 -; IS__TUNIT____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) [[ATTR2]] { ; 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 @@ -870,7 +870,7 @@ define i1 @potential_test15(i1 %c0, i1 %c1) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test15 -; IS__TUNIT____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) [[ATTR2]] { ; IS__TUNIT____-NEXT: ret i1 false ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -887,7 +887,7 @@ define i1 @potential_test16(i1 %c0, i1 %c1) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test16 -; IS__TUNIT____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) [[ATTR2]] { ; IS__TUNIT____-NEXT: ret i1 false ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress 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 @@ -24,15 +24,15 @@ } define i32 @test0-range-check(i32* %p) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test0-range-check -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { +; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: [[A:%.*]] = tail call i32 @test0(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR5:[0-9]+]], !range [[RNG0]] ; IS__TUNIT_OPM-NEXT: ret i32 [[A]] ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test0-range-check -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { +; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: [[A:%.*]] = tail call i32 @test0(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR4:[0-9]+]], !range [[RNG0]] ; IS__TUNIT_NPM-NEXT: ret i32 [[A]] ; @@ -363,16 +363,16 @@ define i1 @test1-check(i32* %p) { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test1-check -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { +; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR1]] { ; IS__TUNIT_OPM-NEXT: [[RES:%.*]] = tail call i32 @test1(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR5]], !range [[RNG2:![0-9]+]] ; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 500 ; IS__TUNIT_OPM-NEXT: ret i1 [[CMP]] ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test1-check -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { +; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR1]] { ; IS__TUNIT_NPM-NEXT: [[RES:%.*]] = tail call i32 @test1(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR4]], !range [[RNG2:![0-9]+]] ; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 500 ; IS__TUNIT_NPM-NEXT: ret i1 [[CMP]] @@ -435,9 +435,9 @@ } define i32 @test2_check(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn mustprogress +; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test2_check -; IS__TUNIT____-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: br label [[IF_THEN:%.*]] ; IS__TUNIT____: if.then: @@ -505,7 +505,7 @@ define internal i32 @r1(i32) local_unnamed_addr { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@r1 -; IS__TUNIT_OPM-SAME: () local_unnamed_addr #[[ATTR1:[0-9]+]] { +; IS__TUNIT_OPM-SAME: () local_unnamed_addr #[[ATTR2:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: br label [[TMP4:%.*]] ; IS__TUNIT_OPM: 1: ; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[TMP7:%.*]], 10000 @@ -580,7 +580,7 @@ define void @f1(i32){ ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@f1 ; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]]) { -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = tail call i32 @r1() #[[ATTR1]] +; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = tail call i32 @r1() #[[ATTR2]] ; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP2]], 15 ; IS__TUNIT_OPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP5:%.*]] ; IS__TUNIT_OPM: 4: @@ -591,7 +591,7 @@ ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f1 -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { +; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR2:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: br label [[TMP3:%.*]] ; IS__TUNIT_NPM: 2: ; IS__TUNIT_NPM-NEXT: unreachable @@ -643,7 +643,7 @@ define dso_local i32 @test4-f1(i32 %u) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@test4-f1 -; IS__TUNIT____-SAME: (i32 [[U:%.*]]) #[[ATTR2:[0-9]+]] { +; IS__TUNIT____-SAME: (i32 [[U:%.*]]) #[[ATTR3:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 ; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] @@ -692,18 +692,18 @@ define dso_local i32 @test4-g1(i32 %u) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test4-g1 -; IS__TUNIT_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { +; IS__TUNIT_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR4:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR3:[0-9]+]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR4]] ; IS__TUNIT_OPM-NEXT: ret i32 [[CALL]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test4-g1 ; IS__TUNIT_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { ; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR1]] +; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR2]] ; IS__TUNIT_NPM-NEXT: ret i32 [[CALL]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -738,7 +738,7 @@ define dso_local i32 @test4-f2(i32 %u) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@test4-f2 -; IS__TUNIT____-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { +; IS__TUNIT____-SAME: (i32 [[U:%.*]]) #[[ATTR3]] { ; 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:%.*]] @@ -799,18 +799,18 @@ define dso_local i32 @test4-g2(i32 %u) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test4-g2 -; IS__TUNIT_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { +; IS__TUNIT_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR4]] { ; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR3]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR4]] ; IS__TUNIT_OPM-NEXT: ret i32 [[CALL]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test4-g2 ; IS__TUNIT_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { ; 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: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR2]], !range [[RNG3:![0-9]+]] ; IS__TUNIT_NPM-NEXT: ret i32 [[CALL]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -906,7 +906,7 @@ define dso_local zeroext i1 @phi(i32 %arg) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@phi -; IS__TUNIT____-SAME: (i32 [[ARG:%.*]]) #[[ATTR2]] { +; IS__TUNIT____-SAME: (i32 [[ARG:%.*]]) #[[ATTR3]] { ; IS__TUNIT____-NEXT: bb: ; IS__TUNIT____-NEXT: [[TMP:%.*]] = icmp sgt i32 [[ARG]], 5 ; IS__TUNIT____-NEXT: br i1 [[TMP]], label [[BB1:%.*]], label [[BB2:%.*]] @@ -1024,7 +1024,7 @@ define dso_local i1 @select(i32 %a) local_unnamed_addr #0 { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@select -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR2]] { +; IS__TUNIT____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR3]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: ret i1 false ; @@ -1053,7 +1053,7 @@ define dso_local i32 @select_zext(i32 %a) local_unnamed_addr #0 { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@select_zext -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR2]] { +; IS__TUNIT____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR3]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: ret i32 0 ; @@ -1084,7 +1084,7 @@ define dso_local i64 @select_int2ptr_bitcast_ptr2int(i32 %a) local_unnamed_addr #0 { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@select_int2ptr_bitcast_ptr2int -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR2]] { +; IS__TUNIT____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR3]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[I2P:%.*]] = inttoptr i1 false to i1* ; IS__TUNIT____-NEXT: [[BC:%.*]] = bitcast i1* [[I2P]] to i32* @@ -1127,7 +1127,7 @@ define i1 @f_fcmp(float %a, float %b) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@f_fcmp -; IS__TUNIT____-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR2]] { +; IS__TUNIT____-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR3]] { ; 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]] @@ -1153,7 +1153,7 @@ define i1 @d_fcmp(double %a, double %b) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@d_fcmp -; IS__TUNIT____-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR2]] { +; IS__TUNIT____-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR3]] { ; 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]] @@ -1179,7 +1179,7 @@ define i1 @dp_icmp(double* %a, double* %b) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@dp_icmp -; IS__TUNIT____-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone [[B:%.*]]) #[[ATTR2]] { +; IS__TUNIT____-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone [[B:%.*]]) #[[ATTR3]] { ; 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]] @@ -1205,7 +1205,7 @@ define i1 @ip_icmp(i8* %a, i8* %b) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@ip_icmp -; IS__TUNIT____-SAME: (i8* nofree readnone [[A:%.*]], i8* nofree readnone [[B:%.*]]) #[[ATTR2]] { +; IS__TUNIT____-SAME: (i8* nofree readnone [[A:%.*]], i8* nofree readnone [[B:%.*]]) #[[ATTR3]] { ; 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]] @@ -1229,25 +1229,25 @@ ret i1 %s } define i1 @fcmp_caller(float %fa, float %fb, double %da, double %db, double* %dpa, double* %dpb, i8* %ipa, i8* %ipb) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fcmp_caller -; IS__TUNIT_OPM-SAME: (float [[FA:%.*]], float [[FB:%.*]], double [[DA:%.*]], double [[DB:%.*]], double* nofree readnone [[DPA:%.*]], double* nofree readnone [[DPB:%.*]], i8* nofree readnone [[IPA:%.*]], i8* nofree readnone [[IPB:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR3]] -; IS__TUNIT_OPM-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR3]] -; IS__TUNIT_OPM-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR3]] -; IS__TUNIT_OPM-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR3]] +; 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:%.*]]) #[[ATTR4]] { +; IS__TUNIT_OPM-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR4]] +; IS__TUNIT_OPM-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR4]] +; IS__TUNIT_OPM-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR4]] +; IS__TUNIT_OPM-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR4]] ; IS__TUNIT_OPM-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] ; IS__TUNIT_OPM-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] ; IS__TUNIT_OPM-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] ; IS__TUNIT_OPM-NEXT: ret i1 [[O3]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fcmp_caller ; IS__TUNIT_NPM-SAME: (float [[FA:%.*]], float [[FB:%.*]], double [[DA:%.*]], double [[DB:%.*]], double* nofree readnone [[DPA:%.*]], double* nofree readnone [[DPB:%.*]], i8* nofree readnone [[IPA:%.*]], i8* nofree readnone [[IPB:%.*]]) #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR1]] -; IS__TUNIT_NPM-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR1]] -; IS__TUNIT_NPM-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR1]] -; IS__TUNIT_NPM-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR1]] +; IS__TUNIT_NPM-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR2]] +; IS__TUNIT_NPM-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR2]] +; IS__TUNIT_NPM-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR2]] +; IS__TUNIT_NPM-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR2]] ; IS__TUNIT_NPM-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] ; IS__TUNIT_NPM-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] ; IS__TUNIT_NPM-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] @@ -1290,7 +1290,7 @@ define i8 @ret_two() { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_two -; IS__TUNIT____-SAME: () #[[ATTR2]] { +; IS__TUNIT____-SAME: () #[[ATTR3]] { ; IS__TUNIT____-NEXT: ret i8 2 ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -1308,7 +1308,7 @@ define i8 @ret_undef() { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_undef -; IS__TUNIT____-SAME: () #[[ATTR2]] { +; IS__TUNIT____-SAME: () #[[ATTR3]] { ; IS__TUNIT____-NEXT: ret i8 undef ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -1328,12 +1328,12 @@ define i8 @undef_collapse_1() { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@undef_collapse_1 -; IS__TUNIT_OPM-SAME: () #[[ATTR3]] { +; IS__TUNIT_OPM-SAME: () #[[ATTR4]] { ; IS__TUNIT_OPM-NEXT: ret i8 0 ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@undef_collapse_1 -; IS__TUNIT_NPM-SAME: () #[[ATTR1]] { +; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { ; IS__TUNIT_NPM-NEXT: ret i8 0 ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -1353,10 +1353,15 @@ ; 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 mustprogress -; IS__TUNIT____-LABEL: define {{[^@]+}}@undef_collapse_2 -; IS__TUNIT____-SAME: () #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret i8 0 +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@undef_collapse_2 +; IS__TUNIT_OPM-SAME: () #[[ATTR4]] { +; IS__TUNIT_OPM-NEXT: ret i8 0 +; +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@undef_collapse_2 +; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { +; IS__TUNIT_NPM-NEXT: ret i8 0 ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@undef_collapse_2 @@ -1377,12 +1382,12 @@ ; ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@undef_collapse_caller -; IS__TUNIT_OPM-SAME: () #[[ATTR3]] { +; IS__TUNIT_OPM-SAME: () #[[ATTR4]] { ; IS__TUNIT_OPM-NEXT: ret i8 0 ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@undef_collapse_caller -; IS__TUNIT_NPM-SAME: () #[[ATTR1]] { +; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { ; IS__TUNIT_NPM-NEXT: ret i8 0 ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -1404,7 +1409,7 @@ define i32 @ret1or2(i1 %c) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@ret1or2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { ; IS__TUNIT____-NEXT: [[S:%.*]] = select i1 [[C]], i32 1, i32 2 ; IS__TUNIT____-NEXT: ret i32 [[S]] ; @@ -1427,12 +1432,12 @@ ; ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callee_range_1 -; IS__TUNIT_OPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR3]] { +; IS__TUNIT_OPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR4]] { ; IS__TUNIT_OPM-NEXT: ret i1 true ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee_range_1 -; IS__TUNIT_NPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR1]] { +; IS__TUNIT_NPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR2]] { ; IS__TUNIT_NPM-NEXT: ret i1 true ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn @@ -1457,22 +1462,22 @@ define i1 @callee_range_2(i1 %c1, i1 %c2) { ; -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callee_range_2 -; IS__TUNIT_OPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR3]], !range [[RNG4:![0-9]+]] -; IS__TUNIT_OPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR3]], !range [[RNG4]] +; IS__TUNIT_OPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR4]] { +; IS__TUNIT_OPM-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR4]], !range [[RNG4:![0-9]+]] +; IS__TUNIT_OPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR4]], !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: [[I2:%.*]] = icmp sge i32 [[A]], 2 ; IS__TUNIT_OPM-NEXT: [[F:%.*]] = and i1 [[I1]], [[I2]] ; IS__TUNIT_OPM-NEXT: ret i1 [[F]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; 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:%.*]]) #[[ATTR2]] { -; 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: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR2]], !range [[RNG5:![0-9]+]] +; IS__TUNIT_NPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR2]], !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: [[I2:%.*]] = icmp sge i32 [[A]], 2 @@ -1514,7 +1519,7 @@ define i32 @ret100() { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@ret100 -; IS__TUNIT____-SAME: () #[[ATTR2]] { +; IS__TUNIT____-SAME: () #[[ATTR3]] { ; IS__TUNIT____-NEXT: ret i32 100 ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -1532,9 +1537,9 @@ define i1 @ctx_adjustment(i32 %V) { ; -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@ctx_adjustment -; IS__TUNIT_OPM-SAME: (i32 [[V:%.*]]) #[[ATTR2]] { +; IS__TUNIT_OPM-SAME: (i32 [[V:%.*]]) #[[ATTR4]] { ; 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: @@ -1546,7 +1551,7 @@ ; 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 mustprogress +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@ctx_adjustment ; IS__TUNIT_NPM-SAME: (i32 [[V:%.*]]) #[[ATTR2]] { ; IS__TUNIT_NPM-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 @@ -1601,7 +1606,7 @@ define i32 @func(i1 %c) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@func -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { ; IS__TUNIT____-NEXT: [[RET:%.*]] = select i1 [[C]], i32 0, i32 1 ; IS__TUNIT____-NEXT: ret i32 [[RET]] ; @@ -1622,28 +1627,28 @@ } define i32 @simplify_callsite_argument(i1 %d) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@simplify_callsite_argument -; IS__TUNIT_OPM-SAME: (i1 [[D:%.*]]) #[[ATTR2]] { +; IS__TUNIT_OPM-SAME: (i1 [[D:%.*]]) #[[ATTR4]] { ; IS__TUNIT_OPM-NEXT: [[C:%.*]] = select i1 [[D]], i1 true, i1 false ; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT_OPM: t: -; IS__TUNIT_OPM-NEXT: [[RET1:%.*]] = call i32 @func(i1 noundef [[C]]) #[[ATTR3]], !range [[RNG3]] +; IS__TUNIT_OPM-NEXT: [[RET1:%.*]] = call i32 @func(i1 noundef [[C]]) #[[ATTR4]], !range [[RNG3]] ; IS__TUNIT_OPM-NEXT: ret i32 [[RET1]] ; IS__TUNIT_OPM: f: -; IS__TUNIT_OPM-NEXT: [[RET2:%.*]] = call i32 @func(i1 noundef false) #[[ATTR3]], !range [[RNG3]] +; IS__TUNIT_OPM-NEXT: [[RET2:%.*]] = call i32 @func(i1 noundef false) #[[ATTR4]], !range [[RNG3]] ; IS__TUNIT_OPM-NEXT: ret i32 [[RET2]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@simplify_callsite_argument ; IS__TUNIT_NPM-SAME: (i1 [[D:%.*]]) #[[ATTR2]] { ; 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 i32 @func(i1 noundef true) #[[ATTR1]], !range [[RNG4]] +; IS__TUNIT_NPM-NEXT: [[RET1:%.*]] = call i32 @func(i1 noundef true) #[[ATTR2]], !range [[RNG4]] ; IS__TUNIT_NPM-NEXT: ret i32 [[RET1]] ; IS__TUNIT_NPM: f: -; IS__TUNIT_NPM-NEXT: [[RET2:%.*]] = call i32 @func(i1 noundef false) #[[ATTR1]], !range [[RNG4]] +; IS__TUNIT_NPM-NEXT: [[RET2:%.*]] = call i32 @func(i1 noundef false) #[[ATTR2]], !range [[RNG4]] ; IS__TUNIT_NPM-NEXT: ret i32 [[RET2]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -1683,7 +1688,7 @@ define internal i32 @less_than_65536(i32 %arg) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@less_than_65536 -; IS__TUNIT____-SAME: (i32 [[ARG:%.*]]) #[[ATTR2]] { +; IS__TUNIT____-SAME: (i32 [[ARG:%.*]]) #[[ATTR3]] { ; IS__TUNIT____-NEXT: [[SHRINKED:%.*]] = udiv i32 [[ARG]], 65536 ; IS__TUNIT____-NEXT: ret i32 [[SHRINKED]] ; @@ -1706,7 +1711,7 @@ define internal i1 @is_less_than_65536(i32 %arg) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@is_less_than_65536 -; IS__TUNIT____-SAME: (i32 [[ARG:%.*]]) #[[ATTR2]] { +; IS__TUNIT____-SAME: (i32 [[ARG:%.*]]) #[[ATTR3]] { ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp ult i32 [[ARG]], 65536 ; IS__TUNIT____-NEXT: ret i1 [[CMP]] ; @@ -1730,21 +1735,21 @@ define i1 @check_divided_range(i32 %arg) { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@check_divided_range -; IS__TUNIT_OPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: [[CSRET1:%.*]] = call i32 @less_than_65536(i32 noundef 0) #[[ATTR3]] -; IS__TUNIT_OPM-NEXT: [[CSRET2:%.*]] = call i32 @less_than_65536(i32 [[ARG]]) #[[ATTR3]] -; IS__TUNIT_OPM-NEXT: [[TRUE1:%.*]] = call i1 @is_less_than_65536(i32 [[CSRET1]]) #[[ATTR3]] -; IS__TUNIT_OPM-NEXT: [[TRUE2:%.*]] = call i1 @is_less_than_65536(i32 [[CSRET2]]) #[[ATTR3]] +; IS__TUNIT_OPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR4]] { +; IS__TUNIT_OPM-NEXT: [[CSRET1:%.*]] = call i32 @less_than_65536(i32 noundef 0) #[[ATTR4]] +; IS__TUNIT_OPM-NEXT: [[CSRET2:%.*]] = call i32 @less_than_65536(i32 [[ARG]]) #[[ATTR4]] +; IS__TUNIT_OPM-NEXT: [[TRUE1:%.*]] = call i1 @is_less_than_65536(i32 [[CSRET1]]) #[[ATTR4]] +; IS__TUNIT_OPM-NEXT: [[TRUE2:%.*]] = call i1 @is_less_than_65536(i32 [[CSRET2]]) #[[ATTR4]] ; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = and i1 [[TRUE1]], [[TRUE2]] ; IS__TUNIT_OPM-NEXT: ret i1 [[RET]] ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@check_divided_range -; IS__TUNIT_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: [[CSRET1:%.*]] = call i32 @less_than_65536(i32 noundef 0) #[[ATTR1]], !range [[RNG6:![0-9]+]] -; IS__TUNIT_NPM-NEXT: [[CSRET2:%.*]] = call i32 @less_than_65536(i32 [[ARG]]) #[[ATTR1]], !range [[RNG6]] -; IS__TUNIT_NPM-NEXT: [[TRUE1:%.*]] = call i1 @is_less_than_65536(i32 [[CSRET1]]) #[[ATTR1]] -; IS__TUNIT_NPM-NEXT: [[TRUE2:%.*]] = call i1 @is_less_than_65536(i32 [[CSRET2]]) #[[ATTR1]] +; IS__TUNIT_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR2]] { +; IS__TUNIT_NPM-NEXT: [[CSRET1:%.*]] = call i32 @less_than_65536(i32 noundef 0) #[[ATTR2]], !range [[RNG6:![0-9]+]] +; IS__TUNIT_NPM-NEXT: [[CSRET2:%.*]] = call i32 @less_than_65536(i32 [[ARG]]) #[[ATTR2]], !range [[RNG6]] +; IS__TUNIT_NPM-NEXT: [[TRUE1:%.*]] = call i1 @is_less_than_65536(i32 [[CSRET1]]) #[[ATTR2]] +; IS__TUNIT_NPM-NEXT: [[TRUE2:%.*]] = call i1 @is_less_than_65536(i32 [[CSRET2]]) #[[ATTR2]] ; IS__TUNIT_NPM-NEXT: [[RET:%.*]] = and i1 [[TRUE1]], [[TRUE2]] ; IS__TUNIT_NPM-NEXT: ret i1 [[RET]] ; @@ -1779,7 +1784,7 @@ define internal i32 @cast_and_return(i1 %c) { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@cast_and_return -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { +; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { ; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = zext i1 [[C]] to i32 ; IS__TUNIT_OPM-NEXT: ret i32 [[RET]] ; @@ -1800,7 +1805,7 @@ define internal i1 @is_less_than_3(i32 %c) { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@is_less_than_3 -; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { +; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR3]] { ; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[C]], 3 ; IS__TUNIT_OPM-NEXT: ret i1 [[CMP]] ; @@ -1822,16 +1827,16 @@ define i1 @check_casted_range(i1 %c) { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@check_casted_range -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: [[CSRET1:%.*]] = call i32 @cast_and_return(i1 noundef true) #[[ATTR3]] -; IS__TUNIT_OPM-NEXT: [[CSRET2:%.*]] = call i32 @cast_and_return(i1 [[C]]) #[[ATTR3]] +; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { +; IS__TUNIT_OPM-NEXT: [[CSRET1:%.*]] = call i32 @cast_and_return(i1 noundef true) #[[ATTR4]] +; IS__TUNIT_OPM-NEXT: [[CSRET2:%.*]] = call i32 @cast_and_return(i1 [[C]]) #[[ATTR4]] ; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = add i32 [[CSRET1]], [[CSRET2]] -; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = call i1 @is_less_than_3(i32 [[ADD]]) #[[ATTR3]] +; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = call i1 @is_less_than_3(i32 [[ADD]]) #[[ATTR4]] ; IS__TUNIT_OPM-NEXT: ret i1 [[RET]] ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@check_casted_range -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { ; IS__TUNIT_NPM-NEXT: ret i1 true ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn @@ -1953,12 +1958,12 @@ define i1 @propagate_range1(i32 %c){ ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@propagate_range1 -; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR3]] { +; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR4]] { ; IS__TUNIT_OPM-NEXT: ret i1 true ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@propagate_range1 -; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { ; IS__TUNIT_NPM-NEXT: ret i1 true ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -1979,7 +1984,7 @@ define internal i32 @less_than_100_2(i32 %c) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@less_than_100_2 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { +; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR3]] { ; IS__TUNIT____-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ ; IS__TUNIT____-NEXT: i32 0, label [[ONZERO:%.*]] ; IS__TUNIT____-NEXT: i32 1, label [[ONONE:%.*]] @@ -2092,7 +2097,7 @@ define internal i1 @is_less_than_100_2(i32 %c) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@is_less_than_100_2 -; IS__TUNIT____-SAME: (i32 noundef [[C:%.*]]) #[[ATTR2]] { +; IS__TUNIT____-SAME: (i32 noundef [[C:%.*]]) #[[ATTR3]] { ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp slt i32 [[C]], 100 ; IS__TUNIT____-NEXT: ret i1 [[CMP]] ; @@ -2114,21 +2119,21 @@ define i1 @propagate_range2(i32 %c) { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@propagate_range2 -; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: [[CSRET1:%.*]] = call noundef i32 @less_than_100_2(i32 noundef 0) #[[ATTR3]], !range [[RNG5:![0-9]+]] -; IS__TUNIT_OPM-NEXT: [[TRUE1:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET1]]) #[[ATTR3]] -; IS__TUNIT_OPM-NEXT: [[CSRET2:%.*]] = call noundef i32 @less_than_100_2(i32 [[C]]) #[[ATTR3]], !range [[RNG5]] -; IS__TUNIT_OPM-NEXT: [[TRUE2:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET2]]) #[[ATTR3]] +; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR4]] { +; IS__TUNIT_OPM-NEXT: [[CSRET1:%.*]] = call noundef i32 @less_than_100_2(i32 noundef 0) #[[ATTR4]], !range [[RNG5:![0-9]+]] +; IS__TUNIT_OPM-NEXT: [[TRUE1:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET1]]) #[[ATTR4]] +; IS__TUNIT_OPM-NEXT: [[CSRET2:%.*]] = call noundef i32 @less_than_100_2(i32 [[C]]) #[[ATTR4]], !range [[RNG5]] +; IS__TUNIT_OPM-NEXT: [[TRUE2:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET2]]) #[[ATTR4]] ; IS__TUNIT_OPM-NEXT: [[TRUE:%.*]] = and i1 [[TRUE1]], [[TRUE2]] ; IS__TUNIT_OPM-NEXT: ret i1 [[TRUE]] ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@propagate_range2 -; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: [[CSRET1:%.*]] = call noundef i32 @less_than_100_2(i32 noundef 0) #[[ATTR1]], !range [[RNG7:![0-9]+]] -; IS__TUNIT_NPM-NEXT: [[TRUE1:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET1]]) #[[ATTR1]] -; IS__TUNIT_NPM-NEXT: [[CSRET2:%.*]] = call noundef i32 @less_than_100_2(i32 [[C]]) #[[ATTR1]], !range [[RNG7]] -; IS__TUNIT_NPM-NEXT: [[TRUE2:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET2]]) #[[ATTR1]] +; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { +; IS__TUNIT_NPM-NEXT: [[CSRET1:%.*]] = call noundef i32 @less_than_100_2(i32 noundef 0) #[[ATTR2]], !range [[RNG7:![0-9]+]] +; IS__TUNIT_NPM-NEXT: [[TRUE1:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET1]]) #[[ATTR2]] +; IS__TUNIT_NPM-NEXT: [[CSRET2:%.*]] = call noundef i32 @less_than_100_2(i32 [[C]]) #[[ATTR2]], !range [[RNG7]] +; IS__TUNIT_NPM-NEXT: [[TRUE2:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET2]]) #[[ATTR2]] ; IS__TUNIT_NPM-NEXT: [[TRUE:%.*]] = and i1 [[TRUE1]], [[TRUE2]] ; IS__TUNIT_NPM-NEXT: ret i1 [[TRUE]] ; @@ -2153,7 +2158,7 @@ define internal i1 @non_zero(i8 %v) { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@non_zero -; IS__TUNIT_OPM-SAME: (i8 [[V:%.*]]) #[[ATTR2]] { +; IS__TUNIT_OPM-SAME: (i8 [[V:%.*]]) #[[ATTR3]] { ; IS__TUNIT_OPM-NEXT: [[R:%.*]] = icmp ne i8 [[V]], 0 ; IS__TUNIT_OPM-NEXT: ret i1 [[R]] ; @@ -2176,19 +2181,19 @@ define i1 @context(i8* %p) { ; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@context -; IS__TUNIT_OPM-SAME: (i8* nocapture nofree nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR4:[0-9]+]] { +; IS__TUNIT_OPM-SAME: (i8* nocapture nofree nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR1]] { ; 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]]) #[[ATTR3]] +; IS__TUNIT_OPM-NEXT: [[R:%.*]] = call i1 @non_zero(i8 [[L]]) #[[ATTR4]] ; 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 nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR3:[0-9]+]] { +; IS__TUNIT_NPM-SAME: (i8* nocapture nofree nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR1]] { ; 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:%.*]] 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 @@ -37,22 +37,22 @@ define i32* @external_ret2_nrw(i32* %n0, i32* %r0, i32* %w0) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind ; IS__TUNIT____-LABEL: define {{[^@]+}}@external_ret2_nrw -; IS__TUNIT____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) [[ATTR0:#.*]] { +; IS__TUNIT____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree [[W0]]) [[ATTR2:#.*]] -; 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 [[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]]) #[[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 [[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: 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 nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree returned [[W0:%.*]]) [[ATTR0:#.*]] { +; IS__CGSCC____-SAME: (i32* nofree [[N0:%.*]], i32* nofree nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree [[W0]]) [[ATTR2:#.*]] -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rrw(i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) [[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) [[ATTR3:#.*]] -; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32* @internal_ret1_rw(i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) [[ATTR2]] +; 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 nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR3:[0-9]+]] +; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32* @internal_ret1_rw(i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] ; IS__CGSCC____-NEXT: ret i32* [[CALL3]] ; entry: @@ -66,7 +66,7 @@ define internal i32* @internal_ret0_nw(i32* %n0, i32* %w0) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind ; IS__TUNIT____-LABEL: define {{[^@]+}}@internal_ret0_nw -; IS__TUNIT____-SAME: (i32* nofree returned [[N0:%.*]], i32* nofree [[W0:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i32* nofree returned [[N0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[R0:%.*]] = alloca i32, align 4 ; IS__TUNIT____-NEXT: [[R1:%.*]] = alloca i32, align 4 @@ -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]]) #[[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: br label [[RETURN]] ; IS__TUNIT____: return: ; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL5]], [[IF_END]] ], [ [[N0]], [[IF_THEN]] ] @@ -91,7 +91,7 @@ ; ; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind ; IS__CGSCC____-LABEL: define {{[^@]+}}@internal_ret0_nw -; IS__CGSCC____-SAME: (i32* nofree returned [[N0:%.*]], i32* nofree [[W0:%.*]]) [[ATTR0]] { +; IS__CGSCC____-SAME: (i32* nofree returned [[N0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: [[R0:%.*]] = alloca i32, align 4 ; IS__CGSCC____-NEXT: [[R1:%.*]] = alloca i32, align 4 @@ -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]]) #[[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: br label [[RETURN]] ; IS__CGSCC____: return: ; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL5]], [[IF_END]] ], [ [[N0]], [[IF_THEN]] ] @@ -143,7 +143,7 @@ define internal i32* @internal_ret1_rrw(i32* %r0, i32* %r1, i32* %w0) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind ; IS__TUNIT____-LABEL: define {{[^@]+}}@internal_ret1_rrw -; IS__TUNIT____-SAME: (i32* nofree nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree returned [[R1:%.*]], i32* nofree [[W0:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i32* nofree nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree returned [[R1:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 ; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 @@ -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 nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) [[ATTR2]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rw(i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] ; 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 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 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 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 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 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]]) #[[ATTR2]] +; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree 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 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 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 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 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: br label [[RETURN]] ; IS__TUNIT____: return: ; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL8]], [[IF_END]] ], [ [[R1]], [[IF_THEN]] ] @@ -171,7 +171,7 @@ ; ; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind ; IS__CGSCC____-LABEL: define {{[^@]+}}@internal_ret1_rrw -; IS__CGSCC____-SAME: (i32* nofree nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree nonnull returned align 4 dereferenceable(4) [[R1:%.*]], i32* nofree [[W0:%.*]]) [[ATTR0]] { +; IS__CGSCC____-SAME: (i32* nofree nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree nonnull returned align 4 dereferenceable(4) [[R1:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 ; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 @@ -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 nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) [[ATTR2]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rw(i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] ; 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 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 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 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 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 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]]) #[[ATTR2]] +; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree 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 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 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 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 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: br label [[RETURN]] ; IS__CGSCC____: return: ; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL8]], [[IF_END]] ], [ [[R1]], [[IF_THEN]] ] @@ -229,7 +229,7 @@ define i32* @external_sink_ret2_nrw(i32* %n0, i32* %r0, i32* %w0) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn mustprogress ; 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:#.*]] { +; 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:%.*]] @@ -244,7 +244,7 @@ ; ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn mustprogress ; 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:#.*]] { +; 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:%.*]] @@ -276,7 +276,7 @@ define internal i32* @internal_ret1_rw(i32* %r0, i32* %w0) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind ; IS__TUNIT____-LABEL: define {{[^@]+}}@internal_ret1_rw -; IS__TUNIT____-SAME: (i32* nofree nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree returned [[W0:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i32* nofree nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 ; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 @@ -284,13 +284,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 nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) [[ATTR2]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] ; 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 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 nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree 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 nonnull align 4 dereferenceable(4) [[R0]], i32* nofree 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 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 nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree 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 nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] ; IS__TUNIT____-NEXT: br label [[RETURN]] ; IS__TUNIT____: return: ; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL4]], [[IF_END]] ], [ [[W0]], [[IF_THEN]] ] @@ -298,7 +298,7 @@ ; ; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind ; IS__CGSCC____-LABEL: define {{[^@]+}}@internal_ret1_rw -; IS__CGSCC____-SAME: (i32* nofree nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree returned [[W0:%.*]]) [[ATTR0]] { +; IS__CGSCC____-SAME: (i32* nofree nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 ; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 @@ -306,13 +306,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 nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) [[ATTR2]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] ; 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 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 nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree 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_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree 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 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 nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree 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_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] ; IS__CGSCC____-NEXT: br label [[RETURN]] ; IS__CGSCC____: return: ; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL4]], [[IF_END]] ], [ [[W0]], [[IF_THEN]] ] @@ -344,18 +344,18 @@ define i32* @external_source_ret2_nrw(i32* %n0, i32* %r0, i32* %w0) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind ; IS__TUNIT____-LABEL: define {{[^@]+}}@external_source_ret2_nrw -; IS__TUNIT____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0]] { ; 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:#.*]] -; 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]]) #[[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: ret i32* [[CALL1]] ; ; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind ; IS__CGSCC____-LABEL: define {{[^@]+}}@external_source_ret2_nrw -; IS__CGSCC____-SAME: (i32* nofree [[N0:%.*]], i32* nofree align 4 [[R0:%.*]], i32* nofree returned [[W0:%.*]]) [[ATTR0]] { +; IS__CGSCC____-SAME: (i32* nofree [[N0:%.*]], i32* nofree align 4 [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0]] { ; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = 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:#.*]] -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree align 4 [[R0]], i32* nofree [[W0]]) [[ATTR3]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = 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: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree align 4 [[R0]], i32* nofree [[W0]]) ; IS__CGSCC____-NEXT: ret i32* [[CALL1]] ; entry: @@ -371,8 +371,8 @@ ; IS__CGSCC____: attributes #{{.*}} = { argmemonly nofree nosync nounwind } ; IS__CGSCC____: attributes #{{.*}} = { argmemonly nofree norecurse nosync nounwind willreturn mustprogress } ; IS__CGSCC____: attributes #{{.*}} = { nofree nosync nounwind } -; IS__CGSCC____: attributes #{{.*}} = { nounwind } -; IS__CGSCC____: attributes #{{.*}} = { nounwind willreturn } +; IS__CGSCC____: attributes #{{.*}} = { nounwind mustprogress } +; IS__CGSCC____: attributes #{{.*}} = { nounwind willreturn mustprogress } ; IS__CGSCC____-NOT: attributes # ; IS__TUNIT____-NOT: attributes # 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 @@ -135,9 +135,9 @@ } define void @test8_2(i32* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@test8_2 -; IS__TUNIT____-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) [[ATTR0]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) [[ATTR4:#.*]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @test8_1(i32* noalias nofree readnone "no-capture-maybe-returned" [[P]]) [[ATTR12:#.*]] ; IS__TUNIT____-NEXT: store i32 10, i32* [[CALL]], align 4 @@ -214,17 +214,11 @@ 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:%.*]]) [[ATTR8:#.*]] { -; IS__TUNIT____-NEXT: [[RES:%.*]] = call <4 x i32> @test12_1(<4 x i32*> [[PTRS]]) [[ATTR15:#.*]] -; 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:%.*]]) [[ATTR9:#.*]] { -; IS__CGSCC____-NEXT: [[RES:%.*]] = call <4 x i32> @test12_1(<4 x i32*> [[PTRS]]) [[ATTR16:#.*]] -; IS__CGSCC____-NEXT: ret <4 x i32> [[RES]] +; CHECK: Function Attrs: argmemonly nounwind +; CHECK-LABEL: define {{[^@]+}}@test12_2 +; CHECK-SAME: (<4 x i32*> [[PTRS:%.*]]) [[ATTR9:#.*]] { +; CHECK-NEXT: [[RES:%.*]] = call <4 x i32> @test12_1(<4 x i32*> [[PTRS]]) +; CHECK-NEXT: ret <4 x i32> [[RES]] ; %res = call <4 x i32> @test12_1(<4 x i32*> %ptrs) ret <4 x i32> %res 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 @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=8 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=8 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM +; RUN: opt -attributor -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 ; @@ -55,13 +55,21 @@ } define i32 @scc_r1(i32 %a, i32 %r, i32 %b) #0 { -; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; CHECK-LABEL: define {{[^@]+}}@scc_r1 -; CHECK-SAME: (i32 [[A:%.*]], i32 returned [[R:%.*]], i32 [[B:%.*]]) [[ATTR1:#.*]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32 @sink_r0(i32 [[R]]) [[ATTR6:#.*]] -; CHECK-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[CALL]]) [[ATTR7:#.*]] -; CHECK-NEXT: ret i32 [[CALL1]] +; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@scc_r1 +; IS__TUNIT____-SAME: (i32 [[A:%.*]], i32 returned [[R:%.*]], i32 [[B:%.*]]) [[ATTR1:#.*]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32 @sink_r0(i32 [[R]]) [[ATTR7:#.*]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[CALL]]) [[ATTR8:#.*]] +; IS__TUNIT____-NEXT: ret i32 [[CALL1]] +; +; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@scc_r1 +; IS__CGSCC____-SAME: (i32 [[A:%.*]], i32 returned [[R:%.*]], i32 [[B:%.*]]) [[ATTR1:#.*]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32 @sink_r0(i32 [[R]]) [[ATTR6:#.*]] +; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[CALL]]) [[ATTR7:#.*]] +; IS__CGSCC____-NEXT: ret i32 [[CALL1]] ; entry: %call = call i32 @sink_r0(i32 %r) @@ -72,25 +80,25 @@ define i32 @scc_r2(i32 %a, i32 %b, i32 %r) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable ; IS__TUNIT____-LABEL: define {{[^@]+}}@scc_r2 -; IS__TUNIT____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 returned [[R:%.*]]) [[ATTR1:#.*]] { +; IS__TUNIT____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 returned [[R:%.*]]) [[ATTR1]] { ; 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: [[CALL:%.*]] = call i32 @sink_r0(i32 [[R]]) [[ATTR6:#.*]] -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[CALL]]) [[ATTR7:#.*]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32 @sink_r0(i32 [[R]]) [[ATTR7]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[CALL]]) [[ATTR8]] ; 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: [[CALL4:%.*]] = call i32 @sink_r0(i32 [[B]]) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[CALL6]], i32 undef) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[CALL5]], i32 [[CALL7]], i32 [[CALL8]]) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[CALL4]], i32 [[CALL9]], i32 undef) [[ATTR7]] +; IS__TUNIT____-NEXT: [[CALL4:%.*]] = call i32 @sink_r0(i32 [[B]]) [[ATTR8]] +; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) [[ATTR8]] +; 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 [[CALL6]], 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 [[CALL5]], i32 [[CALL7]], i32 [[CALL8]]) [[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[CALL4]], i32 [[CALL9]], i32 undef) [[ATTR9]] ; IS__TUNIT____-NEXT: br label [[RETURN]] ; IS__TUNIT____: if.end12: ; IS__TUNIT____-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] @@ -98,7 +106,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]]) [[ATTR7]] +; IS__TUNIT____-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) [[ATTR8]] ; IS__TUNIT____-NEXT: br label [[COND_END]] ; IS__TUNIT____: cond.end: ; IS__TUNIT____-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[CALL14]], [[COND_FALSE]] ] @@ -109,13 +117,13 @@ ; ; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable ; IS__CGSCC____-LABEL: define {{[^@]+}}@scc_r2 -; IS__CGSCC____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 returned [[R:%.*]]) [[ATTR1:#.*]] { +; 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: [[CALL:%.*]] = call i32 @sink_r0(i32 [[R]]) [[ATTR6:#.*]] -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[CALL]]) [[ATTR7:#.*]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32 @sink_r0(i32 [[R]]) [[ATTR6]] +; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[CALL]]) [[ATTR7]] ; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] ; IS__CGSCC____: if.end: ; IS__CGSCC____-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] @@ -123,11 +131,11 @@ ; IS__CGSCC____: if.then3: ; IS__CGSCC____-NEXT: [[CALL4:%.*]] = call i32 @sink_r0(i32 [[B]]) ; 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 [[CALL6]], 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 [[CALL5]], i32 [[CALL7]], i32 [[CALL8]]) [[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[CALL4]], i32 [[CALL9]], i32 undef) [[ATTR7]] +; IS__CGSCC____-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) [[ATTR8:#.*]] +; IS__CGSCC____-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[CALL6]], i32 undef) [[ATTR8]] +; IS__CGSCC____-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) [[ATTR8]] +; IS__CGSCC____-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[CALL5]], i32 [[CALL7]], i32 [[CALL8]]) [[ATTR8]] +; IS__CGSCC____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[CALL4]], i32 [[CALL9]], i32 undef) [[ATTR8]] ; IS__CGSCC____-NEXT: br label [[RETURN]] ; IS__CGSCC____: if.end12: ; IS__CGSCC____-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] @@ -196,20 +204,20 @@ ; 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: [[CALL:%.*]] = call i32 @sink_r0(i32 [[R]]) [[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[CALL]]) [[ATTR7]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32 @sink_r0(i32 [[R]]) [[ATTR7]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[CALL]]) [[ATTR8]] ; 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: [[CALL4:%.*]] = call i32 @sink_r0(i32 [[B]]) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[CALL6]], i32 undef) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[CALL5]], i32 [[CALL7]], i32 [[CALL8]]) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[CALL4]], i32 [[CALL9]], i32 undef) [[ATTR7]] +; IS__TUNIT____-NEXT: [[CALL4:%.*]] = call i32 @sink_r0(i32 [[B]]) [[ATTR8]] +; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) [[ATTR8]] +; 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 [[CALL6]], 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 [[CALL5]], i32 [[CALL7]], i32 [[CALL8]]) [[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[CALL4]], i32 [[CALL9]], i32 undef) [[ATTR9]] ; IS__TUNIT____-NEXT: br label [[RETURN]] ; IS__TUNIT____: if.end12: ; IS__TUNIT____-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] @@ -217,7 +225,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]]) [[ATTR7]] +; IS__TUNIT____-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) [[ATTR8]] ; IS__TUNIT____-NEXT: br label [[COND_END]] ; IS__TUNIT____: cond.end: ; IS__TUNIT____-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[CALL14]], [[COND_FALSE]] ] @@ -346,13 +354,21 @@ } define double* @ptr_scc_r1(double* %a, double* %r, double* %b) #0 { -; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; CHECK-LABEL: define {{[^@]+}}@ptr_scc_r1 -; CHECK-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone returned [[R:%.*]], double* nocapture nofree readnone [[B:%.*]]) [[ATTR1]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call double* @ptr_sink_r0(double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) [[ATTR6]] -; CHECK-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[R]], double* noalias nofree readnone [[A]], double* noalias nofree readnone [[CALL]]) [[ATTR7]] -; CHECK-NEXT: ret double* [[CALL1]] +; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@ptr_scc_r1 +; IS__TUNIT____-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone returned [[R:%.*]], double* nocapture nofree readnone [[B:%.*]]) [[ATTR1]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call double* @ptr_sink_r0(double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) [[ATTR7]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[R]], double* noalias nofree readnone [[A]], double* noalias nofree readnone [[CALL]]) [[ATTR8]] +; IS__TUNIT____-NEXT: ret double* [[CALL1]] +; +; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@ptr_scc_r1 +; IS__CGSCC____-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone returned [[R:%.*]], double* nocapture nofree readnone [[B:%.*]]) [[ATTR1]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call double* @ptr_sink_r0(double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) [[ATTR6]] +; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[R]], double* noalias nofree readnone [[A]], double* noalias nofree readnone [[CALL]]) [[ATTR7]] +; IS__CGSCC____-NEXT: ret double* [[CALL1]] ; entry: %call = call double* @ptr_sink_r0(double* %r) @@ -368,20 +384,20 @@ ; 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: [[CALL:%.*]] = call double* @ptr_sink_r0(double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) [[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[B]], double* noalias nofree readnone [[A]], double* noalias nofree readnone [[CALL]]) [[ATTR7]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call double* @ptr_sink_r0(double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) [[ATTR7]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[B]], double* noalias nofree readnone [[A]], double* noalias nofree readnone [[CALL]]) [[ATTR8]] ; 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: [[CALL4:%.*]] = call double* @ptr_sink_r0(double* noalias nofree readnone "no-capture-maybe-returned" [[B]]) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call double* @ptr_scc_r1(double* noalias nofree readnone [[A]], double* noalias nofree readnone [[B]], double* noalias nocapture nofree readnone undef) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[R]], double* noalias nofree readnone [[R]], double* noalias nofree readnone [[R]]) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nofree readnone [[A]], double* noalias nofree readnone [[CALL6]], double* noalias nocapture nofree readnone undef) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[A]], double* noalias nofree readnone [[B]], double* noalias nofree readnone [[R]]) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[CALL5]], double* noalias nofree readnone [[CALL7]], double* noalias nofree readnone [[CALL8]]) [[ATTR7]] -; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nofree readnone [[CALL4]], double* noalias nofree readnone [[CALL9]], double* noalias nocapture nofree readnone undef) [[ATTR7]] +; IS__TUNIT____-NEXT: [[CALL4:%.*]] = call double* @ptr_sink_r0(double* noalias nofree readnone "no-capture-maybe-returned" [[B]]) [[ATTR8]] +; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call double* @ptr_scc_r1(double* noalias nofree readnone [[A]], double* noalias nofree readnone [[B]], double* noalias nocapture nofree readnone undef) [[ATTR8]] +; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[R]], double* noalias nofree readnone [[R]], double* noalias nofree readnone [[R]]) [[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nofree readnone [[A]], double* noalias nofree readnone [[CALL6]], double* noalias nocapture nofree readnone undef) [[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[A]], double* noalias nofree readnone [[B]], double* noalias nofree readnone [[R]]) [[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[CALL5]], double* noalias nofree readnone [[CALL7]], double* noalias nofree readnone [[CALL8]]) [[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nofree readnone [[CALL4]], double* noalias nofree readnone [[CALL9]], 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]] @@ -389,7 +405,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 nofree readnone [[A]], double* noalias nofree readnone [[B]], double* noalias nofree readnone [[R]]) [[ATTR7]] +; IS__TUNIT____-NEXT: [[CALL14:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[A]], double* noalias nofree readnone [[B]], double* noalias nofree readnone [[R]]) [[ATTR8]] ; IS__TUNIT____-NEXT: br label [[COND_END]] ; IS__TUNIT____: cond.end: ; IS__TUNIT____-NEXT: [[COND:%.*]] = phi double* [ [[R]], [[COND_TRUE]] ], [ [[CALL14]], [[COND_FALSE]] ] @@ -414,11 +430,11 @@ ; IS__CGSCC____: if.then3: ; IS__CGSCC____-NEXT: [[CALL4:%.*]] = call double* @ptr_sink_r0(double* noalias nofree readnone "no-capture-maybe-returned" [[B]]) ; IS__CGSCC____-NEXT: [[CALL5:%.*]] = call double* @ptr_scc_r1(double* noalias nofree readnone [[A]], double* noalias nofree readnone [[B]], double* noalias nocapture nofree readnone undef) [[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[R]], double* noalias nofree readnone [[R]], double* noalias nofree readnone [[R]]) [[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nofree readnone [[A]], double* noalias nofree readnone [[CALL6]], double* noalias nocapture nofree readnone undef) [[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[A]], double* noalias nofree readnone [[B]], double* noalias nofree readnone [[R]]) [[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[CALL5]], double* noalias nofree readnone [[CALL7]], double* noalias nofree readnone [[CALL8]]) [[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nofree readnone [[CALL4]], double* noalias nofree readnone [[CALL9]], double* noalias nocapture nofree readnone undef) [[ATTR7]] +; IS__CGSCC____-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[R]], double* noalias nofree readnone [[R]], double* noalias nofree readnone [[R]]) [[ATTR8]] +; IS__CGSCC____-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nofree readnone [[A]], double* noalias nofree readnone [[CALL6]], double* noalias nocapture nofree readnone undef) [[ATTR8]] +; IS__CGSCC____-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[A]], double* noalias nofree readnone [[B]], double* noalias nofree readnone [[R]]) [[ATTR8]] +; IS__CGSCC____-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nofree readnone [[CALL5]], double* noalias nofree readnone [[CALL7]], double* noalias nofree readnone [[CALL8]]) [[ATTR8]] +; IS__CGSCC____-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nofree readnone [[CALL4]], double* noalias nofree readnone [[CALL9]], double* noalias nocapture nofree readnone undef) [[ATTR8]] ; IS__CGSCC____-NEXT: br label [[RETURN]] ; IS__CGSCC____: if.end12: ; IS__CGSCC____-NEXT: [[CMP13:%.*]] = icmp eq double* [[A]], [[B]] @@ -487,17 +503,11 @@ ; } ; define i32* @rt0(i32* %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@rt0 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) [[ATTR2:#.*]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@rt0 -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) [[ATTR2:#.*]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; CHECK-LABEL: define {{[^@]+}}@rt0 +; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) [[ATTR2:#.*]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: unreachable ; entry: %v = load i32, i32* %a, align 4 @@ -514,17 +524,11 @@ ; } ; define i32* @rt1(i32* %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@rt1 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) [[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@rt1 -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) [[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; CHECK: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; CHECK-LABEL: define {{[^@]+}}@rt1 +; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) [[ATTR2]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: unreachable ; entry: %v = load i32, i32* %a, align 4 @@ -537,12 +541,19 @@ ; TEST another SCC test ; define i32* @rt2_helper(i32* %a) #0 { -; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; CHECK-LABEL: define {{[^@]+}}@rt2_helper -; CHECK-SAME: (i32* nofree readnone returned [[A:%.*]]) [[ATTR1]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @rt2(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[A]]) [[ATTR7]] -; CHECK-NEXT: ret i32* [[CALL]] +; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; 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]]) [[ATTR8]] +; IS__TUNIT____-NEXT: ret i32* [[CALL]] +; +; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@rt2_helper +; IS__CGSCC____-SAME: (i32* nofree readnone returned [[A:%.*]]) [[ATTR1]] { +; 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* [[CALL]] ; entry: %call = call i32* @rt2(i32* %a, i32* %a) @@ -550,18 +561,31 @@ } define i32* @rt2(i32* %a, i32 *%b) #0 { -; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; CHECK-LABEL: define {{[^@]+}}@rt2 -; CHECK-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) [[ATTR1]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null -; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; CHECK: if.then: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @rt2_helper(i32* noalias nofree readnone [[A]]) [[ATTR7]] -; CHECK-NEXT: br label [[IF_END]] -; CHECK: if.end: -; CHECK-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[CALL]], [[IF_THEN]] ] -; CHECK-NEXT: ret i32* [[SEL]] +; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@rt2 +; IS__TUNIT____-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) [[ATTR1]] { +; IS__TUNIT____-NEXT: entry: +; 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]]) [[ATTR8]] +; IS__TUNIT____-NEXT: br label [[IF_END]] +; IS__TUNIT____: if.end: +; IS__TUNIT____-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[CALL]], [[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:%.*]]) [[ATTR1]] { +; 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:%.*]] ], [ [[CALL]], [[IF_THEN]] ] +; IS__CGSCC____-NEXT: ret i32* [[SEL]] ; entry: %cmp = icmp eq i32* %a, null @@ -579,12 +603,19 @@ ; TEST another SCC test ; define i32* @rt3_helper(i32* %a, i32* %b) #0 { -; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; CHECK-LABEL: define {{[^@]+}}@rt3_helper -; CHECK-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) [[ATTR1]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) [[ATTR7]] -; CHECK-NEXT: ret i32* [[CALL]] +; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@rt3_helper +; IS__TUNIT____-SAME: (i32* 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 nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) [[ATTR8]] +; IS__TUNIT____-NEXT: ret i32* [[CALL]] +; +; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@rt3_helper +; IS__CGSCC____-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) [[ATTR1]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) [[ATTR7]] +; IS__CGSCC____-NEXT: ret i32* [[CALL]] ; entry: %call = call i32* @rt3(i32* %a, i32* %b) @@ -592,18 +623,31 @@ } define i32* @rt3(i32* %a, i32 *%b) #0 { -; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; CHECK-LABEL: define {{[^@]+}}@rt3 -; CHECK-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) [[ATTR1]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null -; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; CHECK: if.then: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @rt3_helper(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) [[ATTR7]] -; CHECK-NEXT: br label [[IF_END]] -; CHECK: if.end: -; CHECK-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[CALL]], [[IF_THEN]] ] -; CHECK-NEXT: ret i32* [[SEL]] +; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@rt3 +; IS__TUNIT____-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) [[ATTR1]] { +; IS__TUNIT____-NEXT: entry: +; 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 nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) [[ATTR8]] +; IS__TUNIT____-NEXT: br label [[IF_END]] +; IS__TUNIT____: if.end: +; IS__TUNIT____-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[CALL]], [[IF_THEN]] ] +; IS__TUNIT____-NEXT: ret i32* [[SEL]] +; +; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@rt3 +; IS__CGSCC____-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) [[ATTR1]] { +; 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 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:%.*]] ], [ [[CALL]], [[IF_THEN]] ] +; IS__CGSCC____-NEXT: ret i32* [[SEL]] ; entry: %cmp = icmp eq i32* %a, null @@ -633,7 +677,7 @@ ; CHECK: Function Attrs: noinline nounwind uwtable ; CHECK-LABEL: define {{[^@]+}}@calls_unknown_fn ; CHECK-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) [[ATTR3:#.*]] { -; CHECK-NEXT: tail call void @unknown_fn(i32* (i32*)* noundef nonnull @calls_unknown_fn) [[ATTR8:#.*]] +; CHECK-NEXT: tail call void @unknown_fn(i32* (i32*)* noundef nonnull @calls_unknown_fn) ; CHECK-NEXT: ret i32* [[R]] ; tail call void @unknown_fn(i32* (i32*)* nonnull @calls_unknown_fn) @@ -670,7 +714,7 @@ ; CHECK-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn ; CHECK-SAME: (i32* returned [[R:%.*]]) [[ATTR3]] { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) [[ATTR8]] +; CHECK-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) ; CHECK-NEXT: ret i32* [[R]] ; entry: @@ -706,7 +750,7 @@ ; CHECK-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2 ; CHECK-SAME: (i32* [[R:%.*]]) [[ATTR3]] { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) [[ATTR8]] +; CHECK-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) ; CHECK-NEXT: ret i32* [[CALL]] ; entry: @@ -778,21 +822,37 @@ ; } ; define double @recursion_select_and_phi(i32 %a, double %b) #0 { -; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; CHECK-LABEL: define {{[^@]+}}@recursion_select_and_phi -; CHECK-SAME: (i32 [[A:%.*]], double returned [[B:%.*]]) [[ATTR1]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[DEC:%.*]] = add nsw i32 [[A]], -1 -; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 0 -; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; CHECK: if.then: -; CHECK-NEXT: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) [[ATTR7]] -; CHECK-NEXT: br label [[IF_END]] -; CHECK: if.end: -; CHECK-NEXT: [[PHI:%.*]] = phi double [ [[CALL]], [[IF_THEN]] ], [ [[B]], [[ENTRY:%.*]] ] -; CHECK-NEXT: [[CMP1:%.*]] = fcmp oeq double [[B]], 0.000000e+00 -; CHECK-NEXT: [[SEL:%.*]] = select i1 [[CMP1]], double [[B]], double [[PHI]] -; CHECK-NEXT: ret double [[SEL]] +; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@recursion_select_and_phi +; IS__TUNIT____-SAME: (i32 [[A:%.*]], double returned [[B:%.*]]) [[ATTR1]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[DEC:%.*]] = add nsw i32 [[A]], -1 +; 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]]) [[ATTR9]] +; IS__TUNIT____-NEXT: br label [[IF_END]] +; IS__TUNIT____: if.end: +; IS__TUNIT____-NEXT: [[PHI:%.*]] = phi double [ [[CALL]], [[IF_THEN]] ], [ [[B]], [[ENTRY:%.*]] ] +; IS__TUNIT____-NEXT: [[CMP1:%.*]] = fcmp oeq double [[B]], 0.000000e+00 +; IS__TUNIT____-NEXT: [[SEL:%.*]] = select i1 [[CMP1]], double [[B]], double [[PHI]] +; IS__TUNIT____-NEXT: ret double [[SEL]] +; +; 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:%.*]]) [[ATTR1]] { +; 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]]) [[ATTR8]] +; IS__CGSCC____-NEXT: br label [[IF_END]] +; IS__CGSCC____: if.end: +; IS__CGSCC____-NEXT: [[PHI:%.*]] = phi double [ [[CALL]], [[IF_THEN]] ], [ [[B]], [[ENTRY:%.*]] ] +; IS__CGSCC____-NEXT: [[CMP1:%.*]] = fcmp oeq double [[B]], 0.000000e+00 +; IS__CGSCC____-NEXT: [[SEL:%.*]] = select i1 [[CMP1]], double [[B]], double [[PHI]] +; IS__CGSCC____-NEXT: ret double [[SEL]] ; entry: %dec = add nsw i32 %a, -1 @@ -1429,9 +1489,9 @@ ret i32* %bc } define i32* @use_const() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@use_const -; IS__TUNIT____-SAME: () [[ATTR0]] { +; IS__TUNIT____-SAME: () [[ATTR5:#.*]] { ; IS__TUNIT____-NEXT: ret i32* bitcast (i8* @G to i32*) ; ; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn mustprogress @@ -1443,10 +1503,10 @@ ret i32* %c } define i32* @dont_use_const() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn mustprogress +; 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: [[C:%.*]] = musttail call i32* @ret_const() [[ATTR6]] +; IS__TUNIT____-SAME: () [[ATTR5]] { +; IS__TUNIT____-NEXT: [[C:%.*]] = musttail call i32* @ret_const() [[ATTR7]] ; IS__TUNIT____-NEXT: ret i32* [[C]] ; ; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn mustprogress 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 @@ -98,9 +98,9 @@ } define void @load_null_propagated() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@load_null_propagated -; IS__TUNIT____-SAME: () [[ATTR0]] { +; IS__TUNIT____-SAME: () [[ATTR2:#.*]] { ; IS__TUNIT____-NEXT: unreachable ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -160,7 +160,7 @@ define void @store_null_pointer_is_defined() null_pointer_is_valid { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind null_pointer_is_valid willreturn writeonly mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@store_null_pointer_is_defined -; IS__TUNIT____-SAME: () [[ATTR2:#.*]] { +; IS__TUNIT____-SAME: () [[ATTR3:#.*]] { ; IS__TUNIT____-NEXT: store i32 5, i32* null, align 536870912 ; IS__TUNIT____-NEXT: ret void ; @@ -178,9 +178,9 @@ ; ATTRIBUTOR-LABEL: @store_null_propagated( ; ATTRIBUTOR-NEXT: unreachable ; -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@store_null_propagated -; IS__TUNIT____-SAME: () [[ATTR0]] { +; IS__TUNIT____-SAME: () [[ATTR2]] { ; IS__TUNIT____-NEXT: unreachable ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -198,7 +198,7 @@ define void @atomicrmw_wholly_unreachable() { ; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@atomicrmw_wholly_unreachable -; IS__TUNIT____-SAME: () [[ATTR3:#.*]] { +; IS__TUNIT____-SAME: () [[ATTR4:#.*]] { ; IS__TUNIT____-NEXT: unreachable ; ; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn mustprogress @@ -213,7 +213,7 @@ define void @atomicrmw_single_bb_unreachable(i1 %cond) { ; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@atomicrmw_single_bb_unreachable -; IS__TUNIT____-SAME: (i1 [[COND:%.*]]) [[ATTR3]] { +; IS__TUNIT____-SAME: (i1 [[COND:%.*]]) [[ATTR4]] { ; IS__TUNIT____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] ; IS__TUNIT____: t: ; IS__TUNIT____-NEXT: unreachable @@ -240,7 +240,7 @@ define void @atomicrmw_null_pointer_is_defined() null_pointer_is_valid { ; IS__TUNIT____: Function Attrs: nofree nounwind null_pointer_is_valid willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@atomicrmw_null_pointer_is_defined -; IS__TUNIT____-SAME: () [[ATTR4:#.*]] { +; IS__TUNIT____-SAME: () [[ATTR5:#.*]] { ; IS__TUNIT____-NEXT: [[A:%.*]] = atomicrmw add i32* null, i32 1 acquire ; IS__TUNIT____-NEXT: ret void ; @@ -258,9 +258,9 @@ ; ATTRIBUTOR-LABEL: @atomicrmw_null_propagated( ; ATTRIBUTOR-NEXT: unreachable ; -; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@atomicrmw_null_propagated -; IS__TUNIT____-SAME: () [[ATTR3]] { +; IS__TUNIT____-SAME: () [[ATTR6:#.*]] { ; IS__TUNIT____-NEXT: unreachable ; ; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn mustprogress @@ -278,7 +278,7 @@ define void @atomiccmpxchg_wholly_unreachable() { ; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@atomiccmpxchg_wholly_unreachable -; IS__TUNIT____-SAME: () [[ATTR3]] { +; IS__TUNIT____-SAME: () [[ATTR4]] { ; IS__TUNIT____-NEXT: unreachable ; ; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn mustprogress @@ -293,7 +293,7 @@ define void @atomiccmpxchg_single_bb_unreachable(i1 %cond) { ; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@atomiccmpxchg_single_bb_unreachable -; IS__TUNIT____-SAME: (i1 [[COND:%.*]]) [[ATTR3]] { +; IS__TUNIT____-SAME: (i1 [[COND:%.*]]) [[ATTR4]] { ; IS__TUNIT____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] ; IS__TUNIT____: t: ; IS__TUNIT____-NEXT: unreachable @@ -320,7 +320,7 @@ define void @atomiccmpxchg_null_pointer_is_defined() null_pointer_is_valid { ; IS__TUNIT____: Function Attrs: nofree nounwind null_pointer_is_valid willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@atomiccmpxchg_null_pointer_is_defined -; IS__TUNIT____-SAME: () [[ATTR4]] { +; IS__TUNIT____-SAME: () [[ATTR5]] { ; IS__TUNIT____-NEXT: [[A:%.*]] = cmpxchg i32* null, i32 2, i32 3 acq_rel monotonic ; IS__TUNIT____-NEXT: ret void ; @@ -338,9 +338,9 @@ ; ATTRIBUTOR-LABEL: @atomiccmpxchg_null_propagated( ; ATTRIBUTOR-NEXT: unreachable ; -; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@atomiccmpxchg_null_propagated -; IS__TUNIT____-SAME: () [[ATTR3]] { +; IS__TUNIT____-SAME: () [[ATTR6]] { ; IS__TUNIT____-NEXT: unreachable ; ; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn mustprogress @@ -360,7 +360,7 @@ define i32 @cond_br_on_undef() { ; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@cond_br_on_undef -; IS__TUNIT____-SAME: () [[ATTR5:#.*]] { +; IS__TUNIT____-SAME: () [[ATTR7:#.*]] { ; IS__TUNIT____-NEXT: unreachable ; IS__TUNIT____: t: ; IS__TUNIT____-NEXT: unreachable @@ -439,9 +439,9 @@ } define void @cond_br_on_undef_interproc() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn mustprogress +; 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____-SAME: () [[ATTR8:#.*]] { ; IS__TUNIT____-NEXT: unreachable ; IS__TUNIT____: t: ; IS__TUNIT____-NEXT: unreachable @@ -493,9 +493,9 @@ ; More complicated interproc deduction of undef define void @cond_br_on_undef_interproc2() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn mustprogress +; 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____-SAME: () [[ATTR8]] { ; IS__TUNIT____-NEXT: unreachable ; IS__TUNIT____: t: ; IS__TUNIT____-NEXT: unreachable @@ -610,9 +610,9 @@ } define i32 @foo() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: () [[ATTR0]] { +; IS__TUNIT____-SAME: () [[ATTR2]] { ; IS__TUNIT____-NEXT: ret i32 1 ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -631,7 +631,7 @@ define void @arg_nonnull_1(i32* nonnull %a) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_1 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) [[ATTR6:#.*]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) [[ATTR9:#.*]] { ; IS__TUNIT____-NEXT: store i32 0, i32* [[A]], align 4 ; IS__TUNIT____-NEXT: ret void ; @@ -648,7 +648,7 @@ define void @arg_nonnull_1_noundef_1(i32* nonnull noundef %a) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; 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____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) [[ATTR9]] { ; IS__TUNIT____-NEXT: store i32 0, i32* [[A]], align 4 ; IS__TUNIT____-NEXT: ret void ; @@ -665,7 +665,7 @@ define void @arg_nonnull_12(i32* nonnull %a, i32* nonnull %b, i32* %c) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; 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____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) [[ATTR9]] { ; IS__TUNIT____-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null ; IS__TUNIT____-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT____: t: @@ -706,7 +706,7 @@ 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 mustprogress ; 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____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree noundef nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) [[ATTR9]] { ; IS__TUNIT____-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null ; IS__TUNIT____-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT____: t: @@ -746,9 +746,9 @@ ; Pass null directly to argument with nonnull attribute define void @arg_nonnull_violation1_1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_violation1_1 -; IS__TUNIT____-SAME: () [[ATTR0]] { +; IS__TUNIT____-SAME: () [[ATTR2]] { ; IS__TUNIT____-NEXT: unreachable ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -761,9 +761,9 @@ } define void @arg_nonnull_violation1_2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_violation1_2 -; IS__TUNIT____-SAME: () [[ATTR0]] { +; IS__TUNIT____-SAME: () [[ATTR2]] { ; IS__TUNIT____-NEXT: unreachable ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -777,9 +777,9 @@ ; A case that depends on value simplification define void @arg_nonnull_violation2_1(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; 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____-SAME: (i1 [[C:%.*]]) [[ATTR2]] { ; IS__TUNIT____-NEXT: unreachable ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -794,9 +794,9 @@ } define void @arg_nonnull_violation2_2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; 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____-SAME: (i1 [[C:%.*]]) [[ATTR2]] { ; IS__TUNIT____-NEXT: unreachable ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -812,14 +812,14 @@ ; 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 mustprogress +; 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____-SAME: (i1 [[C:%.*]]) [[ATTR2]] { ; 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:#.*]] -; 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 536870912 null) [[ATTR7]] +; 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]]) [[ATTR10:#.*]] +; 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 536870912 null) [[ATTR10]] ; IS__TUNIT____-NEXT: unreachable ; IS__TUNIT____: f: ; IS__TUNIT____-NEXT: unreachable @@ -859,14 +859,14 @@ } define void @arg_nonnull_violation3_2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; 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____-SAME: (i1 [[C:%.*]]) [[ATTR2]] { ; 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 536870912 null) [[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* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) [[ATTR10]] +; 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 536870912 null) [[ATTR10]] ; IS__TUNIT____-NEXT: unreachable ; IS__TUNIT____: f: ; IS__TUNIT____-NEXT: unreachable @@ -1083,9 +1083,9 @@ } define i32 @violate_noundef_nonpointer() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@violate_noundef_nonpointer -; IS__TUNIT____-SAME: () [[ATTR0]] { +; IS__TUNIT____-SAME: () [[ATTR2]] { ; IS__TUNIT____-NEXT: unreachable ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -1112,9 +1112,9 @@ } define i32* @violate_noundef_pointer() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@violate_noundef_pointer -; IS__TUNIT____-SAME: () [[ATTR0]] { +; IS__TUNIT____-SAME: () [[ATTR2]] { ; IS__TUNIT____-NEXT: unreachable ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress 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 @@ -58,9 +58,9 @@ } define i32 @test2_1(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test2_1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR1]] { +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR2:#.*]] { ; IS__TUNIT____-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] ; IS__TUNIT____: if.true: ; IS__TUNIT____-NEXT: [[RET0:%.*]] = add i32 0, 1 @@ -102,9 +102,9 @@ define i32 @test2_2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test2_2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR1]] { +; IS__TUNIT____-SAME: (i1 [[C:%.*]]) [[ATTR2]] { ; IS__TUNIT____-NEXT: ret i32 1 ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -228,6 +228,15 @@ } define internal i1 @ipccp2i(i1 %a) { +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress +; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp2i +; IS__CGSCC____-SAME: () [[ATTR1]] { +; IS__CGSCC____-NEXT: br label [[T:%.*]] +; IS__CGSCC____: t: +; IS__CGSCC____-NEXT: ret i1 undef +; IS__CGSCC____: f: +; IS__CGSCC____-NEXT: unreachable +; br i1 %a, label %t, label %f t: ret i1 %a @@ -237,9 +246,9 @@ } define i1 @ipccp2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp2 -; IS__TUNIT____-SAME: () [[ATTR2:#.*]] { +; IS__TUNIT____-SAME: () [[ATTR3:#.*]] { ; IS__TUNIT____-NEXT: ret i1 true ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -252,6 +261,15 @@ } define internal i1 @ipccp2ib(i1 %a) { +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress +; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp2ib +; IS__CGSCC____-SAME: () [[ATTR1]] { +; IS__CGSCC____-NEXT: br label [[T:%.*]] +; IS__CGSCC____: t: +; IS__CGSCC____-NEXT: ret i1 undef +; IS__CGSCC____: f: +; IS__CGSCC____-NEXT: unreachable +; br i1 %a, label %t, label %f t: ret i1 true @@ -261,9 +279,9 @@ } define i1 @ipccp2b() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp2b -; IS__TUNIT____-SAME: () [[ATTR2]] { +; IS__TUNIT____-SAME: () [[ATTR3]] { ; IS__TUNIT____-NEXT: ret i1 true ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -276,6 +294,15 @@ } define internal i32 @ipccp3i(i32 %a) { +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress +; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp3i +; IS__CGSCC____-SAME: () [[ATTR1]] { +; IS__CGSCC____-NEXT: br label [[T:%.*]] +; IS__CGSCC____: t: +; IS__CGSCC____-NEXT: ret i32 undef +; IS__CGSCC____: f: +; IS__CGSCC____-NEXT: unreachable +; %c = icmp eq i32 %a, 7 br i1 %c, label %t, label %f t: @@ -286,9 +313,9 @@ } define i32 @ipccp3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp3 -; IS__TUNIT____-SAME: () [[ATTR2]] { +; IS__TUNIT____-SAME: () [[ATTR3]] { ; IS__TUNIT____-NEXT: ret i32 7 ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -316,22 +343,22 @@ ret i32* %a } define i32* @complicated_args_inalloca(i32* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@complicated_args_inalloca -; IS__TUNIT____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[ARG:%.*]]) [[ATTR1]] { +; IS__TUNIT____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[ARG:%.*]]) [[ATTR2]] { ; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @test_inalloca(i32* noalias nofree writeonly "no-capture-maybe-returned" [[ARG]]) [[ATTR2]] ; IS__TUNIT____-NEXT: ret i32* [[CALL]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_inalloca ; IS__CGSCC_OPM-SAME: (i32* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[ARG:%.*]]) [[ATTR1:#.*]] { -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @test_inalloca(i32* noalias nofree nonnull writeonly dereferenceable(4) "no-capture-maybe-returned" [[ARG]]) [[ATTR6:#.*]] +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @test_inalloca(i32* noalias nofree nonnull writeonly dereferenceable(4) "no-capture-maybe-returned" [[ARG]]) [[ATTR5:#.*]] ; IS__CGSCC_OPM-NEXT: ret i32* [[CALL]] ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_inalloca ; IS__CGSCC_NPM-SAME: (i32* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[ARG:%.*]]) [[ATTR1:#.*]] { -; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @test_inalloca(i32* noalias nofree nonnull writeonly dereferenceable(4) "no-capture-maybe-returned" [[ARG]]) [[ATTR5:#.*]] +; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @test_inalloca(i32* noalias nofree nonnull writeonly dereferenceable(4) "no-capture-maybe-returned" [[ARG]]) [[ATTR4:#.*]] ; IS__CGSCC_NPM-NEXT: ret i32* [[CALL]] ; %call = call i32* @test_inalloca(i32* %arg) @@ -352,32 +379,32 @@ ret i32* %a } define i32* @complicated_args_preallocated() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_preallocated -; IS__TUNIT_OPM-SAME: () [[ATTR3:#.*]] { -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) [[ATTR7:#.*]] -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 536870912 null) [[ATTR2:#.*]] [ "preallocated"(token [[C]]) ] +; IS__TUNIT_OPM-SAME: () [[ATTR0:#.*]] { +; IS__TUNIT_OPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) [[ATTR9:#.*]] +; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 536870912 null) [[ATTR0]] [ "preallocated"(token [[C]]) ] ; IS__TUNIT_OPM-NEXT: ret i32* [[CALL]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_preallocated -; IS__TUNIT_NPM-SAME: () [[ATTR3:#.*]] { -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) [[ATTR6:#.*]] -; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 536870912 null) [[ATTR2:#.*]] [ "preallocated"(token [[C]]) ] +; IS__TUNIT_NPM-SAME: () [[ATTR0:#.*]] { +; IS__TUNIT_NPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) [[ATTR8:#.*]] +; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 536870912 null) [[ATTR0]] [ "preallocated"(token [[C]]) ] ; IS__TUNIT_NPM-NEXT: ret i32* [[CALL]] ; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn mustprogress +; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_preallocated -; IS__CGSCC_OPM-SAME: () [[ATTR2:#.*]] { -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) [[ATTR6]] -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 536870912 null) [[ATTR7:#.*]] [ "preallocated"(token [[C]]) ] +; IS__CGSCC_OPM-SAME: () [[ATTR0:#.*]] { +; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) [[ATTR5]] +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 536870912 null) [[ATTR5]] [ "preallocated"(token [[C]]) ] ; IS__CGSCC_OPM-NEXT: ret i32* [[CALL]] ; -; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn mustprogress +; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_preallocated -; IS__CGSCC_NPM-SAME: () [[ATTR2:#.*]] { -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) [[ATTR5]] -; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 536870912 null) [[ATTR6:#.*]] [ "preallocated"(token [[C]]) ] +; IS__CGSCC_NPM-SAME: () [[ATTR0:#.*]] { +; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) [[ATTR4]] +; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 536870912 null) [[ATTR4]] [ "preallocated"(token [[C]]) ] ; IS__CGSCC_NPM-NEXT: ret i32* [[CALL]] ; %c = call token @llvm.call.preallocated.setup(i32 1) @@ -395,7 +422,7 @@ ; ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@test_sret -; IS__CGSCC____-SAME: (%struct.X* noalias nofree noundef nonnull writeonly sret(%struct.X) align 536870912 dereferenceable(8) [[A:%.*]], %struct.X** nocapture nofree nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) [[ATTR3:#.*]] { +; IS__CGSCC____-SAME: (%struct.X* noalias nofree noundef nonnull writeonly sret(%struct.X) align 536870912 dereferenceable(8) [[A:%.*]], %struct.X** nocapture nofree nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) [[ATTR2:#.*]] { ; IS__CGSCC____-NEXT: store %struct.X* [[A]], %struct.X** [[B]], align 8 ; IS__CGSCC____-NEXT: ret void ; @@ -405,21 +432,21 @@ ; FIXME: Alignment and dereferenceability are not propagated to the argument define void @complicated_args_sret(%struct.X** %b) { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress +; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_sret -; IS__TUNIT_OPM-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) [[ATTR4:#.*]] { -; IS__TUNIT_OPM-NEXT: call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly align 536870912 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) [[ATTR8:#.*]] +; IS__TUNIT_OPM-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) [[ATTR5:#.*]] { +; IS__TUNIT_OPM-NEXT: call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly align 536870912 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) [[ATTR10:#.*]] ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress +; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_sret -; IS__TUNIT_NPM-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) [[ATTR4:#.*]] { -; IS__TUNIT_NPM-NEXT: call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly align 536870912 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) [[ATTR7:#.*]] +; IS__TUNIT_NPM-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) [[ATTR5:#.*]] { +; IS__TUNIT_NPM-NEXT: call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly align 536870912 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) [[ATTR9:#.*]] ; IS__TUNIT_NPM-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@complicated_args_sret -; IS__CGSCC____-SAME: (%struct.X** nocapture nofree nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) [[ATTR3]] { +; IS__CGSCC____-SAME: (%struct.X** nocapture nofree nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) [[ATTR2]] { ; IS__CGSCC____-NEXT: unreachable ; call void @test_sret(%struct.X* null, %struct.X** %b) @@ -440,22 +467,22 @@ ret %struct.X* %a } define %struct.X* @complicated_args_nest() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@complicated_args_nest -; IS__TUNIT____-SAME: () [[ATTR1]] { +; IS__TUNIT____-SAME: () [[ATTR2]] { ; IS__TUNIT____-NEXT: [[CALL:%.*]] = call %struct.X* @test_nest(%struct.X* noalias nocapture nofree noundef readnone align 536870912 null) [[ATTR2]] ; IS__TUNIT____-NEXT: ret %struct.X* [[CALL]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_nest ; IS__CGSCC_OPM-SAME: () [[ATTR1]] { -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call %struct.X* @test_nest(%struct.X* noalias nocapture nofree noundef readnone align 536870912 null) [[ATTR6]] +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call %struct.X* @test_nest(%struct.X* noalias nocapture nofree noundef readnone align 536870912 null) [[ATTR5]] ; IS__CGSCC_OPM-NEXT: ret %struct.X* [[CALL]] ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_nest ; IS__CGSCC_NPM-SAME: () [[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call %struct.X* @test_nest(%struct.X* noalias nocapture nofree noundef readnone align 536870912 null) [[ATTR5]] +; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call %struct.X* @test_nest(%struct.X* noalias nocapture nofree noundef readnone align 536870912 null) [[ATTR4]] ; IS__CGSCC_NPM-NEXT: ret %struct.X* [[CALL]] ; %call = call %struct.X* @test_nest(%struct.X* null) @@ -486,9 +513,9 @@ ret void } define void @complicated_args_byval() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@complicated_args_byval -; IS__TUNIT____-SAME: () [[ATTR1]] { +; IS__TUNIT____-SAME: () [[ATTR2]] { ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress @@ -498,7 +525,7 @@ ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_byval -; IS__CGSCC_NPM-SAME: () [[ATTR4:#.*]] { +; IS__CGSCC_NPM-SAME: () [[ATTR3:#.*]] { ; IS__CGSCC_NPM-NEXT: ret void ; call void @test_byval(%struct.X* @S) @@ -508,14 +535,14 @@ define internal i8*@test_byval2(%struct.X* byval(%struct.X) %a) { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_byval2 -; IS__TUNIT____-SAME: () [[ATTR5:#.*]] { +; IS__TUNIT____-SAME: () [[ATTR6:#.*]] { ; IS__TUNIT____-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X:%.*]], %struct.X* @S, i32 0, i32 0 ; IS__TUNIT____-NEXT: [[L:%.*]] = load i8*, i8** [[G0]], align 8 ; IS__TUNIT____-NEXT: ret i8* [[L]] ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@test_byval2 -; IS__CGSCC____-SAME: () [[ATTR4:#.*]] { +; IS__CGSCC____-SAME: () [[ATTR3:#.*]] { ; IS__CGSCC____-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X:%.*]], %struct.X* @S, i32 0, i32 0 ; IS__CGSCC____-NEXT: [[L:%.*]] = load i8*, i8** [[G0]], align 8 ; IS__CGSCC____-NEXT: ret i8* [[L]] @@ -525,28 +552,22 @@ ret i8* %l } define i8* @complicated_args_byval2() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readonly willreturn mustprogress -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_byval2 -; IS__TUNIT_OPM-SAME: () [[ATTR5:#.*]] { -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = call i8* @test_byval2() [[ATTR9:#.*]] -; IS__TUNIT_OPM-NEXT: ret i8* [[C]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readonly willreturn mustprogress -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_byval2 -; IS__TUNIT_NPM-SAME: () [[ATTR5:#.*]] { -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = call i8* @test_byval2() [[ATTR8:#.*]] -; IS__TUNIT_NPM-NEXT: ret i8* [[C]] +; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@complicated_args_byval2 +; IS__TUNIT____-SAME: () [[ATTR7:#.*]] { +; IS__TUNIT____-NEXT: [[C:%.*]] = call i8* @test_byval2() [[ATTR7]] +; IS__TUNIT____-NEXT: ret i8* [[C]] ; ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn mustprogress ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_byval2 -; IS__CGSCC_OPM-SAME: () [[ATTR4:#.*]] { -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call i8* @test_byval2() [[ATTR8:#.*]] +; IS__CGSCC_OPM-SAME: () [[ATTR3:#.*]] { +; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call i8* @test_byval2() [[ATTR6:#.*]] ; IS__CGSCC_OPM-NEXT: ret i8* [[C]] ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_byval2 -; IS__CGSCC_NPM-SAME: () [[ATTR4]] { -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call i8* @test_byval2() [[ATTR7:#.*]] +; IS__CGSCC_NPM-SAME: () [[ATTR3]] { +; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call i8* @test_byval2() [[ATTR5:#.*]] ; IS__CGSCC_NPM-NEXT: ret i8* [[C]] ; %c = call i8* @test_byval2(%struct.X* @S) @@ -556,7 +577,7 @@ define void @fixpoint_changed(i32* %p) { ; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind writeonly ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fixpoint_changed -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) [[ATTR6:#.*]] { +; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) [[ATTR8:#.*]] { ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] ; IS__TUNIT_OPM: for.cond: @@ -579,7 +600,7 @@ ; ; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly mustprogress ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fixpoint_changed -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) [[ATTR4]] { +; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) [[ATTR4:#.*]] { ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] ; IS__TUNIT_NPM: for.cond: @@ -602,7 +623,7 @@ ; ; 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:%.*]]) [[ATTR5:#.*]] { +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) [[ATTR4:#.*]] { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] ; IS__CGSCC_OPM: for.cond: @@ -625,7 +646,7 @@ ; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fixpoint_changed -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) [[ATTR3:#.*]] { +; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) [[ATTR2:#.*]] { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] ; IS__CGSCC_NPM: for.cond: 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 @@ -14,12 +14,12 @@ define void @only_return() #0 { ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@only_return -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { +; IS__TUNIT____-SAME: () [[ATTR0:#.*]] { ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@only_return -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { +; IS__CGSCC____-SAME: () [[ATTR0:#.*]] { ; IS__CGSCC____-NEXT: ret void ; ret void @@ -37,14 +37,14 @@ 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-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr [[ATTR1:#.*]] { ; 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: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) [[ATTR16:#.*]] ; 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: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) [[ATTR16]] ; IS__TUNIT_OPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] ; IS__TUNIT_OPM-NEXT: ret i32 [[TMP8]] ; IS__TUNIT_OPM: 9: @@ -52,14 +52,14 @@ ; ; 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-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr [[ATTR1:#.*]] { ; 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]]) #[[ATTR17:[0-9]+]] +; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) [[ATTR19:#.*]] ; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR17]] +; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) [[ATTR19]] ; IS__TUNIT_NPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] ; IS__TUNIT_NPM-NEXT: ret i32 [[TMP8]] ; IS__TUNIT_NPM: 9: @@ -67,14 +67,14 @@ ; ; 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-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr [[ATTR1:#.*]] { ; 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]]) #[[ATTR19:[0-9]+]] +; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) [[ATTR19:#.*]] ; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR19]] +; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) [[ATTR19]] ; IS__CGSCC_OPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] ; IS__CGSCC_OPM-NEXT: ret i32 [[TMP8]] ; IS__CGSCC_OPM: 9: @@ -82,14 +82,14 @@ ; ; 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-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr [[ATTR1:#.*]] { ; 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]]) #[[ATTR22:[0-9]+]] +; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) [[ATTR22:#.*]] ; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR22]] +; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) [[ATTR22]] ; IS__CGSCC_NPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] ; IS__CGSCC_NPM-NEXT: ret i32 [[TMP8]] ; IS__CGSCC_NPM: 9: @@ -123,7 +123,7 @@ 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____-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr [[ATTR1:#.*]] { ; IS__TUNIT____-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0]], 0 ; IS__TUNIT____-NEXT: br i1 [[TMP2]], label [[TMP11:%.*]], label [[TMP3:%.*]] ; IS__TUNIT____: 3: @@ -141,7 +141,7 @@ ; ; 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____-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr [[ATTR2:#.*]] { ; IS__CGSCC____-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0]], 0 ; IS__CGSCC____-NEXT: br i1 [[TMP2]], label [[TMP11:%.*]], label [[TMP3:%.*]] ; IS__CGSCC____: 3: @@ -189,7 +189,7 @@ 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-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: @@ -205,7 +205,7 @@ ; ; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn mustprogress ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fact_loop -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; 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: @@ -221,7 +221,7 @@ ; ; 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-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: @@ -237,7 +237,7 @@ ; ; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fact_loop -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; 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: @@ -281,44 +281,44 @@ 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-SAME: (i1 [[C:%.*]]) [[ATTR3:#.*]] { ; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] ; IS__TUNIT_OPM: rec: -; IS__TUNIT_OPM-NEXT: call void @sink() #[[ATTR16:[0-9]+]] -; IS__TUNIT_OPM-NEXT: call void @mutual_recursion2(i1 [[C]]) #[[ATTR17:[0-9]+]] +; IS__TUNIT_OPM-NEXT: call void @sink() [[ATTR17:#.*]] +; IS__TUNIT_OPM-NEXT: call void @mutual_recursion2(i1 [[C]]) [[ATTR18:#.*]] ; 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-SAME: (i1 [[C:%.*]]) [[ATTR3:#.*]] { ; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] ; IS__TUNIT_NPM: rec: -; IS__TUNIT_NPM-NEXT: call void @sink() #[[ATTR19:[0-9]+]] -; IS__TUNIT_NPM-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) #[[ATTR20:[0-9]+]] +; IS__TUNIT_NPM-NEXT: call void @sink() [[ATTR20:#.*]] +; IS__TUNIT_NPM-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) [[ATTR21:#.*]] ; 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-SAME: (i1 [[C:%.*]]) [[ATTR4:#.*]] { ; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] ; IS__CGSCC_OPM: rec: -; IS__CGSCC_OPM-NEXT: call void @sink() #[[ATTR20:[0-9]+]] -; IS__CGSCC_OPM-NEXT: call void @mutual_recursion2(i1 [[C]]) #[[ATTR21:[0-9]+]] +; IS__CGSCC_OPM-NEXT: call void @sink() [[ATTR20:#.*]] +; IS__CGSCC_OPM-NEXT: call void @mutual_recursion2(i1 [[C]]) [[ATTR21:#.*]] ; 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-SAME: (i1 [[C:%.*]]) [[ATTR4:#.*]] { ; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] ; IS__CGSCC_NPM: rec: -; IS__CGSCC_NPM-NEXT: call void @sink() #[[ATTR23:[0-9]+]] -; IS__CGSCC_NPM-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) #[[ATTR24:[0-9]+]] +; IS__CGSCC_NPM-NEXT: call void @sink() [[ATTR23:#.*]] +; IS__CGSCC_NPM-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) [[ATTR24:#.*]] ; IS__CGSCC_NPM-NEXT: br label [[END]] ; IS__CGSCC_NPM: end: ; IS__CGSCC_NPM-NEXT: ret void @@ -336,26 +336,26 @@ 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]]) #[[ATTR17]] +; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) [[ATTR3]] { +; IS__TUNIT_OPM-NEXT: call void @mutual_recursion1(i1 [[C]]) [[ATTR18]] ; 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]]) #[[ATTR20]] +; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) [[ATTR3]] { +; IS__TUNIT_NPM-NEXT: call void @mutual_recursion1(i1 [[C]]) [[ATTR21]] ; 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]]) #[[ATTR21]] +; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) [[ATTR4]] { +; IS__CGSCC_OPM-NEXT: call void @mutual_recursion1(i1 [[C]]) [[ATTR21]] ; 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]]) #[[ATTR24]] +; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) [[ATTR4]] { +; IS__CGSCC_NPM-NEXT: call void @mutual_recursion1(i1 [[C]]) [[ATTR24]] ; IS__CGSCC_NPM-NEXT: ret void ; call void @mutual_recursion1(i1 %c) @@ -372,14 +372,14 @@ 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____-SAME: () local_unnamed_addr [[ATTR5:#.*]] { +; IS__TUNIT____-NEXT: tail call void @exit(i32 noundef 0) [[ATTR4:#.*]] ; 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____-SAME: () local_unnamed_addr [[ATTR6:#.*]] { +; IS__CGSCC____-NEXT: tail call void @exit(i32 noundef 0) [[ATTR5:#.*]] ; IS__CGSCC____-NEXT: unreachable ; tail call void @exit(i32 0) @@ -399,36 +399,36 @@ 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 readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR6:[0-9]+]] { +; IS__TUNIT____-SAME: (i32 [[TMP0:%.*]], i32* nocapture readonly [[TMP1:%.*]]) local_unnamed_addr [[ATTR6:#.*]] { ; 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: 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: 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 readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] { +; IS__CGSCC____-SAME: (i32 [[TMP0:%.*]], i32* nocapture readonly [[TMP1:%.*]]) local_unnamed_addr [[ATTR7:#.*]] { ; 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: 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: tail call void @exit(i32 noundef 1) [[ATTR5]] ; IS__CGSCC____-NEXT: unreachable ; IS__CGSCC____: 9: ; IS__CGSCC____-NEXT: ret void @@ -462,12 +462,12 @@ define void @call_floor(float %a) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@call_floor -; IS__TUNIT____-SAME: (float [[A:%.*]]) #[[ATTR0]] { +; IS__TUNIT____-SAME: (float [[A:%.*]]) [[ATTR0]] { ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@call_floor -; IS__CGSCC____-SAME: (float [[A:%.*]]) #[[ATTR0]] { +; IS__CGSCC____-SAME: (float [[A:%.*]]) [[ATTR0]] { ; IS__CGSCC____-NEXT: ret void ; tail call float @llvm.floor.f32(float %a) @@ -477,26 +477,26 @@ define float @call_floor2(float %a) #0 { ; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn mustprogress ; 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]]) #[[ATTR18:[0-9]+]] +; IS__TUNIT_OPM-SAME: (float [[A:%.*]]) [[ATTR0:#.*]] { +; IS__TUNIT_OPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) [[ATTR17]] ; IS__TUNIT_OPM-NEXT: ret float [[C]] ; ; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn mustprogress ; 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]]) #[[ATTR21:[0-9]+]] +; IS__TUNIT_NPM-SAME: (float [[A:%.*]]) [[ATTR0]] { +; IS__TUNIT_NPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) [[ATTR20]] ; IS__TUNIT_NPM-NEXT: ret float [[C]] ; ; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn mustprogress ; 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]]) #[[ATTR22:[0-9]+]] +; IS__CGSCC_OPM-SAME: (float [[A:%.*]]) [[ATTR9:#.*]] { +; IS__CGSCC_OPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) [[ATTR20]] ; IS__CGSCC_OPM-NEXT: ret float [[C]] ; ; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn mustprogress ; 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]]) #[[ATTR25:[0-9]+]] +; IS__CGSCC_NPM-SAME: (float [[A:%.*]]) [[ATTR9:#.*]] { +; IS__CGSCC_NPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) [[ATTR23]] ; IS__CGSCC_NPM-NEXT: ret float [[C]] ; %c = tail call float @llvm.floor.f32(float %a) @@ -513,29 +513,11 @@ 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() #[[ATTR19:[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() #[[ATTR22:[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() #[[ATTR23:[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() #[[ATTR26:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret void +; CHECK: Function Attrs: noinline nounwind uwtable +; CHECK-LABEL: define {{[^@]+}}@call_maybe_noreturn +; CHECK-SAME: () [[ATTR7:#.*]] { +; CHECK-NEXT: tail call void @maybe_noreturn() +; CHECK-NEXT: ret void ; tail call void @maybe_noreturn() ret void @@ -550,28 +532,28 @@ declare void @will_return() willreturn norecurse define void @f1() #0 { -; IS__TUNIT_OPM: Function Attrs: noinline nounwind uwtable willreturn mustprogress +; 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() #[[ATTR18]] +; IS__TUNIT_OPM-SAME: () [[ATTR9:#.*]] { +; IS__TUNIT_OPM-NEXT: tail call void @will_return() [[ATTR17]] ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: noinline nounwind uwtable willreturn mustprogress +; 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() #[[ATTR21]] +; IS__TUNIT_NPM-SAME: () [[ATTR9:#.*]] { +; IS__TUNIT_NPM-NEXT: tail call void @will_return() [[ATTR20]] ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: noinline norecurse nounwind uwtable willreturn mustprogress +; 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() #[[ATTR22]] +; IS__CGSCC_OPM-SAME: () [[ATTR11:#.*]] { +; IS__CGSCC_OPM-NEXT: tail call void @will_return() [[ATTR22:#.*]] ; IS__CGSCC_OPM-NEXT: ret void ; -; IS__CGSCC_NPM: Function Attrs: noinline norecurse nounwind uwtable willreturn mustprogress +; 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() #[[ATTR25]] +; IS__CGSCC_NPM-SAME: () [[ATTR11:#.*]] { +; IS__CGSCC_NPM-NEXT: tail call void @will_return() [[ATTR25:#.*]] ; IS__CGSCC_NPM-NEXT: ret void ; tail call void @will_return() @@ -579,28 +561,28 @@ } define void @f2() #0 { -; IS__TUNIT_OPM: Function Attrs: noinline nounwind uwtable willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: noinline nounwind uwtable willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@f2 -; IS__TUNIT_OPM-SAME: () #[[ATTR9]] { -; IS__TUNIT_OPM-NEXT: tail call void @f1() #[[ATTR16]] +; IS__TUNIT_OPM-SAME: () [[ATTR9]] { +; IS__TUNIT_OPM-NEXT: tail call void @f1() [[ATTR17]] ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: noinline nounwind uwtable willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: noinline nounwind uwtable willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f2 -; IS__TUNIT_NPM-SAME: () #[[ATTR9]] { -; IS__TUNIT_NPM-NEXT: tail call void @f1() #[[ATTR19]] +; IS__TUNIT_NPM-SAME: () [[ATTR9]] { +; IS__TUNIT_NPM-NEXT: tail call void @f1() [[ATTR20]] ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: noinline norecurse nounwind uwtable willreturn mustprogress +; IS__CGSCC_OPM: Function Attrs: noinline norecurse nounwind uwtable willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f2 -; IS__CGSCC_OPM-SAME: () #[[ATTR11]] { -; IS__CGSCC_OPM-NEXT: tail call void @f1() #[[ATTR20]] +; IS__CGSCC_OPM-SAME: () [[ATTR11]] { +; IS__CGSCC_OPM-NEXT: tail call void @f1() [[ATTR20]] ; IS__CGSCC_OPM-NEXT: ret void ; -; IS__CGSCC_NPM: Function Attrs: noinline norecurse nounwind uwtable willreturn mustprogress +; IS__CGSCC_NPM: Function Attrs: noinline norecurse nounwind uwtable willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f2 -; IS__CGSCC_NPM-SAME: () #[[ATTR11]] { -; IS__CGSCC_NPM-NEXT: tail call void @f1() #[[ATTR23]] +; IS__CGSCC_NPM-SAME: () [[ATTR11]] { +; IS__CGSCC_NPM-NEXT: tail call void @f1() [[ATTR23]] ; IS__CGSCC_NPM-NEXT: ret void ; tail call void @f1() @@ -614,7 +596,7 @@ 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____-SAME: () [[ATTR5]] { ; IS__TUNIT____-NEXT: br label [[LABEL1:%.*]] ; IS__TUNIT____: label1: ; IS__TUNIT____-NEXT: tail call void @will_return() @@ -624,7 +606,7 @@ ; ; 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____-SAME: () [[ATTR12:#.*]] { ; IS__CGSCC____-NEXT: br label [[LABEL1:%.*]] ; IS__CGSCC____: label1: ; IS__CGSCC____-NEXT: tail call void @will_return() @@ -649,10 +631,10 @@ declare i1 @maybe_raise_exception() #1 willreturn define void @invoke_test() personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT_OPM: Function Attrs: nounwind willreturn mustprogress +; IS__TUNIT_OPM: Function Attrs: nounwind willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@invoke_test -; IS__TUNIT_OPM-SAME: () #[[ATTR11:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR18]] +; IS__TUNIT_OPM-SAME: () [[ATTR11:#.*]] personality i32 (...)* @__gxx_personality_v0 { +; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() [[ATTR17]] ; IS__TUNIT_OPM-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] ; IS__TUNIT_OPM: N: ; IS__TUNIT_OPM-NEXT: ret void @@ -661,10 +643,10 @@ ; IS__TUNIT_OPM-NEXT: catch i8* null ; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: nounwind willreturn mustprogress +; IS__TUNIT_NPM: Function Attrs: nounwind willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@invoke_test -; IS__TUNIT_NPM-SAME: () #[[ATTR11:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR21]] +; IS__TUNIT_NPM-SAME: () [[ATTR11:#.*]] personality i32 (...)* @__gxx_personality_v0 { +; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() [[ATTR20]] ; IS__TUNIT_NPM-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] ; IS__TUNIT_NPM: N: ; IS__TUNIT_NPM-NEXT: ret void @@ -673,10 +655,10 @@ ; IS__TUNIT_NPM-NEXT: catch i8* null ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn mustprogress +; IS__CGSCC_OPM: Function Attrs: nounwind willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@invoke_test -; IS__CGSCC_OPM-SAME: () #[[ATTR14:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 { -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR22]] +; IS__CGSCC_OPM-SAME: () [[ATTR14:#.*]] personality i32 (...)* @__gxx_personality_v0 { +; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() [[ATTR20]] ; IS__CGSCC_OPM-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] ; IS__CGSCC_OPM: N: ; IS__CGSCC_OPM-NEXT: ret void @@ -685,10 +667,10 @@ ; IS__CGSCC_OPM-NEXT: catch i8* null ; IS__CGSCC_OPM-NEXT: ret void ; -; IS__CGSCC_NPM: Function Attrs: nounwind willreturn mustprogress +; IS__CGSCC_NPM: Function Attrs: nounwind willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@invoke_test -; IS__CGSCC_NPM-SAME: () #[[ATTR14:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 { -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR25]] +; IS__CGSCC_NPM-SAME: () [[ATTR14:#.*]] personality i32 (...)* @__gxx_personality_v0 { +; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() [[ATTR23]] ; IS__CGSCC_NPM-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] ; IS__CGSCC_NPM: N: ; IS__CGSCC_NPM-NEXT: ret void @@ -723,7 +705,7 @@ 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-SAME: (i32* nocapture nofree readonly [[TMP0:%.*]]) [[ATTR12:#.*]] { ; IS__TUNIT_OPM-NEXT: br label [[TMP3:%.*]] ; IS__TUNIT_OPM: 2: ; IS__TUNIT_OPM-NEXT: ret i32 [[TMP8:%.*]] @@ -739,7 +721,7 @@ ; ; IS__TUNIT_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn mustprogress ; 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-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) [[ATTR12:#.*]] { ; IS__TUNIT_NPM-NEXT: br label [[TMP3:%.*]] ; IS__TUNIT_NPM: 2: ; IS__TUNIT_NPM-NEXT: ret i32 [[TMP8:%.*]] @@ -755,7 +737,7 @@ ; ; 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-SAME: (i32* nocapture nofree readonly [[TMP0:%.*]]) [[ATTR15:#.*]] { ; IS__CGSCC_OPM-NEXT: br label [[TMP3:%.*]] ; IS__CGSCC_OPM: 2: ; IS__CGSCC_OPM-NEXT: ret i32 [[TMP8:%.*]] @@ -771,7 +753,7 @@ ; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn mustprogress ; 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-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) [[ATTR15:#.*]] { ; IS__CGSCC_NPM-NEXT: br label [[TMP3:%.*]] ; IS__CGSCC_NPM: 2: ; IS__CGSCC_NPM-NEXT: ret i32 [[TMP8:%.*]] @@ -813,81 +795,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__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@loop_trip_count_unbound +; IS__TUNIT____-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr [[ATTR13:#.*]] { +; IS__TUNIT____-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] +; IS__TUNIT____-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] +; IS__TUNIT____: 6: +; IS__TUNIT____-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] +; IS__TUNIT____-NEXT: ret i32 [[TMP7]] +; IS__TUNIT____: 8: +; IS__TUNIT____-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] +; IS__TUNIT____-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] +; IS__TUNIT____-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 +; IS__TUNIT____-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] +; IS__TUNIT____-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 +; IS__TUNIT____-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] +; IS__TUNIT____-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] +; IS__TUNIT____-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] +; IS__TUNIT____-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] +; +; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@loop_trip_count_unbound +; IS__CGSCC____-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr [[ATTR16:#.*]] { +; IS__CGSCC____-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] +; IS__CGSCC____-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] +; IS__CGSCC____: 6: +; IS__CGSCC____-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] +; IS__CGSCC____-NEXT: ret i32 [[TMP7]] +; IS__CGSCC____: 8: +; IS__CGSCC____-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] +; IS__CGSCC____-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] +; IS__CGSCC____-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 +; IS__CGSCC____-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] +; IS__CGSCC____-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 +; IS__CGSCC____-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] +; IS__CGSCC____-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] +; IS__CGSCC____-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] +; IS__CGSCC____-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] ; %5 = icmp eq i32 %0, %1 br i1 %5, label %6, label %8 @@ -923,7 +867,7 @@ 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-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: @@ -944,7 +888,7 @@ ; ; IS__TUNIT_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn mustprogress ; 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-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: @@ -965,7 +909,7 @@ ; ; 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-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: @@ -986,7 +930,7 @@ ; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn mustprogress ; 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-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: @@ -1033,7 +977,7 @@ define i32 @multiple_return(i32 %a) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn mustprogress ; IS__TUNIT____-LABEL: define {{[^@]+}}@multiple_return -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { +; 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: @@ -1043,7 +987,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn mustprogress ; IS__CGSCC____-LABEL: define {{[^@]+}}@multiple_return -; IS__CGSCC____-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { +; 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: @@ -1065,34 +1009,34 @@ ; 15.1 (positive case) define void @unreachable_exit_positive1() #0 { -; IS__TUNIT_OPM: Function Attrs: noinline nounwind uwtable willreturn mustprogress +; 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() #[[ATTR18]] +; IS__TUNIT_OPM-SAME: () [[ATTR9]] { +; IS__TUNIT_OPM-NEXT: tail call void @will_return() [[ATTR17]] ; 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 mustprogress +; 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() #[[ATTR21]] +; IS__TUNIT_NPM-SAME: () [[ATTR9]] { +; IS__TUNIT_NPM-NEXT: tail call void @will_return() [[ATTR20]] ; 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 mustprogress +; 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() #[[ATTR22]] +; IS__CGSCC_OPM-SAME: () [[ATTR11]] { +; IS__CGSCC_OPM-NEXT: tail call void @will_return() [[ATTR20]] ; 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 mustprogress +; 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() #[[ATTR25]] +; IS__CGSCC_NPM-SAME: () [[ATTR11]] { +; IS__CGSCC_NPM-NEXT: tail call void @will_return() [[ATTR23]] ; IS__CGSCC_NPM-NEXT: ret void ; IS__CGSCC_NPM: unreachable_label: ; IS__CGSCC_NPM-NEXT: unreachable @@ -1108,7 +1052,7 @@ 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-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: @@ -1126,7 +1070,7 @@ ; ; 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 #[[ATTR14:[0-9]+]] { +; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr [[ATTR14:#.*]] { ; 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: @@ -1144,7 +1088,7 @@ ; ; 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-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: @@ -1162,7 +1106,7 @@ ; ; 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 #[[ATTR17:[0-9]+]] { +; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr [[ATTR17:#.*]] { ; 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: @@ -1204,16 +1148,16 @@ define void @unreachable_exit_negative1() #0 { ; IS__TUNIT____: Function Attrs: noinline noreturn nounwind uwtable ; IS__TUNIT____-LABEL: define {{[^@]+}}@unreachable_exit_negative1 -; IS__TUNIT____-SAME: () #[[ATTR5]] { -; IS__TUNIT____-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR4]] +; IS__TUNIT____-SAME: () [[ATTR5]] { +; 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 noreturn nounwind uwtable ; IS__CGSCC____-LABEL: define {{[^@]+}}@unreachable_exit_negative1 -; IS__CGSCC____-SAME: () #[[ATTR6]] { -; IS__CGSCC____-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5]] +; IS__CGSCC____-SAME: () [[ATTR6]] { +; IS__CGSCC____-NEXT: tail call void @exit(i32 noundef 0) [[ATTR5]] ; IS__CGSCC____-NEXT: unreachable ; IS__CGSCC____: unreachable_label: ; IS__CGSCC____-NEXT: unreachable @@ -1227,49 +1171,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: () #[[ATTR15:[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__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@unreachable_exit_negative2 +; IS__TUNIT____-SAME: () [[ATTR15:#.*]] { +; IS__TUNIT____-NEXT: br label [[L1:%.*]] +; IS__TUNIT____: L1: +; IS__TUNIT____-NEXT: br label [[L2:%.*]] +; IS__TUNIT____: L2: +; IS__TUNIT____-NEXT: br label [[L1]] +; IS__TUNIT____: unreachable_label: +; IS__TUNIT____-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: () #[[ATTR18:[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__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@unreachable_exit_negative2 +; IS__CGSCC____-SAME: () [[ATTR18:#.*]] { +; IS__CGSCC____-NEXT: br label [[L1:%.*]] +; IS__CGSCC____: L1: +; IS__CGSCC____-NEXT: br label [[L2:%.*]] +; IS__CGSCC____: L2: +; IS__CGSCC____-NEXT: br label [[L1]] +; IS__CGSCC____: unreachable_label: +; IS__CGSCC____-NEXT: unreachable ; br label %L1 L1: @@ -1289,14 +1211,14 @@ define void @call_longjmp(i8* nocapture readnone %0) local_unnamed_addr #0 { ; IS__TUNIT____: Function Attrs: noinline noreturn nounwind uwtable ; IS__TUNIT____-LABEL: define {{[^@]+}}@call_longjmp -; IS__TUNIT____-SAME: (i8* nocapture readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR5]] { -; IS__TUNIT____-NEXT: tail call void @llvm.eh.sjlj.longjmp(i8* noalias readnone [[TMP0]]) #[[ATTR4]] +; IS__TUNIT____-SAME: (i8* nocapture readnone [[TMP0:%.*]]) local_unnamed_addr [[ATTR5]] { +; IS__TUNIT____-NEXT: tail call void @llvm.eh.sjlj.longjmp(i8* noalias readnone [[TMP0]]) [[ATTR4]] ; IS__TUNIT____-NEXT: unreachable ; ; IS__CGSCC____: Function Attrs: noinline noreturn nounwind uwtable ; IS__CGSCC____-LABEL: define {{[^@]+}}@call_longjmp -; IS__CGSCC____-SAME: (i8* nocapture readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR6]] { -; IS__CGSCC____-NEXT: tail call void @llvm.eh.sjlj.longjmp(i8* noalias readnone [[TMP0]]) #[[ATTR5]] +; IS__CGSCC____-SAME: (i8* nocapture readnone [[TMP0:%.*]]) local_unnamed_addr [[ATTR6]] { +; IS__CGSCC____-NEXT: tail call void @llvm.eh.sjlj.longjmp(i8* noalias readnone [[TMP0]]) [[ATTR5]] ; IS__CGSCC____-NEXT: unreachable ; tail call void @llvm.eh.sjlj.longjmp(i8* %0) @@ -1315,89 +1237,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:%.*]]) #[[ATTR17]] { -; 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__TUNIT____: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT____-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop +; IS__TUNIT____-SAME: (i32 [[N:%.*]]) [[ATTR17:#.*]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: br label [[FOR_COND:%.*]] +; IS__TUNIT____: for.cond: +; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 +; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; IS__TUNIT____: for.cond.cleanup: +; IS__TUNIT____-NEXT: br label [[FOR_END:%.*]] +; IS__TUNIT____: for.body: +; IS__TUNIT____-NEXT: br label [[WHILE_COND:%.*]] +; IS__TUNIT____: while.cond: +; IS__TUNIT____-NEXT: br label [[WHILE_BODY:%.*]] +; IS__TUNIT____: while.body: +; IS__TUNIT____-NEXT: br label [[WHILE_COND]] +; IS__TUNIT____: for.inc: +; IS__TUNIT____-NEXT: unreachable +; IS__TUNIT____: for.end: +; IS__TUNIT____-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:%.*]]) #[[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: [[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__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone +; IS__CGSCC____-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop +; IS__CGSCC____-SAME: (i32 [[N:%.*]]) [[ATTR20:#.*]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: br label [[FOR_COND:%.*]] +; IS__CGSCC____: for.cond: +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 +; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; IS__CGSCC____: for.cond.cleanup: +; IS__CGSCC____-NEXT: br label [[FOR_END:%.*]] +; IS__CGSCC____: for.body: +; IS__CGSCC____-NEXT: br label [[WHILE_COND:%.*]] +; IS__CGSCC____: while.cond: +; IS__CGSCC____-NEXT: br label [[WHILE_BODY:%.*]] +; IS__CGSCC____: while.body: +; IS__CGSCC____-NEXT: br label [[WHILE_COND]] +; IS__CGSCC____: for.inc: +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: for.end: +; IS__CGSCC____-NEXT: ret i32 0 ; entry: br label %for.cond @@ -1441,7 +1321,7 @@ 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-SAME: (i32 [[N:%.*]]) [[ATTR15:#.*]] { ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] ; IS__TUNIT_OPM: for.cond: @@ -1470,7 +1350,7 @@ ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@bounded_nested_loops -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR18:[0-9]+]] { +; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) [[ATTR18:#.*]] { ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] ; IS__TUNIT_NPM: for.cond: @@ -1499,7 +1379,7 @@ ; ; 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-SAME: (i32 [[N:%.*]]) [[ATTR18:#.*]] { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] ; IS__CGSCC_OPM: for.cond: @@ -1528,7 +1408,7 @@ ; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bounded_nested_loops -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR21:[0-9]+]] { +; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) [[ATTR21:#.*]] { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] ; IS__CGSCC_NPM: for.cond: @@ -1603,129 +1483,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:%.*]]) #[[ATTR17]] { -; 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:%.*]]) #[[ATTR20]] { -; 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__TUNIT____: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT____-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop +; IS__TUNIT____-SAME: (i32 [[N:%.*]]) [[ATTR17]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: br label [[WHILE_COND:%.*]] +; IS__TUNIT____: while.cond: +; IS__TUNIT____-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] +; IS__TUNIT____-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] +; IS__TUNIT____-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 +; IS__TUNIT____-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 +; IS__TUNIT____-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 +; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 +; IS__TUNIT____-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] +; IS__TUNIT____: while.body: +; IS__TUNIT____-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 +; IS__TUNIT____-NEXT: br label [[FOR_COND:%.*]] +; IS__TUNIT____: for.cond: +; IS__TUNIT____-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] +; IS__TUNIT____: for.cond.cleanup: +; IS__TUNIT____-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] +; IS__TUNIT____-NEXT: br label [[FOR_END]] +; IS__TUNIT____: for.body: +; IS__TUNIT____-NEXT: unreachable +; IS__TUNIT____: for.inc: +; IS__TUNIT____-NEXT: unreachable +; IS__TUNIT____: for.end: +; IS__TUNIT____-NEXT: br label [[WHILE_COND]] +; IS__TUNIT____: while.end: +; IS__TUNIT____-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] +; IS__TUNIT____-NEXT: ret i32 [[ANS_0_LCSSA]] +; +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone +; IS__CGSCC____-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop +; IS__CGSCC____-SAME: (i32 [[N:%.*]]) [[ATTR20]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: br label [[WHILE_COND:%.*]] +; IS__CGSCC____: while.cond: +; IS__CGSCC____-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] +; IS__CGSCC____-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] +; IS__CGSCC____-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 +; IS__CGSCC____-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 +; IS__CGSCC____-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 +; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 +; IS__CGSCC____-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] +; IS__CGSCC____: while.body: +; IS__CGSCC____-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 +; IS__CGSCC____-NEXT: br label [[FOR_COND:%.*]] +; IS__CGSCC____: for.cond: +; IS__CGSCC____-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] +; IS__CGSCC____: for.cond.cleanup: +; IS__CGSCC____-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] +; IS__CGSCC____-NEXT: br label [[FOR_END]] +; IS__CGSCC____: for.body: +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: for.inc: +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: for.end: +; IS__CGSCC____-NEXT: br label [[WHILE_COND]] +; IS__CGSCC____: while.end: +; IS__CGSCC____-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] +; IS__CGSCC____-NEXT: ret i32 [[ANS_0_LCSSA]] ; entry: br label %while.cond @@ -1780,125 +1598,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:%.*]]) #[[ATTR17]] { -; 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:%.*]]) #[[ATTR20]] { -; 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__TUNIT____: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT____-LABEL: define {{[^@]+}}@nested_unbounded_loops +; IS__TUNIT____-SAME: (i32 [[N:%.*]]) [[ATTR17]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: br label [[WHILE_COND:%.*]] +; IS__TUNIT____: while.cond: +; IS__TUNIT____-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] +; IS__TUNIT____-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] +; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 +; IS__TUNIT____-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] +; IS__TUNIT____: while.body: +; IS__TUNIT____-NEXT: br label [[WHILE_COND1:%.*]] +; IS__TUNIT____: while.cond1: +; IS__TUNIT____-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] +; IS__TUNIT____: while.body4: +; IS__TUNIT____-NEXT: unreachable +; IS__TUNIT____: while.end: +; IS__TUNIT____-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 +; IS__TUNIT____-NEXT: br label [[WHILE_COND5:%.*]] +; IS__TUNIT____: while.cond5: +; IS__TUNIT____-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] +; IS__TUNIT____: while.body8: +; IS__TUNIT____-NEXT: unreachable +; IS__TUNIT____: while.end10: +; IS__TUNIT____-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] +; IS__TUNIT____-NEXT: br label [[WHILE_COND]] +; IS__TUNIT____: while.end11: +; IS__TUNIT____-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] +; IS__TUNIT____-NEXT: ret i32 [[ANS_0_LCSSA]] +; +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone +; IS__CGSCC____-LABEL: define {{[^@]+}}@nested_unbounded_loops +; IS__CGSCC____-SAME: (i32 [[N:%.*]]) [[ATTR20]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: br label [[WHILE_COND:%.*]] +; IS__CGSCC____: while.cond: +; IS__CGSCC____-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] +; IS__CGSCC____-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] +; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 +; IS__CGSCC____-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] +; IS__CGSCC____: while.body: +; IS__CGSCC____-NEXT: br label [[WHILE_COND1:%.*]] +; IS__CGSCC____: while.cond1: +; IS__CGSCC____-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] +; IS__CGSCC____: while.body4: +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: while.end: +; IS__CGSCC____-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 +; IS__CGSCC____-NEXT: br label [[WHILE_COND5:%.*]] +; IS__CGSCC____: while.cond5: +; IS__CGSCC____-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] +; IS__CGSCC____: while.body8: +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: while.end10: +; IS__CGSCC____-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] +; IS__CGSCC____-NEXT: br label [[WHILE_COND]] +; IS__CGSCC____: while.end11: +; IS__CGSCC____-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] +; IS__CGSCC____-NEXT: ret i32 [[ANS_0_LCSSA]] ; entry: br label %while.cond @@ -1962,9 +1720,9 @@ define void @non_loop_cycle(i32 %n) { ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@non_loop_cycle -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR15]] { +; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) [[ATTR15]] { ; 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]]) [[ATTR16]] ; 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: @@ -1972,7 +1730,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]]) [[ATTR15]] ; 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: @@ -1980,7 +1738,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]]) [[ATTR15]] ; 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: @@ -1992,9 +1750,9 @@ ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@non_loop_cycle -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR17]] { +; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) [[ATTR17:#.*]] { ; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR17]] +; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) [[ATTR19]] ; 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: @@ -2002,7 +1760,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]]) #[[ATTR17]] +; IS__TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) [[ATTR17]] ; 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: @@ -2010,7 +1768,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]]) #[[ATTR17]] +; IS__TUNIT_NPM-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) [[ATTR17]] ; 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: @@ -2020,65 +1778,35 @@ ; IS__TUNIT_NPM: exit: ; IS__TUNIT_NPM-NEXT: ret void ; -; 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-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) -; 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: -; IS__CGSCC_OPM-NEXT: br label [[ENTRY1:%.*]] -; 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]]) -; 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: -; IS__CGSCC_OPM-NEXT: br label [[EXIT:%.*]] -; 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]]) -; 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: -; IS__CGSCC_OPM-NEXT: br label [[EXIT]] -; IS__CGSCC_OPM: if.else8: -; IS__CGSCC_OPM-NEXT: br label [[ENTRY1]] -; IS__CGSCC_OPM: exit: -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@non_loop_cycle -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR20]] { -; 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 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__CGSCC_NPM: if.then: -; IS__CGSCC_NPM-NEXT: br label [[ENTRY1:%.*]] -; IS__CGSCC_NPM: if.else: -; IS__CGSCC_NPM-NEXT: br label [[ENTRY2:%.*]] -; IS__CGSCC_NPM: entry1: -; IS__CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) -; IS__CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[CALL1]], 5 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_ELSE4:%.*]] -; IS__CGSCC_NPM: if.then3: -; IS__CGSCC_NPM-NEXT: br label [[EXIT:%.*]] -; IS__CGSCC_NPM: if.else4: -; IS__CGSCC_NPM-NEXT: br label [[ENTRY2]] -; IS__CGSCC_NPM: entry2: -; IS__CGSCC_NPM-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) -; IS__CGSCC_NPM-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[CALL5]], 5 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP6]], label [[IF_THEN7:%.*]], label [[IF_ELSE8:%.*]] -; IS__CGSCC_NPM: if.then7: -; IS__CGSCC_NPM-NEXT: br label [[EXIT]] -; IS__CGSCC_NPM: if.else8: -; IS__CGSCC_NPM-NEXT: br label [[ENTRY1]] -; IS__CGSCC_NPM: exit: -; IS__CGSCC_NPM-NEXT: ret void +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone +; IS__CGSCC____-LABEL: define {{[^@]+}}@non_loop_cycle +; IS__CGSCC____-SAME: (i32 [[N:%.*]]) [[ATTR20]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CALL]], 5 +; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; IS__CGSCC____: if.then: +; IS__CGSCC____-NEXT: br label [[ENTRY1:%.*]] +; IS__CGSCC____: if.else: +; IS__CGSCC____-NEXT: br label [[ENTRY2:%.*]] +; IS__CGSCC____: entry1: +; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) +; IS__CGSCC____-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[CALL1]], 5 +; IS__CGSCC____-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_ELSE4:%.*]] +; IS__CGSCC____: if.then3: +; IS__CGSCC____-NEXT: br label [[EXIT:%.*]] +; IS__CGSCC____: if.else4: +; IS__CGSCC____-NEXT: br label [[ENTRY2]] +; IS__CGSCC____: entry2: +; IS__CGSCC____-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) +; IS__CGSCC____-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[CALL5]], 5 +; IS__CGSCC____-NEXT: br i1 [[CMP6]], label [[IF_THEN7:%.*]], label [[IF_ELSE8:%.*]] +; IS__CGSCC____: if.then7: +; IS__CGSCC____-NEXT: br label [[EXIT]] +; IS__CGSCC____: if.else8: +; IS__CGSCC____-NEXT: br label [[ENTRY1]] +; IS__CGSCC____: exit: +; IS__CGSCC____-NEXT: ret void ; entry: %call = call i32 @fact_loop(i32 %n)