diff --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp index 4e4f768ed2cbd..de36d5d89a185 100644 --- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp +++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp @@ -9586,7 +9586,8 @@ struct AACallEdgesFunction : public AACallEdgesImpl { // Visit all callable instructions. bool UsedAssumedInformation = false; if (!A.checkForAllCallLikeInstructions(ProcessCallInst, *this, - UsedAssumedInformation)) { + UsedAssumedInformation, + /* CheckBBLivenessOnly */ true)) { // If we haven't looked at all call like instructions, assume that there // are unknown callees. setHasUnknownCallee(true, Change); diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll index e2a78f1af66c6..0b946d41f008c 100644 --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 -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/X86/attributes.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll index c3060fd404159..b077dd3887800 100644 --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM +; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 ; Test that we only promote arguments when the caller/callee have compatible 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 index c2f764b9284c5..a7bcf1e42252d 100644 --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM +; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 ; Test that we only promote arguments when the caller/callee have compatible diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll index f8ec4d2ea3239..e0d0de56e05ce 100644 --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM +; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 @@ -76,7 +76,7 @@ define i32 @callercaller() { ; CHECK-LABEL: define {{[^@]+}}@callercaller ; CHECK-SAME: () #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4 -; CHECK-NEXT: ret i32 undef +; CHECK-NEXT: ret i32 3 ; %B = alloca i32 store i32 2, i32* %B diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll index 7f3c75ab0e600..927efa6bfb17e 100644 --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 -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 datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" @@ -35,7 +35,7 @@ define i32 @callercaller() { ; CHECK-LABEL: define {{[^@]+}}@callercaller ; CHECK-SAME: () #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4 -; CHECK-NEXT: ret i32 undef +; CHECK-NEXT: ret i32 3 ; %B = alloca i32 store i32 2, i32* %B 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 index 1bebfeeaee034..d368e22811894 100644 --- a/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll @@ -147,15 +147,15 @@ define i32 @unions() nounwind { ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unions ; IS__TUNIT_NPM-SAME: () #[[ATTR0]] { ; 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, i64 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[MYSTR_0_1]], align 8 -; IS__TUNIT_NPM-NEXT: call void @vfu1(i8 [[TMP0]], i32 [[TMP1]]) #[[ATTR0]] ; IS__TUNIT_NPM-NEXT: [[MYSTR_CAST1:%.*]] = bitcast %struct.MYstr* @mystr to i8* -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i8, i8* [[MYSTR_CAST1]], align 8 -; IS__TUNIT_NPM-NEXT: [[MYSTR_0_12:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i64 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[MYSTR_0_12]], align 8 +; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i8, i8* [[MYSTR_CAST1]], align 8 +; IS__TUNIT_NPM-NEXT: [[MYSTR_0_12:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i64 0, i32 1 +; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[MYSTR_0_12]], align 8 +; IS__TUNIT_NPM-NEXT: call void @vfu1(i8 [[TMP0]], i32 [[TMP1]]) #[[ATTR0]] +; IS__TUNIT_NPM-NEXT: [[MYSTR_CAST:%.*]] = bitcast %struct.MYstr* @mystr to i8* +; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i8, i8* [[MYSTR_CAST]], align 8 +; IS__TUNIT_NPM-NEXT: [[MYSTR_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i64 0, i32 1 +; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[MYSTR_0_1]], align 8 ; IS__TUNIT_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP2]], i32 [[TMP3]]) #[[ATTR2:[0-9]+]] ; IS__TUNIT_NPM-NEXT: ret i32 [[RESULT]] ; @@ -164,7 +164,7 @@ define i32 @unions() nounwind { ; IS__CGSCC_OPM-SAME: () #[[ATTR0]] { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: call void @vfu1(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) @mystr) #[[ATTR0]] -; IS__CGSCC_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR]]) align 8 dereferenceable(8) @mystr) #[[ATTR2:[0-9]+]] +; IS__CGSCC_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR]]) align 8 dereferenceable(8) @mystr) #[[ATTR0]] ; IS__CGSCC_OPM-NEXT: ret i32 [[RESULT]] ; ; IS__CGSCC_NPM: Function Attrs: nounwind @@ -176,7 +176,7 @@ define i32 @unions() nounwind { ; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i8, i8* getelementptr inbounds ([[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 0), align 8 ; IS__CGSCC_NPM-NEXT: [[MYSTR_0_12:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i64 0, i32 1 ; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[MYSTR_0_12]], align 8 -; IS__CGSCC_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP1]], i32 [[TMP2]]) #[[ATTR2:[0-9]+]] +; IS__CGSCC_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP1]], i32 [[TMP2]]) #[[ATTR0]] ; IS__CGSCC_NPM-NEXT: ret i32 [[RESULT]] ; entry: @@ -277,7 +277,7 @@ define i32 @unions_v2() nounwind { ; IS__CGSCC_OPM-SAME: () #[[ATTR0]] { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: call void @vfu1(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) @mystr) #[[ATTR0]] -; IS__CGSCC_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR]]) align 8 dereferenceable(8) @mystr) #[[ATTR2]] +; IS__CGSCC_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR]]) align 8 dereferenceable(8) @mystr) #[[ATTR0]] ; IS__CGSCC_OPM-NEXT: ret i32 [[RESULT]] ; ; IS__CGSCC_NPM: Function Attrs: nounwind @@ -293,11 +293,13 @@ entry: ret i32 %result } ;. -; NOT_CGSCC_NPM: attributes #[[ATTR0:[0-9]+]] = { nounwind } -; NOT_CGSCC_NPM: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR2:[0-9]+]] = { nounwind readonly } +; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { nounwind } +; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nounwind readonly } +;. +; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } ;. ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nounwind } ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nounwind readonly } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll b/llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll index 35bf2c469e6aa..dae4fd00e81bc 100644 --- a/llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM +; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=8 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM +; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=8 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -49,7 +49,7 @@ define void @fn2(i32* %P, i1 %C) { ; IS__CGSCC_OPM: if.end: ; IS__CGSCC_OPM-NEXT: [[E_2:%.*]] = phi i32* [ [[P]], [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] ; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[E_2]], align 4 -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @fn1(i32 [[TMP0]]) #[[ATTR3:[0-9]+]] +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @fn1(i32 [[TMP0]]) ; IS__CGSCC_OPM-NEXT: store i32 [[CALL]], i32* [[P]], align 4 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND1]] ; IS__CGSCC_OPM: exit: @@ -148,7 +148,7 @@ define void @fn_no_null_opt(i32* %P, i1 %C) null_pointer_is_valid { ; IS__CGSCC_OPM: if.end: ; IS__CGSCC_OPM-NEXT: [[E_2:%.*]] = phi i32* [ undef, [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] ; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* null, align 4294967296 -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @fn0(i32 [[TMP0]]) #[[ATTR3]] +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @fn0(i32 [[TMP0]]) ; IS__CGSCC_OPM-NEXT: store i32 [[CALL]], i32* [[P]], align 4 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND1]] ; IS__CGSCC_OPM: exit: @@ -212,12 +212,7 @@ entry: ; IS__TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind } ; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind null_pointer_is_valid } ;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind null_pointer_is_valid } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nounwind readnone } -;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind null_pointer_is_valid } +; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree norecurse nosync nounwind } +; IS__CGSCC____: attributes #[[ATTR1:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR2:[0-9]+]] = { nofree norecurse nosync nounwind null_pointer_is_valid } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll b/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll index 1b1198770875c..191ee3ae4ac61 100644 --- a/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll @@ -103,9 +103,9 @@ define dso_local i16 @vararg_tests(i16 %a) { ; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = add i16 7, [[CALL2]] ; NOT_CGSCC_NPM-NEXT: ret i16 [[ADD]] ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone +; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@vararg_tests -; IS__CGSCC_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR0]] { +; IS__CGSCC_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR2:[0-9]+]] { ; IS__CGSCC_NPM-NEXT: [[CALL2:%.*]] = call i16 bitcast (i16 (i16, i16, ...)* @vararg_no_prop to i16 (i16)*)(i16 noundef 7) ; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = add i16 7, [[CALL2]] ; IS__CGSCC_NPM-NEXT: ret i16 [[ADD]] @@ -140,4 +140,5 @@ define internal i16 @vararg_no_prop(i16 %p1, i16 %p2, ...) { ;. ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone } ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll b/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll index fa8e4e6639799..c86179399cd90 100644 --- a/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 @@ -66,24 +66,24 @@ define internal { i32, i32 } @foo(i32 %A, i32 %B) { } define void @caller(i1 %C) personality i32 (...)* @__gxx_personality_v0 { -; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS________OPM-LABEL: define {{[^@]+}}@caller -; IS________OPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] personality i32 (...)* @__gxx_personality_v0 { -; IS________OPM-NEXT: [[Q:%.*]] = alloca i32, align 4 -; IS________OPM-NEXT: [[W:%.*]] = call align 4 i32* @incdec(i1 [[C]], i32* noalias nofree noundef nonnull align 4 dereferenceable(4) "no-capture-maybe-returned" [[Q]]) #[[ATTR2:[0-9]+]] -; IS________OPM-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR3:[0-9]+]] -; IS________OPM-NEXT: [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0 -; IS________OPM-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR3]] -; IS________OPM-NEXT: br label [[OK:%.*]] -; IS________OPM: OK: -; IS________OPM-NEXT: [[X2:%.*]] = extractvalue { i32, i32 } [[S2]], 0 -; IS________OPM-NEXT: [[Z:%.*]] = add i32 [[X1]], [[X2]] -; IS________OPM-NEXT: store i32 [[Z]], i32* [[W]], align 4 -; IS________OPM-NEXT: br label [[RET:%.*]] -; IS________OPM: LPAD: -; IS________OPM-NEXT: unreachable -; IS________OPM: RET: -; IS________OPM-NEXT: ret void +; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@caller +; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] personality i32 (...)* @__gxx_personality_v0 { +; IS__TUNIT_OPM-NEXT: [[Q:%.*]] = alloca i32, align 4 +; IS__TUNIT_OPM-NEXT: [[W:%.*]] = call align 4 i32* @incdec(i1 [[C]], i32* noalias nofree noundef nonnull align 4 dereferenceable(4) "no-capture-maybe-returned" [[Q]]) #[[ATTR2:[0-9]+]] +; IS__TUNIT_OPM-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR3:[0-9]+]] +; IS__TUNIT_OPM-NEXT: [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0 +; IS__TUNIT_OPM-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR3]] +; IS__TUNIT_OPM-NEXT: br label [[OK:%.*]] +; IS__TUNIT_OPM: OK: +; IS__TUNIT_OPM-NEXT: [[X2:%.*]] = extractvalue { i32, i32 } [[S2]], 0 +; IS__TUNIT_OPM-NEXT: [[Z:%.*]] = add i32 [[X1]], [[X2]] +; IS__TUNIT_OPM-NEXT: store i32 [[Z]], i32* [[W]], align 4 +; IS__TUNIT_OPM-NEXT: br label [[RET:%.*]] +; IS__TUNIT_OPM: LPAD: +; IS__TUNIT_OPM-NEXT: unreachable +; IS__TUNIT_OPM: RET: +; IS__TUNIT_OPM-NEXT: ret void ; ; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@caller @@ -104,6 +104,25 @@ define void @caller(i1 %C) personality i32 (...)* @__gxx_personality_v0 { ; IS__TUNIT_NPM: RET: ; IS__TUNIT_NPM-NEXT: ret void ; +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller +; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] personality i32 (...)* @__gxx_personality_v0 { +; IS__CGSCC_OPM-NEXT: [[Q:%.*]] = alloca i32, align 4 +; IS__CGSCC_OPM-NEXT: [[W:%.*]] = call align 4 i32* @incdec(i1 [[C]], i32* noalias nofree noundef nonnull align 4 dereferenceable(4) "no-capture-maybe-returned" [[Q]]) #[[ATTR2:[0-9]+]] +; IS__CGSCC_OPM-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR3:[0-9]+]] +; IS__CGSCC_OPM-NEXT: [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0 +; IS__CGSCC_OPM-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR4:[0-9]+]] +; IS__CGSCC_OPM-NEXT: br label [[OK:%.*]] +; IS__CGSCC_OPM: OK: +; IS__CGSCC_OPM-NEXT: [[X2:%.*]] = extractvalue { i32, i32 } [[S2]], 0 +; IS__CGSCC_OPM-NEXT: [[Z:%.*]] = add i32 [[X1]], [[X2]] +; IS__CGSCC_OPM-NEXT: store i32 [[Z]], i32* [[W]], align 4 +; IS__CGSCC_OPM-NEXT: br label [[RET:%.*]] +; IS__CGSCC_OPM: LPAD: +; IS__CGSCC_OPM-NEXT: unreachable +; IS__CGSCC_OPM: RET: +; IS__CGSCC_OPM-NEXT: ret void +; ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller ; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] personality i32 (...)* @__gxx_personality_v0 { @@ -111,7 +130,7 @@ define void @caller(i1 %C) personality i32 (...)* @__gxx_personality_v0 { ; IS__CGSCC_NPM-NEXT: [[W:%.*]] = call i32* @incdec(i1 [[C]], i32* noalias nofree noundef nonnull align 4 dereferenceable(4) "no-capture-maybe-returned" [[Q]]) #[[ATTR2:[0-9]+]] ; IS__CGSCC_NPM-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR3:[0-9]+]] ; IS__CGSCC_NPM-NEXT: [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0 -; IS__CGSCC_NPM-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR3]] +; IS__CGSCC_NPM-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR4:[0-9]+]] ; IS__CGSCC_NPM-NEXT: br label [[OK:%.*]] ; IS__CGSCC_NPM: OK: ; IS__CGSCC_NPM-NEXT: [[X2:%.*]] = extractvalue { i32, i32 } [[S2]], 0 @@ -159,5 +178,6 @@ declare i32 @__gxx_personality_v0(...) ; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn } ; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC____: attributes #[[ATTR2:[0-9]+]] = { nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR3:[0-9]+]] = { nounwind readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR3:[0-9]+]] = { readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR4:[0-9]+]] = { nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll b/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll index e5b9c70b140bd..9129d25f6bbaf 100644 --- a/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll @@ -80,33 +80,19 @@ define %0 @caller(i1 %Q) { ; Similar to @caller but the result of both calls are actually used. define i32 @caller2(i1 %Q) { -; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller2 -; IS__TUNIT____-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: [[A:%.*]] = extractvalue [[TMP0]] [[X]], 0 -; IS__TUNIT____-NEXT: [[B:%.*]] = extractvalue [[TMP0]] [[X]], 1 -; IS__TUNIT____-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 [[Q]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: [[C:%.*]] = extractvalue [[TMP0]] [[Y]], 0 -; IS__TUNIT____-NEXT: [[D:%.*]] = extractvalue [[TMP0]] [[Y]], 1 -; IS__TUNIT____-NEXT: [[M:%.*]] = add i32 [[A]], [[C]] -; IS__TUNIT____-NEXT: [[N:%.*]] = add i32 [[B]], [[D]] -; IS__TUNIT____-NEXT: [[R:%.*]] = add i32 [[N]], [[M]] -; IS__TUNIT____-NEXT: ret i32 [[R]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller2 -; IS__CGSCC____-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC____-NEXT: [[A:%.*]] = extractvalue [[TMP0]] [[X]], 0 -; IS__CGSCC____-NEXT: [[B:%.*]] = extractvalue [[TMP0]] [[X]], 1 -; IS__CGSCC____-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 [[Q]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[C:%.*]] = extractvalue [[TMP0]] [[Y]], 0 -; IS__CGSCC____-NEXT: [[D:%.*]] = extractvalue [[TMP0]] [[Y]], 1 -; IS__CGSCC____-NEXT: [[M:%.*]] = add i32 [[A]], [[C]] -; IS__CGSCC____-NEXT: [[N:%.*]] = add i32 [[B]], [[D]] -; IS__CGSCC____-NEXT: [[R:%.*]] = add i32 [[N]], [[M]] -; IS__CGSCC____-NEXT: ret i32 [[R]] +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK-LABEL: define {{[^@]+}}@caller2 +; CHECK-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR1]] +; CHECK-NEXT: [[A:%.*]] = extractvalue [[TMP0]] [[X]], 0 +; CHECK-NEXT: [[B:%.*]] = extractvalue [[TMP0]] [[X]], 1 +; CHECK-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 [[Q]]) #[[ATTR1]] +; CHECK-NEXT: [[C:%.*]] = extractvalue [[TMP0]] [[Y]], 0 +; CHECK-NEXT: [[D:%.*]] = extractvalue [[TMP0]] [[Y]], 1 +; CHECK-NEXT: [[M:%.*]] = add i32 [[A]], [[C]] +; CHECK-NEXT: [[N:%.*]] = add i32 [[B]], [[D]] +; CHECK-NEXT: [[R:%.*]] = add i32 [[N]], [[M]] +; CHECK-NEXT: ret i32 [[R]] ; %X = call %0 @foo(i1 %Q) %A = extractvalue %0 %X, 0 @@ -126,5 +112,4 @@ define i32 @caller2(i1 %Q) { ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC____: attributes #[[ATTR1]] = { readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll b/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll index 5b5240df354c9..ee703cd066d6e 100644 --- a/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 -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 diff --git a/llvm/test/Transforms/Attributor/align.ll b/llvm/test/Transforms/Attributor/align.ll index 4f9a491605511..9084185ed41b5 100644 --- a/llvm/test/Transforms/Attributor/align.ll +++ b/llvm/test/Transforms/Attributor/align.ll @@ -86,20 +86,30 @@ define i32* @test5_2() { ; TEST 6 ; SCC define i32* @test6_1() #0 { -; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; CHECK-LABEL: define {{[^@]+}}@test6_1 -; CHECK-SAME: () #[[ATTR0]] { -; CHECK-NEXT: ret i32* undef +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test6_1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i32* undef +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test6_1 +; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { +; IS__CGSCC_NPM-NEXT: ret i32* undef ; %ret = tail call i32* @test6_2() ret i32* %ret } define i32* @test6_2() #0 { -; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; CHECK-LABEL: define {{[^@]+}}@test6_2 -; CHECK-SAME: () #[[ATTR0]] { -; CHECK-NEXT: ret i32* undef +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test6_2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i32* undef +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test6_2 +; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { +; IS__CGSCC_NPM-NEXT: ret i32* undef ; %ret = tail call i32* @test6_1() ret i32* %ret @@ -158,16 +168,27 @@ define internal i8* @f1(i8* readnone %0) local_unnamed_addr #0 { ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f2(i8* readnone %0) local_unnamed_addr #0 { -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@f2 -; IS__CGSCC____-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: 2: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: 3: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: 4: -; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f2 +; IS__CGSCC_OPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: unreachable +; IS__CGSCC_OPM: 2: +; IS__CGSCC_OPM-NEXT: unreachable +; IS__CGSCC_OPM: 3: +; IS__CGSCC_OPM-NEXT: unreachable +; IS__CGSCC_OPM: 4: +; IS__CGSCC_OPM-NEXT: unreachable +; +; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f2 +; IS__CGSCC_NPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: unreachable +; IS__CGSCC_NPM: 2: +; IS__CGSCC_NPM-NEXT: unreachable +; IS__CGSCC_NPM: 3: +; IS__CGSCC_NPM-NEXT: unreachable +; IS__CGSCC_NPM: 4: +; IS__CGSCC_NPM-NEXT: unreachable ; %2 = icmp eq i8* %0, null br i1 %2, label %5, label %3 @@ -188,14 +209,23 @@ define internal i8* @f2(i8* readnone %0) local_unnamed_addr #0 { ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f3(i8* readnone %0) local_unnamed_addr #0 { -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@f3 -; IS__CGSCC____-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__CGSCC____-NEXT: br label [[TMP3:%.*]] -; IS__CGSCC____: 2: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: 3: -; IS__CGSCC____-NEXT: ret i8* @a1 +; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f3 +; IS__CGSCC_OPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { +; IS__CGSCC_OPM-NEXT: br label [[TMP3:%.*]] +; IS__CGSCC_OPM: 2: +; IS__CGSCC_OPM-NEXT: unreachable +; IS__CGSCC_OPM: 3: +; IS__CGSCC_OPM-NEXT: ret i8* @a1 +; +; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f3 +; IS__CGSCC_NPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { +; IS__CGSCC_NPM-NEXT: br label [[TMP3:%.*]] +; IS__CGSCC_NPM: 2: +; IS__CGSCC_NPM-NEXT: unreachable +; IS__CGSCC_NPM: 3: +; IS__CGSCC_NPM-NEXT: ret i8* @a1 ; %2 = icmp eq i8* %0, null br i1 %2, label %3, label %5 @@ -259,16 +289,27 @@ define internal i8* @f1b(i8* readnone %0) local_unnamed_addr #0 { ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f2b(i8* readnone %0) local_unnamed_addr #0 { ; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@f2b -; IS__CGSCC____-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: 2: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: 3: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: 4: -; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f2b +; IS__CGSCC_OPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { +; IS__CGSCC_OPM-NEXT: unreachable +; IS__CGSCC_OPM: 2: +; IS__CGSCC_OPM-NEXT: unreachable +; IS__CGSCC_OPM: 3: +; IS__CGSCC_OPM-NEXT: unreachable +; IS__CGSCC_OPM: 4: +; IS__CGSCC_OPM-NEXT: unreachable +; +; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f2b +; IS__CGSCC_NPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { +; IS__CGSCC_NPM-NEXT: unreachable +; IS__CGSCC_NPM: 2: +; IS__CGSCC_NPM-NEXT: unreachable +; IS__CGSCC_NPM: 3: +; IS__CGSCC_NPM-NEXT: unreachable +; IS__CGSCC_NPM: 4: +; IS__CGSCC_NPM-NEXT: unreachable ; %2 = icmp eq i8* %0, null br i1 %2, label %5, label %3 @@ -290,14 +331,23 @@ define internal i8* @f2b(i8* readnone %0) local_unnamed_addr #0 { ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f3b(i8* readnone %0) local_unnamed_addr #0 { ; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@f3b -; IS__CGSCC____-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__CGSCC____-NEXT: br label [[TMP3:%.*]] -; IS__CGSCC____: 2: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: 3: -; IS__CGSCC____-NEXT: ret i8* @a1 +; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f3b +; IS__CGSCC_OPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { +; IS__CGSCC_OPM-NEXT: br label [[TMP3:%.*]] +; IS__CGSCC_OPM: 2: +; IS__CGSCC_OPM-NEXT: unreachable +; IS__CGSCC_OPM: 3: +; IS__CGSCC_OPM-NEXT: ret i8* @a1 +; +; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f3b +; IS__CGSCC_NPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { +; IS__CGSCC_NPM-NEXT: br label [[TMP3:%.*]] +; IS__CGSCC_NPM: 2: +; IS__CGSCC_NPM-NEXT: unreachable +; IS__CGSCC_NPM: 3: +; IS__CGSCC_NPM-NEXT: ret i8* @a1 ; %2 = icmp eq i8* %0, null br i1 %2, label %3, label %5 @@ -323,23 +373,23 @@ define align 4 i32* @test7b(i32* align 32 %p) #0 { ; TEST 8 define void @test8_helper() { -; IS__TUNIT____-LABEL: define {{[^@]+}}@test8_helper() { -; IS__TUNIT____-NEXT: [[PTR0:%.*]] = tail call i32* @unknown() -; IS__TUNIT____-NEXT: [[PTR1:%.*]] = tail call align 4 i32* @unknown() -; IS__TUNIT____-NEXT: [[PTR2:%.*]] = tail call align 8 i32* @unknown() -; IS__TUNIT____-NEXT: tail call void @test8(i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone [[PTR0]]) #[[ATTR1:[0-9]+]] -; IS__TUNIT____-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____-LABEL: define {{[^@]+}}@test8_helper() { -; IS__CGSCC____-NEXT: [[PTR0:%.*]] = tail call i32* @unknown() -; IS__CGSCC____-NEXT: [[PTR1:%.*]] = tail call align 4 i32* @unknown() -; IS__CGSCC____-NEXT: [[PTR2:%.*]] = tail call align 8 i32* @unknown() -; IS__CGSCC____-NEXT: tail call void @test8(i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone [[PTR0]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC____-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: ret void +; 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:[0-9]+]] +; 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:[0-9]+]] +; IS__CGSCC_OPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR3]] +; IS__CGSCC_OPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR3]] +; IS__CGSCC_OPM-NEXT: ret void ; %ptr0 = tail call i32* @unknown() %ptr1 = tail call align 4 i32* @unknown() @@ -353,21 +403,21 @@ define void @test8_helper() { declare void @user_i32_ptr(i32* nocapture readnone) nounwind define internal void @test8(i32* %a, i32* %b, i32* %c) { -; IS__TUNIT____: Function Attrs: nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@test8 -; IS__TUNIT____-SAME: (i32* noalias nocapture readnone align 4 [[A:%.*]], i32* noalias nocapture readnone align 4 [[B:%.*]], i32* noalias nocapture readnone [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@test8 -; IS__CGSCC____-SAME: (i32* noalias nocapture readnone align 4 [[A:%.*]], i32* noalias nocapture readnone align 4 [[B:%.*]], i32* noalias nocapture readnone [[C:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: ret void +; 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 ; call void @user_i32_ptr(i32* %a) call void @user_i32_ptr(i32* %b) @@ -395,43 +445,43 @@ define void @test9_traversal(i1 %cnd, i32* align 4 %B, i32* align 8 %C) { ; 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) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@test10a -; IS__TUNIT____-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 -; IS__TUNIT____-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: [[R:%.*]] = call align 32 i32* @test10a(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: store i32 1, i32* [[R]], align 32 -; IS__TUNIT____-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__TUNIT____-NEXT: br label [[E:%.*]] -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__TUNIT____-NEXT: store i32 -1, i32* [[G1]], align 32 -; IS__TUNIT____-NEXT: br label [[E]] -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] -; IS__TUNIT____-NEXT: ret i32* [[PHI]] -; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@test10a -; IS__CGSCC____-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 -; IS__CGSCC____-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: [[R:%.*]] = call align 32 i32* @test10a(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR3]] -; IS__CGSCC____-NEXT: store i32 1, i32* [[R]], align 32 -; IS__CGSCC____-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__CGSCC____-NEXT: br label [[E:%.*]] -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__CGSCC____-NEXT: store i32 -1, i32* [[G1]], align 32 -; IS__CGSCC____-NEXT: br label [[E]] -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] -; IS__CGSCC____-NEXT: ret i32* [[PHI]] +; NOT_CGSCC_OPM: Function Attrs: nofree nosync nounwind +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test10a +; NOT_CGSCC_OPM-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3:[0-9]+]] { +; 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 noundef 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 noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 +; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 +; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC_OPM: t: +; IS__CGSCC_OPM-NEXT: [[R:%.*]] = call align 32 i32* @test10a(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR4]] +; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[R]], align 32 +; IS__CGSCC_OPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; IS__CGSCC_OPM-NEXT: br label [[E:%.*]] +; IS__CGSCC_OPM: f: +; IS__CGSCC_OPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; IS__CGSCC_OPM-NEXT: store i32 -1, i32* [[G1]], align 32 +; IS__CGSCC_OPM-NEXT: br label [[E]] +; IS__CGSCC_OPM: e: +; IS__CGSCC_OPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] +; IS__CGSCC_OPM-NEXT: ret i32* [[PHI]] ; %l = load i32, i32* %p %c = icmp eq i32 %l, 0 @@ -457,43 +507,43 @@ e: ; 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) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@test10b -; IS__TUNIT____-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 -; IS__TUNIT____-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: [[R:%.*]] = call align 32 i32* @test10b(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: store i32 1, i32* [[R]], align 32 -; IS__TUNIT____-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__TUNIT____-NEXT: br label [[E:%.*]] -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8 -; IS__TUNIT____-NEXT: store i32 -1, i32* [[G1]], align 32 -; IS__TUNIT____-NEXT: br label [[E]] -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] -; IS__TUNIT____-NEXT: ret i32* [[PHI]] -; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@test10b -; IS__CGSCC____-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 -; IS__CGSCC____-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: [[R:%.*]] = call align 32 i32* @test10b(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR3]] -; IS__CGSCC____-NEXT: store i32 1, i32* [[R]], align 32 -; IS__CGSCC____-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__CGSCC____-NEXT: br label [[E:%.*]] -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8 -; IS__CGSCC____-NEXT: store i32 -1, i32* [[G1]], align 32 -; IS__CGSCC____-NEXT: br label [[E]] -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] -; IS__CGSCC____-NEXT: ret i32* [[PHI]] +; NOT_CGSCC_OPM: Function Attrs: nofree nosync nounwind +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test10b +; NOT_CGSCC_OPM-SAME: (i32* nofree noundef 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 noundef 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 noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4]] { +; IS__CGSCC_OPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 +; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 +; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC_OPM: t: +; IS__CGSCC_OPM-NEXT: [[R:%.*]] = call align 32 i32* @test10b(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR4]] +; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[R]], align 32 +; IS__CGSCC_OPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; IS__CGSCC_OPM-NEXT: br label [[E:%.*]] +; IS__CGSCC_OPM: f: +; IS__CGSCC_OPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8 +; IS__CGSCC_OPM-NEXT: store i32 -1, i32* [[G1]], align 32 +; IS__CGSCC_OPM-NEXT: br label [[E]] +; IS__CGSCC_OPM: e: +; IS__CGSCC_OPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] +; IS__CGSCC_OPM-NEXT: ret i32* [[PHI]] ; %l = load i32, i32* %p %c = icmp eq i32 %l, 0 @@ -514,19 +564,19 @@ e: define i64 @test11(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test11 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__TUNIT____-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8 -; IS__TUNIT____-NEXT: ret i64 [[RET]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test11 -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC____-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8 -; IS__CGSCC____-NEXT: ret i64 [[RET]] +; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test11 +; NOT_CGSCC_OPM-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; NOT_CGSCC_OPM-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8 +; NOT_CGSCC_OPM-NEXT: ret i64 [[RET]] +; +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test11 +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR5:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8 +; IS__CGSCC_OPM-NEXT: ret i64 [[RET]] ; %p-cast = bitcast i32* %p to i64* %ret = load i64, i64* %p-cast, align 8 @@ -538,23 +588,23 @@ define i64 @test11(i32* %p) { ; FXIME: %p should have nonnull define i64 @test12-1(i32* align 4 %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-1 -; IS__TUNIT____-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 -; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 -; IS__TUNIT____-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16 -; IS__TUNIT____-NEXT: ret i64 [[RET]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test12-1 -; IS__CGSCC____-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 -; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 -; IS__CGSCC____-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16 -; IS__CGSCC____-NEXT: ret i64 [[RET]] +; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test12-1 +; NOT_CGSCC_OPM-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR4]] { +; 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: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16 +; NOT_CGSCC_OPM-NEXT: ret i64 [[RET]] +; +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-1 +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR5]] { +; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16 +; IS__CGSCC_OPM-NEXT: ret i64 [[RET]] ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 1 @@ -564,21 +614,21 @@ define i64 @test12-1(i32* align 4 %p) { } define i64 @test12-2(i32* align 4 %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-2 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; IS__TUNIT____-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16 -; IS__TUNIT____-NEXT: ret i64 [[RET]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test12-2 -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; IS__CGSCC____-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16 -; IS__CGSCC____-NEXT: ret i64 [[RET]] +; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test12-2 +; NOT_CGSCC_OPM-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR4]] { +; 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: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16 +; NOT_CGSCC_OPM-NEXT: ret i64 [[RET]] +; +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-2 +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] { +; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16 +; IS__CGSCC_OPM-NEXT: ret i64 [[RET]] ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 0 @@ -588,23 +638,23 @@ define i64 @test12-2(i32* align 4 %p) { ; FXIME: %p should have nonnull define void @test12-3(i32* align 4 %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-3 -; IS__TUNIT____-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 -; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 -; IS__TUNIT____-NEXT: store i64 0, i64* [[ARRAYIDX1]], align 16 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test12-3 -; IS__CGSCC____-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 -; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 -; IS__CGSCC____-NEXT: store i64 0, i64* [[ARRAYIDX1]], align 16 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test12-3 +; NOT_CGSCC_OPM-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR5:[0-9]+]] { +; 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: store i64 0, i64* [[ARRAYIDX1]], align 16 +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-3 +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR6:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; IS__CGSCC_OPM-NEXT: store i64 0, i64* [[ARRAYIDX1]], align 16 +; IS__CGSCC_OPM-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 1 @@ -614,21 +664,21 @@ define void @test12-3(i32* align 4 %p) { } define void @test12-4(i32* align 4 %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-4 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; IS__TUNIT____-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test12-4 -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] { -; IS__CGSCC____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; IS__CGSCC____-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test12-4 +; NOT_CGSCC_OPM-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] { +; 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: store i64 0, i64* [[ARRAYIDX0]], align 16 +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-4 +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR6]] { +; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; IS__CGSCC_OPM-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16 +; IS__CGSCC_OPM-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 0 @@ -639,23 +689,23 @@ define void @test12-4(i32* align 4 %p) { declare void @use(i64*) willreturn nounwind define void @test12-5(i32* align 4 %p) { -; IS__TUNIT____: Function Attrs: nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-5 -; IS__TUNIT____-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR5:[0-9]+]] { -; 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]]) #[[ATTR5]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test12-5 -; IS__CGSCC____-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 -; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 -; IS__CGSCC____-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX1]]) #[[ATTR6]] -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test12-5 +; NOT_CGSCC_OPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR6:[0-9]+]] { +; 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 +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-5 +; IS__CGSCC_OPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR7:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; IS__CGSCC_OPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX1]]) #[[ATTR7]] +; IS__CGSCC_OPM-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 1 @@ -665,21 +715,21 @@ define void @test12-5(i32* align 4 %p) { } define void @test12-6(i32* align 4 %p) { -; IS__TUNIT____: Function Attrs: nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-6 -; IS__TUNIT____-SAME: (i32* align 16 [[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: tail call void @use(i64* align 16 [[ARRAYIDX0]]) #[[ATTR5]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test12-6 -; IS__CGSCC____-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR6]] { -; IS__CGSCC____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; IS__CGSCC____-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) #[[ATTR6]] -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test12-6 +; NOT_CGSCC_OPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR6]] { +; 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 +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-6 +; IS__CGSCC_OPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR7]] { +; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; IS__CGSCC_OPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) #[[ATTR7]] +; IS__CGSCC_OPM-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 0 @@ -688,31 +738,31 @@ define void @test12-6(i32* align 4 %p) { } define void @test13(i1 %c, i32* align 32 %dst) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test13 -; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__TUNIT____: truebb: -; IS__TUNIT____-NEXT: br label [[END:%.*]] -; IS__TUNIT____: falsebb: -; IS__TUNIT____-NEXT: br label [[END]] -; IS__TUNIT____: end: -; IS__TUNIT____-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ null, [[FALSEBB]] ] -; IS__TUNIT____-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test13 -; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC____: truebb: -; IS__CGSCC____-NEXT: br label [[END:%.*]] -; IS__CGSCC____: falsebb: -; IS__CGSCC____-NEXT: br label [[END]] -; IS__CGSCC____: end: -; IS__CGSCC____-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ null, [[FALSEBB]] ] -; IS__CGSCC____-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test13 +; NOT_CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; NOT_CGSCC_OPM: truebb: +; NOT_CGSCC_OPM-NEXT: br label [[END:%.*]] +; NOT_CGSCC_OPM: falsebb: +; NOT_CGSCC_OPM-NEXT: br label [[END]] +; NOT_CGSCC_OPM: end: +; NOT_CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ null, [[FALSEBB]] ] +; NOT_CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 32 +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13 +; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; IS__CGSCC_OPM: truebb: +; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] +; IS__CGSCC_OPM: falsebb: +; IS__CGSCC_OPM-NEXT: br label [[END]] +; IS__CGSCC_OPM: end: +; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ null, [[FALSEBB]] ] +; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 32 +; IS__CGSCC_OPM-NEXT: ret void ; br i1 %c, label %truebb, label %falsebb truebb: @@ -726,31 +776,31 @@ end: } define void @test13-1(i1 %c, i32* align 32 %dst) { -; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test13-1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__TUNIT____: truebb: -; IS__TUNIT____-NEXT: br label [[END:%.*]] -; IS__TUNIT____: falsebb: -; IS__TUNIT____-NEXT: br label [[END]] -; IS__TUNIT____: end: -; IS__TUNIT____-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 48 to i32*), [[FALSEBB]] ] -; IS__TUNIT____-NEXT: store i32 0, i32* [[PTR]], align 16 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test13-1 -; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC____: truebb: -; IS__CGSCC____-NEXT: br label [[END:%.*]] -; IS__CGSCC____: falsebb: -; IS__CGSCC____-NEXT: br label [[END]] -; IS__CGSCC____: end: -; IS__CGSCC____-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 48 to i32*), [[FALSEBB]] ] -; IS__CGSCC____-NEXT: store i32 0, i32* [[PTR]], align 16 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test13-1 +; NOT_CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; NOT_CGSCC_OPM: truebb: +; NOT_CGSCC_OPM-NEXT: br label [[END:%.*]] +; NOT_CGSCC_OPM: falsebb: +; NOT_CGSCC_OPM-NEXT: br label [[END]] +; NOT_CGSCC_OPM: end: +; NOT_CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 48 to i32*), [[FALSEBB]] ] +; NOT_CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 16 +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13-1 +; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; IS__CGSCC_OPM: truebb: +; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] +; IS__CGSCC_OPM: falsebb: +; IS__CGSCC_OPM-NEXT: br label [[END]] +; IS__CGSCC_OPM: end: +; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 48 to i32*), [[FALSEBB]] ] +; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 16 +; IS__CGSCC_OPM-NEXT: ret void ; br i1 %c, label %truebb, label %falsebb truebb: @@ -764,31 +814,31 @@ end: } define void @test13-2(i1 %c, i32* align 32 %dst) { -; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test13-2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR7]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__TUNIT____: truebb: -; IS__TUNIT____-NEXT: br label [[END:%.*]] -; IS__TUNIT____: falsebb: -; IS__TUNIT____-NEXT: br label [[END]] -; IS__TUNIT____: end: -; IS__TUNIT____-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 160 to i32*), [[FALSEBB]] ] -; IS__TUNIT____-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test13-2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC____: truebb: -; IS__CGSCC____-NEXT: br label [[END:%.*]] -; IS__CGSCC____: falsebb: -; IS__CGSCC____-NEXT: br label [[END]] -; IS__CGSCC____: end: -; IS__CGSCC____-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 160 to i32*), [[FALSEBB]] ] -; IS__CGSCC____-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test13-2 +; NOT_CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { +; NOT_CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; NOT_CGSCC_OPM: truebb: +; NOT_CGSCC_OPM-NEXT: br label [[END:%.*]] +; NOT_CGSCC_OPM: falsebb: +; NOT_CGSCC_OPM-NEXT: br label [[END]] +; NOT_CGSCC_OPM: end: +; NOT_CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 160 to i32*), [[FALSEBB]] ] +; NOT_CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 32 +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13-2 +; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] { +; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; IS__CGSCC_OPM: truebb: +; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] +; IS__CGSCC_OPM: falsebb: +; IS__CGSCC_OPM-NEXT: br label [[END]] +; IS__CGSCC_OPM: end: +; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 160 to i32*), [[FALSEBB]] ] +; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 32 +; IS__CGSCC_OPM-NEXT: ret void ; br i1 %c, label %truebb, label %falsebb truebb: @@ -802,31 +852,31 @@ end: } define void @test13-3(i1 %c, i32* align 32 %dst) { -; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test13-3 -; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR7]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__TUNIT____: truebb: -; IS__TUNIT____-NEXT: br label [[END:%.*]] -; IS__TUNIT____: falsebb: -; IS__TUNIT____-NEXT: br label [[END]] -; IS__TUNIT____: end: -; IS__TUNIT____-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 128 to i32*), [[FALSEBB]] ] -; IS__TUNIT____-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test13-3 -; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC____: truebb: -; IS__CGSCC____-NEXT: br label [[END:%.*]] -; IS__CGSCC____: falsebb: -; IS__CGSCC____-NEXT: br label [[END]] -; IS__CGSCC____: end: -; IS__CGSCC____-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 128 to i32*), [[FALSEBB]] ] -; IS__CGSCC____-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test13-3 +; NOT_CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { +; NOT_CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; NOT_CGSCC_OPM: truebb: +; NOT_CGSCC_OPM-NEXT: br label [[END:%.*]] +; NOT_CGSCC_OPM: falsebb: +; NOT_CGSCC_OPM-NEXT: br label [[END]] +; NOT_CGSCC_OPM: end: +; NOT_CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 128 to i32*), [[FALSEBB]] ] +; NOT_CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 32 +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13-3 +; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] { +; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; IS__CGSCC_OPM: truebb: +; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] +; IS__CGSCC_OPM: falsebb: +; IS__CGSCC_OPM-NEXT: br label [[END]] +; IS__CGSCC_OPM: end: +; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 128 to i32*), [[FALSEBB]] ] +; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 32 +; IS__CGSCC_OPM-NEXT: ret void ; br i1 %c, label %truebb, label %falsebb truebb: @@ -841,33 +891,33 @@ end: ; Don't crash on ptr2int/int2ptr uses. define i64 @ptr2int(i32* %p) { -; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ptr2int -; IS__TUNIT____-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__TUNIT____-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64 -; IS__TUNIT____-NEXT: ret i64 [[P2I]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ptr2int -; IS__CGSCC____-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC____-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64 -; IS__CGSCC____-NEXT: ret i64 [[P2I]] +; NOT_CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@ptr2int +; NOT_CGSCC_OPM-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR9:[0-9]+]] { +; NOT_CGSCC_OPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64 +; NOT_CGSCC_OPM-NEXT: ret i64 [[P2I]] +; +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ptr2int +; IS__CGSCC_OPM-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64 +; IS__CGSCC_OPM-NEXT: ret i64 [[P2I]] ; %p2i = ptrtoint i32* %p to i64 ret i64 %p2i } define i64* @int2ptr(i64 %i) { -; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@int2ptr -; IS__TUNIT____-SAME: (i64 [[I:%.*]]) #[[ATTR8]] { -; IS__TUNIT____-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64* -; IS__TUNIT____-NEXT: ret i64* [[I2P]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@int2ptr -; IS__CGSCC____-SAME: (i64 [[I:%.*]]) #[[ATTR9]] { -; IS__CGSCC____-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64* -; IS__CGSCC____-NEXT: ret i64* [[I2P]] +; NOT_CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@int2ptr +; NOT_CGSCC_OPM-SAME: (i64 [[I:%.*]]) #[[ATTR9]] { +; NOT_CGSCC_OPM-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64* +; NOT_CGSCC_OPM-NEXT: ret i64* [[I2P]] +; +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@int2ptr +; IS__CGSCC_OPM-SAME: (i64 [[I:%.*]]) #[[ATTR10]] { +; IS__CGSCC_OPM-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64* +; IS__CGSCC_OPM-NEXT: ret i64* [[I2P]] ; %i2p = inttoptr i64 %i to i64* ret i64* %i2p @@ -875,17 +925,17 @@ define i64* @int2ptr(i64 %i) { ; Use the store alignment only for the pointer operand. define void @aligned_store(i8* %Value, i8** %Ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@aligned_store -; IS__TUNIT____-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@aligned_store -; IS__CGSCC____-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR5]] { -; IS__CGSCC____-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@aligned_store +; NOT_CGSCC_OPM-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR5]] { +; NOT_CGSCC_OPM-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32 +; NOT_CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@aligned_store +; IS__CGSCC_OPM-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR6]] { +; IS__CGSCC_OPM-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32 +; IS__CGSCC_OPM-NEXT: ret void ; store i8* %Value, i8** %Ptr, align 32 ret void @@ -905,19 +955,19 @@ define void @align_call_op_not_store(i8* align 2048 %arg) { } define void @align_store_after_bc(i32* align 2048 %arg) { ; -; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@align_store_after_bc -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8* -; IS__TUNIT____-NEXT: store i8 0, i8* [[BC]], align 2048 -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@align_store_after_bc +; NOT_CGSCC_OPM-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR5]] { +; NOT_CGSCC_OPM-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8* +; NOT_CGSCC_OPM-NEXT: store i8 0, i8* [[BC]], align 2048 +; NOT_CGSCC_OPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@align_store_after_bc -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR5]] { -; IS__CGSCC____-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8* -; IS__CGSCC____-NEXT: store i8 0, i8* [[BC]], align 2048 -; IS__CGSCC____-NEXT: ret void +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@align_store_after_bc +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR6]] { +; IS__CGSCC_OPM-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8* +; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[BC]], align 2048 +; IS__CGSCC_OPM-NEXT: ret void ; %bc = bitcast i32* %arg to i8* store i8 0, i8* %bc @@ -928,17 +978,17 @@ define void @align_store_after_bc(i32* align 2048 %arg) { ; we cannot also put on the caller. @cnd = external global i1 define i32 @musttail_callee_1(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@musttail_callee_1 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32 -; IS__TUNIT____-NEXT: ret i32 [[V]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@musttail_callee_1 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32 -; IS__CGSCC____-NEXT: ret i32 [[V]] +; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@musttail_callee_1 +; NOT_CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_OPM-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32 +; NOT_CGSCC_OPM-NEXT: ret i32 [[V]] +; +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@musttail_callee_1 +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR5]] { +; IS__CGSCC_OPM-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32 +; IS__CGSCC_OPM-NEXT: ret i32 [[V]] ; %v = load i32, i32* %p, align 32 ret i32 %v @@ -946,25 +996,36 @@ define i32 @musttail_callee_1(i32* %p) { define i32 @musttail_caller_1(i32* %p) { ; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@musttail_caller_1 -; IS__TUNIT____-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR9:[0-9]+]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR10:[0-9]+]] { ; IS__TUNIT____-NEXT: [[C:%.*]] = load i1, i1* @cnd, align 1 ; IS__TUNIT____-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]] ; IS__TUNIT____: mt: -; IS__TUNIT____-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree readonly [[P]]) #[[ATTR10:[0-9]+]] +; IS__TUNIT____-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree readonly [[P]]) #[[ATTR11:[0-9]+]] ; IS__TUNIT____-NEXT: ret i32 [[V]] ; IS__TUNIT____: exit: ; IS__TUNIT____-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@musttail_caller_1 -; IS__CGSCC____-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR10:[0-9]+]] { -; IS__CGSCC____-NEXT: [[C:%.*]] = load i1, i1* @cnd, align 1 -; IS__CGSCC____-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]] -; IS__CGSCC____: mt: -; IS__CGSCC____-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR11:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 [[V]] -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: ret i32 0 +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@musttail_caller_1 +; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR11:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: [[C:%.*]] = load i1, i1* @cnd, align 1 +; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]] +; IS__CGSCC_OPM: mt: +; IS__CGSCC_OPM-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR12:[0-9]+]] +; IS__CGSCC_OPM-NEXT: ret i32 [[V]] +; IS__CGSCC_OPM: exit: +; IS__CGSCC_OPM-NEXT: ret i32 0 +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@musttail_caller_1 +; IS__CGSCC_NPM-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: [[C:%.*]] = load i1, i1* @cnd, align 1 +; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]] +; IS__CGSCC_NPM: mt: +; IS__CGSCC_NPM-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR11:[0-9]+]] +; IS__CGSCC_NPM-NEXT: ret i32 [[V]] +; IS__CGSCC_NPM: exit: +; IS__CGSCC_NPM-NEXT: ret i32 0 ; %c = load i1, i1* @cnd br i1 %c, label %mt, label %exit @@ -976,37 +1037,37 @@ exit: } define i32* @checkAndAdvance(i32* align(16) %p) { -; IS__TUNIT____: Function Attrs: nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@checkAndAdvance -; IS__TUNIT____-SAME: (i32* noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 16 -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 4 -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call nonnull align 16 i32* @checkAndAdvance(i32* nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ] -; IS__TUNIT____-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: ret i32* [[RETVAL_0]] -; -; IS__CGSCC____: Function Attrs: nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@checkAndAdvance -; IS__CGSCC____-SAME: (i32* noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 16 -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 4 -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call nonnull align 16 i32* @checkAndAdvance(i32* nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ] -; IS__CGSCC____-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: ret i32* [[RETVAL_0]] +; NOT_CGSCC_OPM: Function Attrs: nounwind +; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@checkAndAdvance +; NOT_CGSCC_OPM-SAME: (i32* noundef 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* noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 16 +; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0 +; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] +; IS__CGSCC_OPM: if.then: +; IS__CGSCC_OPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 4 +; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call nonnull align 16 i32* @checkAndAdvance(i32* nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR3]] +; IS__CGSCC_OPM-NEXT: br label [[RETURN]] +; IS__CGSCC_OPM: return: +; IS__CGSCC_OPM-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ] +; IS__CGSCC_OPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) #[[ATTR3]] +; IS__CGSCC_OPM-NEXT: ret i32* [[RETVAL_0]] ; entry: %0 = load i32, i32* %p, align 4 @@ -1043,27 +1104,42 @@ attributes #1 = { uwtable noinline } attributes #2 = { null_pointer_is_valid } ;. ; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind } -; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR5]] = { nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR6]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR10]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__TUNIT____: attributes #[[ATTR2]] = { nounwind } +; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nosync nounwind } +; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR6]] = { nounwind willreturn } +; IS__TUNIT____: attributes #[[ATTR7]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes #[[ATTR11]] = { nofree nosync nounwind readonly willreturn } +;. +; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR2]] = { noinline nounwind uwtable } +; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nofree nosync nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nounwind willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR8]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR12]] = { readonly willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { noinline nounwind uwtable } -; IS__CGSCC____: attributes #[[ATTR2]] = { nounwind } -; IS__CGSCC____: attributes #[[ATTR3]] = { nofree nosync nounwind } -; IS__CGSCC____: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR6]] = { nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR7]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR11]] = { readonly willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR1]] = { noinline nounwind uwtable } +; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nounwind } +; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind } +; IS__CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_NPM: attributes #[[ATTR6]] = { nounwind willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR7]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; IS__CGSCC_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_NPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR11]] = { readonly willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/internal-noalias.ll b/llvm/test/Transforms/Attributor/internal-noalias.ll index 1d72284e5283c..10a1915db1c6c 100644 --- a/llvm/test/Transforms/Attributor/internal-noalias.ll +++ b/llvm/test/Transforms/Attributor/internal-noalias.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM +; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 diff --git a/llvm/test/Transforms/Attributor/liveness.ll b/llvm/test/Transforms/Attributor/liveness.ll index 75788cb83e208..6b35c3d38c851 100644 --- a/llvm/test/Transforms/Attributor/liveness.ll +++ b/llvm/test/Transforms/Attributor/liveness.ll @@ -591,15 +591,15 @@ cond.end: ; preds = %cond.if, %con } define void @rec() #0 { -; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@rec ; NOT_CGSCC_NPM-SAME: () #[[ATTR9:[0-9]+]] { ; NOT_CGSCC_NPM-NEXT: entry: ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@rec -; IS__CGSCC____-SAME: () #[[ATTR6]] { +; IS__CGSCC____-SAME: () #[[ATTR11:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: ret void ; @@ -1032,7 +1032,7 @@ define internal void @non_dead_a0() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a0 -; IS__CGSCC____-SAME: () #[[ATTR11:[0-9]+]] { +; IS__CGSCC____-SAME: () #[[ATTR12:[0-9]+]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1048,7 +1048,7 @@ define internal void @non_dead_a1() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a1 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1064,7 +1064,7 @@ define internal void @non_dead_a2() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a2 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1080,7 +1080,7 @@ define internal void @non_dead_a3() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a3 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1096,7 +1096,7 @@ define internal void @non_dead_a4() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a4 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1112,7 +1112,7 @@ define internal void @non_dead_a5() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a5 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1128,7 +1128,7 @@ define internal void @non_dead_a6() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a6 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1144,7 +1144,7 @@ define internal void @non_dead_a7() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a7 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1160,7 +1160,7 @@ define internal void @non_dead_a8() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a8 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1176,7 +1176,7 @@ define internal void @non_dead_a9() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a9 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1192,7 +1192,7 @@ define internal void @non_dead_a10() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a10 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1208,7 +1208,7 @@ define internal void @non_dead_a11() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a11 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1224,7 +1224,7 @@ define internal void @non_dead_a12() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a12 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1240,7 +1240,7 @@ define internal void @non_dead_a13() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a13 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1256,7 +1256,7 @@ define internal void @non_dead_a14() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a14 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1272,7 +1272,7 @@ define internal void @non_dead_a15() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a15 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1288,7 +1288,7 @@ define internal void @non_dead_b0() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b0 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1304,7 +1304,7 @@ define internal void @non_dead_b1() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b1 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1320,7 +1320,7 @@ define internal void @non_dead_b2() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b2 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1336,7 +1336,7 @@ define internal void @non_dead_b3() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b3 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1352,7 +1352,7 @@ define internal void @non_dead_b4() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b4 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1368,7 +1368,7 @@ define internal void @non_dead_b5() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b5 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1384,7 +1384,7 @@ define internal void @non_dead_b6() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b6 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1400,7 +1400,7 @@ define internal void @non_dead_b7() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b7 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1416,7 +1416,7 @@ define internal void @non_dead_b8() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b8 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1432,7 +1432,7 @@ define internal void @non_dead_b9() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b9 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1448,7 +1448,7 @@ define internal void @non_dead_b10() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b10 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1464,7 +1464,7 @@ define internal void @non_dead_b11() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b11 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1480,7 +1480,7 @@ define internal void @non_dead_b12() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b12 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1496,7 +1496,7 @@ define internal void @non_dead_b13() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b13 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1512,7 +1512,7 @@ define internal void @non_dead_b14() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b14 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1528,7 +1528,7 @@ define internal void @non_dead_b15() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b15 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1544,7 +1544,7 @@ define internal void @non_dead_c0() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c0 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1560,7 +1560,7 @@ define internal void @non_dead_c1() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c1 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1576,7 +1576,7 @@ define internal void @non_dead_c2() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c2 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1592,7 +1592,7 @@ define internal void @non_dead_c3() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c3 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1608,7 +1608,7 @@ define internal void @non_dead_c4() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c4 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1624,7 +1624,7 @@ define internal void @non_dead_c5() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c5 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1640,7 +1640,7 @@ define internal void @non_dead_c6() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c6 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1656,7 +1656,7 @@ define internal void @non_dead_c7() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c7 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1672,7 +1672,7 @@ define internal void @non_dead_c8() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c8 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1688,7 +1688,7 @@ define internal void @non_dead_c9() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c9 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1704,7 +1704,7 @@ define internal void @non_dead_c10() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c10 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1720,7 +1720,7 @@ define internal void @non_dead_c11() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c11 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1736,7 +1736,7 @@ define internal void @non_dead_c12() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c12 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1752,7 +1752,7 @@ define internal void @non_dead_c13() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c13 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1768,7 +1768,7 @@ define internal void @non_dead_c14() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c14 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1784,7 +1784,7 @@ define internal void @non_dead_c15() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c15 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1800,7 +1800,7 @@ define internal void @non_dead_d0() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d0 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1816,7 +1816,7 @@ define internal void @non_dead_d1() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d1 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1832,7 +1832,7 @@ define internal void @non_dead_d2() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d2 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1848,7 +1848,7 @@ define internal void @non_dead_d3() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d3 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1864,7 +1864,7 @@ define internal void @non_dead_d4() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d4 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1880,7 +1880,7 @@ define internal void @non_dead_d5() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d5 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1896,7 +1896,7 @@ define internal void @non_dead_d6() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d6 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1912,7 +1912,7 @@ define internal void @non_dead_d7() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d7 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1928,7 +1928,7 @@ define internal void @non_dead_d8() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d8 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1944,7 +1944,7 @@ define internal void @non_dead_d9() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d9 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1960,7 +1960,7 @@ define internal void @non_dead_d10() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d10 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1976,7 +1976,7 @@ define internal void @non_dead_d11() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d11 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -1992,7 +1992,7 @@ define internal void @non_dead_d12() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d12 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -2008,7 +2008,7 @@ define internal void @non_dead_d13() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d13 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -2024,7 +2024,7 @@ define internal void @non_dead_d14() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d14 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -2040,7 +2040,7 @@ define internal void @non_dead_d15() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d15 -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -2112,7 +2112,7 @@ define internal void @useless_arg_sink(i32* %a) { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@useless_arg_sink -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -2129,7 +2129,7 @@ define internal void @useless_arg_almost_sink(i32* %a) { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@useless_arg_almost_sink -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: call void @useless_arg_sink() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret void ; @@ -2187,7 +2187,7 @@ define internal i32 @switch_default(i64 %i) nounwind { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@switch_default -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ ; IS__CGSCC____-NEXT: i64 3, label [[RETURN:%.*]] @@ -2222,7 +2222,7 @@ define i32 @switch_default_caller() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@switch_default_caller -; IS__CGSCC____-SAME: () #[[ATTR11]] { +; IS__CGSCC____-SAME: () #[[ATTR12]] { ; IS__CGSCC____-NEXT: [[CALL2:%.*]] = tail call i32 @switch_default() #[[ATTR15]] ; IS__CGSCC____-NEXT: ret i32 123 ; @@ -2260,7 +2260,7 @@ return: define i32 @switch_default_dead_caller() { ; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@switch_default_dead_caller -; NOT_CGSCC_NPM-SAME: () #[[ATTR9]] { +; NOT_CGSCC_NPM-SAME: () #[[ATTR11:[0-9]+]] { ; NOT_CGSCC_NPM-NEXT: ret i32 123 ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn @@ -2408,7 +2408,7 @@ define internal void @dead_with_blockaddress_users(i32* nocapture %pc) nounwind ; ; IS__CGSCC____: Function Attrs: nounwind readonly ; IS__CGSCC____-LABEL: define {{[^@]+}}@dead_with_blockaddress_users -; IS__CGSCC____-SAME: (i32* nocapture [[PC:%.*]]) #[[ATTR12:[0-9]+]] { +; IS__CGSCC____-SAME: (i32* nocapture [[PC:%.*]]) #[[ATTR13:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: br label [[INDIRECTGOTO:%.*]] ; IS__CGSCC____: lab0: @@ -2544,7 +2544,7 @@ declare noalias i8* @malloc(i64) define i32 @h(i32 %i) { ; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@h -; NOT_CGSCC_NPM-SAME: (i32 [[I:%.*]]) #[[ATTR9]] { +; NOT_CGSCC_NPM-SAME: (i32 [[I:%.*]]) #[[ATTR11]] { ; NOT_CGSCC_NPM-NEXT: ret i32 0 ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn @@ -2563,7 +2563,7 @@ define i32 @h(i32 %i) { define void @bad_gep() { ; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bad_gep -; NOT_CGSCC_NPM-SAME: () #[[ATTR11:[0-9]+]] { +; NOT_CGSCC_NPM-SAME: () #[[ATTR9]] { ; NOT_CGSCC_NPM-NEXT: entry: ; NOT_CGSCC_NPM-NEXT: [[N:%.*]] = alloca i8, align 1 ; NOT_CGSCC_NPM-NEXT: [[M:%.*]] = alloca i8, align 1 @@ -2581,7 +2581,7 @@ define void @bad_gep() { ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@bad_gep -; IS__CGSCC____-SAME: () #[[ATTR13:[0-9]+]] { +; IS__CGSCC____-SAME: () #[[ATTR11]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: [[N:%.*]] = alloca i8, align 1 ; IS__CGSCC____-NEXT: [[M:%.*]] = alloca i8, align 1 @@ -2625,7 +2625,7 @@ exit: define i8 @edge_vs_block_liveness() { ; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@edge_vs_block_liveness -; NOT_CGSCC_NPM-SAME: () #[[ATTR9]] { +; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { ; NOT_CGSCC_NPM-NEXT: entry: ; NOT_CGSCC_NPM-NEXT: br i1 true, label [[B1:%.*]], label [[B2:%.*]] ; NOT_CGSCC_NPM: b1: @@ -2669,9 +2669,9 @@ declare void @llvm.lifetime.end.p0i8(i64 %0, i8* %1) ; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nounwind uwtable willreturn } ; NOT_CGSCC_NPM: attributes #[[ATTR7:[0-9]+]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } ; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { nofree norecurse noreturn nosync nounwind readnone } -; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { nofree nosync nounwind readnone willreturn } ; NOT_CGSCC_NPM: attributes #[[ATTR10]] = { nofree nosync nounwind willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR11]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind readnone willreturn } ; NOT_CGSCC_NPM: attributes #[[ATTR12:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } ; NOT_CGSCC_NPM: attributes #[[ATTR13]] = { nounwind willreturn } ; NOT_CGSCC_NPM: attributes #[[ATTR14]] = { willreturn } @@ -2687,9 +2687,9 @@ declare void @llvm.lifetime.end.p0i8(i64 %0, i8* %1) ; IS__CGSCC____: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone uwtable willreturn } ; IS__CGSCC____: attributes #[[ATTR9]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } ; IS__CGSCC____: attributes #[[ATTR10]] = { nofree norecurse noreturn nosync nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR11]] = { nofree nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR12]] = { nounwind readonly } -; IS__CGSCC____: attributes #[[ATTR13]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR11]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR12]] = { nofree nosync nounwind willreturn } +; IS__CGSCC____: attributes #[[ATTR13]] = { nounwind readonly } ; IS__CGSCC____: attributes #[[ATTR14:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } ; IS__CGSCC____: attributes #[[ATTR15]] = { nounwind willreturn } ; IS__CGSCC____: attributes #[[ATTR16]] = { willreturn } diff --git a/llvm/test/Transforms/Attributor/liveness_chains.ll b/llvm/test/Transforms/Attributor/liveness_chains.ll index 36511049969dd..c8219ea0c5b39 100644 --- a/llvm/test/Transforms/Attributor/liveness_chains.ll +++ b/llvm/test/Transforms/Attributor/liveness_chains.ll @@ -9,7 +9,7 @@ declare i32 @source() nounwind readonly define i32 @chain_dead(i32 %arg) { -; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn ; CHECK-LABEL: define {{[^@]+}}@chain_dead ; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: ret i32 0 @@ -60,5 +60,5 @@ define i32 @chain_alive(i32 %arg) { } ;. ; CHECK: attributes #[[ATTR0]] = { nounwind readonly } -; CHECK: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/memory_locations.ll b/llvm/test/Transforms/Attributor/memory_locations.ll index 68e7728a7d302..59c1597938faf 100644 --- a/llvm/test/Transforms/Attributor/memory_locations.ll +++ b/llvm/test/Transforms/Attributor/memory_locations.ll @@ -442,7 +442,7 @@ define void @callerD2() { } define void @callerE(i8* %arg) { -; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn ; CHECK-LABEL: define {{[^@]+}}@callerE ; CHECK-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { ; CHECK-NEXT: ret void @@ -484,33 +484,21 @@ define internal void @write_global_via_arg_internal(i32* %GPtr) { } define void @writeonly_global() { -; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@writeonly_global -; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: call void @write_global() #[[ATTR10:[0-9]+]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@writeonly_global -; IS__CGSCC____-SAME: () #[[ATTR6]] { -; IS__CGSCC____-NEXT: call void @write_global() #[[ATTR9:[0-9]+]] -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@writeonly_global +; CHECK-SAME: () #[[ATTR6]] { +; CHECK-NEXT: call void @write_global() #[[ATTR10:[0-9]+]] +; CHECK-NEXT: ret void ; call void @write_global() ret void } define void @writeonly_global_via_arg() { -; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@writeonly_global_via_arg -; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: call void @write_global_via_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR10]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@writeonly_global_via_arg -; IS__CGSCC____-SAME: () #[[ATTR6]] { -; IS__CGSCC____-NEXT: call void @write_global_via_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR9]] -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@writeonly_global_via_arg +; CHECK-SAME: () #[[ATTR6]] { +; CHECK-NEXT: call void @write_global_via_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR10]] +; CHECK-NEXT: ret void ; call void @write_global_via_arg(i32* @G) ret void @@ -518,46 +506,28 @@ define void @writeonly_global_via_arg() { define void @writeonly_global_via_arg_internal() { ; -; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@writeonly_global_via_arg_internal -; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: call void @write_global_via_arg_internal() #[[ATTR10]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@writeonly_global_via_arg_internal -; IS__CGSCC____-SAME: () #[[ATTR6]] { -; IS__CGSCC____-NEXT: call void @write_global_via_arg_internal() #[[ATTR9]] -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@writeonly_global_via_arg_internal +; CHECK-SAME: () #[[ATTR6]] { +; CHECK-NEXT: call void @write_global_via_arg_internal() #[[ATTR10]] +; CHECK-NEXT: ret void ; call void @write_global_via_arg_internal(i32* @G) ret void } define i8 @recursive_not_readnone(i8* %ptr, i1 %c) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_not_readnone -; IS__TUNIT____-SAME: (i8* nocapture nofree writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8:[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: ret i8 1 -; 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 writeonly -; 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) #[[ATTR10:[0-9]+]] -; IS__CGSCC____-NEXT: ret i8 1 -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: store i8 1, i8* [[PTR]], align 1 -; IS__CGSCC____-NEXT: ret i8 0 +; CHECK: Function Attrs: argmemonly nofree nosync nounwind writeonly +; CHECK-LABEL: define {{[^@]+}}@recursive_not_readnone +; CHECK-SAME: (i8* nocapture nofree writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8:[0-9]+]] { +; 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:[0-9]+]] +; CHECK-NEXT: ret i8 1 +; CHECK: f: +; CHECK-NEXT: store i8 1, i8* [[PTR]], align 1 +; CHECK-NEXT: ret i8 0 ; %alloc = alloca i8 br i1 %c, label %t, label %f @@ -577,18 +547,18 @@ define internal i8 @recursive_not_readnone_internal(i8* %ptr, i1 %c) { ; 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]], !range [[RNG0:![0-9]+]] +; 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: ret i8 1 ; IS__TUNIT____: f: ; IS__TUNIT____-NEXT: ret i8 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_not_readnone_internal ; IS__CGSCC____-SAME: (i8* noalias nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR5]] { ; IS__CGSCC____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 noundef false) #[[ATTR11:[0-9]+]], !range [[RNG0:![0-9]+]] +; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 noundef false) #[[ATTR12:[0-9]+]], !range [[RNG0:![0-9]+]] ; IS__CGSCC____-NEXT: ret i8 1 ; IS__CGSCC____: f: ; IS__CGSCC____-NEXT: ret i8 0 @@ -609,13 +579,13 @@ define i8 @readnone_caller(i1 %c) { ; IS__TUNIT____-LABEL: define {{[^@]+}}@readnone_caller ; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { ; IS__TUNIT____-NEXT: [[A:%.*]] = alloca i8, align 1 -; IS__TUNIT____-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 [[C]]) #[[ATTR11]], !range [[RNG0]] +; IS__TUNIT____-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 [[C]]) #[[ATTR11]], !range [[RNG0:![0-9]+]] ; IS__TUNIT____-NEXT: ret i8 [[R]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__CGSCC____-LABEL: define {{[^@]+}}@readnone_caller -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR5]] { -; IS__CGSCC____-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 [[C]]) #[[ATTR12:[0-9]+]], !range [[RNG0]] +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { +; IS__CGSCC____-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 [[C]]) #[[ATTR13:[0-9]+]], !range [[RNG0]] ; IS__CGSCC____-NEXT: ret i8 [[R]] ; %a = alloca i8 @@ -630,18 +600,18 @@ define internal i8 @recursive_readnone_internal2(i8* %ptr, i1 %c) { ; IS__TUNIT____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]], !range [[RNG0]] +; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]] ; IS__TUNIT____-NEXT: ret i8 1 ; IS__TUNIT____: f: ; IS__TUNIT____-NEXT: ret i8 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_readnone_internal2 ; IS__CGSCC____-SAME: (i8* noalias nocapture nofree nonnull readnone [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR5]] { ; IS__CGSCC____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 noundef false) #[[ATTR11]], !range [[RNG0]] +; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 noundef false) #[[ATTR12]], !range [[RNG0]] ; IS__CGSCC____-NEXT: ret i8 1 ; IS__CGSCC____: f: ; IS__CGSCC____-NEXT: ret i8 0 @@ -661,13 +631,13 @@ define i8 @readnone_caller2(i1 %c) { ; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@readnone_caller2 ; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { -; IS__TUNIT____-NEXT: [[R:%.*]] = call i8 @recursive_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR11]], !range [[RNG0]] +; IS__TUNIT____-NEXT: [[R:%.*]] = call noundef i8 @recursive_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR11]], !range [[RNG0]] ; IS__TUNIT____-NEXT: ret i8 [[R]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__CGSCC____-LABEL: define {{[^@]+}}@readnone_caller2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR5]] { -; IS__CGSCC____-NEXT: [[R:%.*]] = call noundef i8 @recursive_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR12]], !range [[RNG0]] +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { +; IS__CGSCC____-NEXT: [[R:%.*]] = call noundef i8 @recursive_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR13]], !range [[RNG0]] ; IS__CGSCC____-NEXT: ret i8 [[R]] ; %r = call i8 @recursive_readnone_internal2(i8* undef, i1 %c) @@ -681,18 +651,18 @@ define internal i8 @recursive_not_readnone_internal3(i8* %ptr, i1 %c) { ; IS__TUNIT____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]], !range [[RNG0]] +; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]] ; IS__TUNIT____-NEXT: ret i8 1 ; IS__TUNIT____: f: ; IS__TUNIT____-NEXT: ret i8 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_not_readnone_internal3 ; IS__CGSCC____-SAME: (i8* noalias nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR5]] { ; IS__CGSCC____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 noundef false) #[[ATTR11]], !range [[RNG0]] +; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 noundef false) #[[ATTR12]], !range [[RNG0]] ; IS__CGSCC____-NEXT: ret i8 1 ; IS__CGSCC____: f: ; IS__CGSCC____-NEXT: ret i8 0 @@ -713,13 +683,13 @@ define i8 @readnone_caller3(i1 %c) { ; IS__TUNIT____-LABEL: define {{[^@]+}}@readnone_caller3 ; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { ; IS__TUNIT____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 -; IS__TUNIT____-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 [[C]]) #[[ATTR11]], !range [[RNG0]] +; IS__TUNIT____-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 [[C]]) #[[ATTR11]], !range [[RNG0]] ; IS__TUNIT____-NEXT: ret i8 [[R]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone ; IS__CGSCC____-LABEL: define {{[^@]+}}@readnone_caller3 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR5]] { -; IS__CGSCC____-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 [[C]]) #[[ATTR12]], !range [[RNG0]] +; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { +; IS__CGSCC____-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree nonnull readnone dereferenceable(1) undef, i1 [[C]]) #[[ATTR13]], !range [[RNG0]] ; IS__CGSCC____-NEXT: ret i8 [[R]] ; %alloc = alloca i8 @@ -728,20 +698,21 @@ define i8 @readnone_caller3(i1 %c) { } define internal void @argmemonly_before_ipconstprop(i32* %p) argmemonly { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@argmemonly_before_ipconstprop -; IS__CGSCC____-SAME: () #[[ATTR6]] { -; IS__CGSCC____-NEXT: store i32 0, i32* @G, align 4 -; IS__CGSCC____-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CHECK-LABEL: define {{[^@]+}}@argmemonly_before_ipconstprop +; CHECK-SAME: () #[[ATTR6]] { +; CHECK-NEXT: store i32 0, i32* @G, align 4 +; CHECK-NEXT: ret void ; store i32 0, i32* %p ret void } define void @argmemonky_caller() { -; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly ; CHECK-LABEL: define {{[^@]+}}@argmemonky_caller -; CHECK-SAME: () #[[ATTR5]] { +; CHECK-SAME: () #[[ATTR6]] { +; CHECK-NEXT: call void @argmemonly_before_ipconstprop() #[[ATTR10]] ; CHECK-NEXT: ret void ; call void @argmemonly_before_ipconstprop(i32* @G) @@ -753,7 +724,7 @@ define void @argmemonky_caller() { ; IS__TUNIT____: attributes #[[ATTR2]] = { readnone } ; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly } ; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR5]] = { nofree nosync nounwind readnone willreturn } ; IS__TUNIT____: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind willreturn writeonly } ; IS__TUNIT____: attributes #[[ATTR7]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } ; IS__TUNIT____: attributes #[[ATTR8]] = { argmemonly nofree nosync nounwind writeonly } @@ -766,14 +737,15 @@ define void @argmemonky_caller() { ; IS__CGSCC____: attributes #[[ATTR2]] = { readnone } ; IS__CGSCC____: attributes #[[ATTR3]] = { argmemonly } ; IS__CGSCC____: attributes #[[ATTR4:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR5]] = { nofree nosync nounwind readnone willreturn } ; IS__CGSCC____: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind willreturn writeonly } ; IS__CGSCC____: attributes #[[ATTR7]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } ; IS__CGSCC____: attributes #[[ATTR8]] = { argmemonly nofree nosync nounwind writeonly } -; IS__CGSCC____: attributes #[[ATTR9]] = { nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR10]] = { nofree nosync nounwind writeonly } -; IS__CGSCC____: attributes #[[ATTR11]] = { nofree nosync nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR12]] = { norecurse nounwind readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind readnone } +; IS__CGSCC____: attributes #[[ATTR10]] = { nounwind willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR11]] = { nofree nosync nounwind writeonly } +; IS__CGSCC____: attributes #[[ATTR12]] = { nofree nosync nounwind readnone } +; IS__CGSCC____: attributes #[[ATTR13]] = { nounwind readnone willreturn } ;. ; CHECK: [[META0:![0-9]+]] = !{i8 0, i8 2} ;. diff --git a/llvm/test/Transforms/Attributor/noalias.ll b/llvm/test/Transforms/Attributor/noalias.ll index 1925a5e13388b..773e42d7e86c0 100644 --- a/llvm/test/Transforms/Attributor/noalias.ll +++ b/llvm/test/Transforms/Attributor/noalias.ll @@ -525,10 +525,10 @@ define i32 @i2p(i32* %arg) { ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@i2p ; IS__CGSCC____-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC____-NEXT: [[C:%.*]] = call i32 @p2i(i32* noalias nofree readnone [[ARG]]) #[[ATTR9:[0-9]+]] +; IS__CGSCC____-NEXT: [[C:%.*]] = call i32 @p2i(i32* noalias nofree readnone [[ARG]]) #[[ATTR10:[0-9]+]] ; IS__CGSCC____-NEXT: [[I2P:%.*]] = inttoptr i32 [[C]] to i8* ; IS__CGSCC____-NEXT: [[BC:%.*]] = bitcast i8* [[I2P]] to i32* -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32 @ret(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[BC]]) #[[ATTR10:[0-9]+]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32 @ret(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[BC]]) #[[ATTR11:[0-9]+]] ; IS__CGSCC____-NEXT: ret i32 [[CALL]] ; %c = call i32 @p2i(i32* %arg) @@ -558,17 +558,29 @@ define internal i32 @ret(i32* %arg) { ; Function Attrs: nounwind optsize define internal fastcc double @strtox(i8* %s, i8** %p, i32 %prec) unnamed_addr { -; CHECK-LABEL: define {{[^@]+}}@strtox -; CHECK-SAME: (i8* [[S:%.*]]) unnamed_addr { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8 -; CHECK-NEXT: [[TMP0:%.*]] = bitcast %struct._IO_FILE* [[F]] to i8* -; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) #[[ATTR11:[0-9]+]] -; CHECK-NEXT: [[CALL:%.*]] = call i32 bitcast (i32 (...)* @sh_fromstring to i32 (%struct._IO_FILE*, i8*)*)(%struct._IO_FILE* nonnull align 8 dereferenceable(240) [[F]], i8* [[S]]) -; CHECK-NEXT: call void @__shlim(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0) -; CHECK-NEXT: [[CALL1:%.*]] = call double @__floatscan(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1) -; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) -; CHECK-NEXT: ret double [[CALL1]] +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@strtox +; NOT_CGSCC_NPM-SAME: (i8* [[S:%.*]]) unnamed_addr { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8 +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = bitcast %struct._IO_FILE* [[F]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) #[[ATTR11:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32 bitcast (i32 (...)* @sh_fromstring to i32 (%struct._IO_FILE*, i8*)*)(%struct._IO_FILE* nonnull align 8 dereferenceable(240) [[F]], i8* [[S]]) +; NOT_CGSCC_NPM-NEXT: call void @__shlim(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0) +; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call double @__floatscan(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1) +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) +; NOT_CGSCC_NPM-NEXT: ret double [[CALL1]] +; +; IS__CGSCC____-LABEL: define {{[^@]+}}@strtox +; IS__CGSCC____-SAME: (i8* [[S:%.*]]) unnamed_addr { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8 +; IS__CGSCC____-NEXT: [[TMP0:%.*]] = bitcast %struct._IO_FILE* [[F]] to i8* +; IS__CGSCC____-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) #[[ATTR12:[0-9]+]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32 bitcast (i32 (...)* @sh_fromstring to i32 (%struct._IO_FILE*, i8*)*)(%struct._IO_FILE* nonnull align 8 dereferenceable(240) [[F]], i8* [[S]]) +; IS__CGSCC____-NEXT: call void @__shlim(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0) +; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call double @__floatscan(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1) +; IS__CGSCC____-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) +; IS__CGSCC____-NEXT: ret double [[CALL1]] ; entry: %f = alloca %struct._IO_FILE, align 8 @@ -656,10 +668,10 @@ define void @test15_caller(i32* noalias %p, i32 %c) { ; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 ; IS__CGSCC____-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] ; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: tail call void @only_store(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR12:[0-9]+]] +; IS__CGSCC____-NEXT: tail call void @only_store(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13:[0-9]+]] ; IS__CGSCC____-NEXT: br label [[IF_END]] ; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR12]] +; IS__CGSCC____-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR13]] ; IS__CGSCC____-NEXT: ret void ; %tobool = icmp eq i32 %c, 0 @@ -719,14 +731,14 @@ define internal void @test16_sub(i32* noalias %p, i32 %c1, i32 %c2) { ; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C1]], 0 ; IS__CGSCC____-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] ; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: tail call void @only_store(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR12]] -; IS__CGSCC____-NEXT: tail call void @make_alias(i32* nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR12]] +; IS__CGSCC____-NEXT: tail call void @only_store(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; IS__CGSCC____-NEXT: tail call void @make_alias(i32* nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] ; IS__CGSCC____-NEXT: br label [[IF_END]] ; IS__CGSCC____: if.end: ; IS__CGSCC____-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C2]], 0 ; IS__CGSCC____-NEXT: br i1 [[TOBOOL1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] ; IS__CGSCC____: if.then2: -; IS__CGSCC____-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR12]] +; IS__CGSCC____-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] ; IS__CGSCC____-NEXT: br label [[IF_END3]] ; IS__CGSCC____: if.end3: ; IS__CGSCC____-NEXT: ret void @@ -752,11 +764,17 @@ if.end3: } define void @test16_caller(i32* %p, i32 %c) { -; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; CHECK-LABEL: define {{[^@]+}}@test16_caller -; CHECK-SAME: (i32* nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { -; CHECK-NEXT: tail call void @test16_sub(i32* noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR12:[0-9]+]] -; CHECK-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test16_caller +; NOT_CGSCC_NPM-SAME: (i32* nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; NOT_CGSCC_NPM-NEXT: tail call void @test16_sub(i32* noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC____-LABEL: define {{[^@]+}}@test16_caller +; IS__CGSCC____-SAME: (i32* nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; IS__CGSCC____-NEXT: tail call void @test16_sub(i32* noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR13]] +; IS__CGSCC____-NEXT: ret void ; tail call void @test16_sub(i32* %p, i32 %c, i32 %c) ret void @@ -804,10 +822,10 @@ define void @test17_caller(i32* noalias %p, i32 %c) { ; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 ; IS__CGSCC____-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]] ; IS__CGSCC____: l1: -; IS__CGSCC____-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR12]] +; IS__CGSCC____-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR13]] ; IS__CGSCC____-NEXT: br label [[L3:%.*]] ; IS__CGSCC____: l2: -; IS__CGSCC____-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR12]] +; IS__CGSCC____-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] ; IS__CGSCC____-NEXT: br label [[L3]] ; IS__CGSCC____: l3: ; IS__CGSCC____-NEXT: ret void @@ -840,9 +858,9 @@ l3: ; } define void @noreturn() { -; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn ; CHECK-LABEL: define {{[^@]+}}@noreturn -; CHECK-SAME: () #[[ATTR0]] { +; CHECK-SAME: () #[[ATTR9:[0-9]+]] { ; CHECK-NEXT: ret void ; call void @noreturn() @@ -870,10 +888,10 @@ define void @test18_caller(i32* noalias %p, i32 %c) { ; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 ; IS__CGSCC____-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]] ; IS__CGSCC____: l1: -; IS__CGSCC____-NEXT: tail call void @make_alias(i32* nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR12]] +; IS__CGSCC____-NEXT: tail call void @make_alias(i32* nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] ; IS__CGSCC____-NEXT: br label [[L2]] ; IS__CGSCC____: l2: -; IS__CGSCC____-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR12]] +; IS__CGSCC____-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] ; IS__CGSCC____-NEXT: ret void ; entry: @@ -913,8 +931,9 @@ l2: ; IS__CGSCC____: attributes #[[ATTR6:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } ; IS__CGSCC____: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind willreturn writeonly } ; IS__CGSCC____: attributes #[[ATTR8]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR9]] = { nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR10]] = { nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR11]] = { willreturn } -; IS__CGSCC____: attributes #[[ATTR12]] = { nounwind willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR9]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR10]] = { readnone willreturn } +; IS__CGSCC____: attributes #[[ATTR11]] = { readonly willreturn } +; IS__CGSCC____: attributes #[[ATTR12]] = { willreturn } +; IS__CGSCC____: attributes #[[ATTR13]] = { nounwind willreturn writeonly } ;. diff --git a/llvm/test/Transforms/Attributor/nocapture-2.ll b/llvm/test/Transforms/Attributor/nocapture-2.ll index 619c4f4b35bfc..244f051c30400 100644 --- a/llvm/test/Transforms/Attributor/nocapture-2.ll +++ b/llvm/test/Transforms/Attributor/nocapture-2.ll @@ -101,9 +101,9 @@ return: ; preds = %if.end3, %if.then2, ; } ; define double* @srec0(double* %a) #0 { -; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; CHECK-LABEL: define {{[^@]+}}@srec0 -; CHECK-SAME: (double* nocapture nofree readnone [[A:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (double* nocapture nofree readnone [[A:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: ret double* null ; @@ -126,9 +126,9 @@ entry: ; Other arguments are possible here due to the no-return behavior. ; define i32* @srec16(i32* %a) #0 { -; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; CHECK-LABEL: define {{[^@]+}}@srec16 -; CHECK-SAME: (i32* nocapture nofree readnone [[A:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (i32* nocapture nofree readnone [[A:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: ret i32* undef ; @@ -168,17 +168,17 @@ entry: define float* @scc_A(i32* dereferenceable_or_null(4) %a) { ; CHECK: Function Attrs: nofree nosync nounwind readnone ; CHECK-LABEL: define {{[^@]+}}@scc_A -; CHECK-SAME: (i32* nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-SAME: (i32* nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i32* [[A]], null ; CHECK-NEXT: br i1 [[TOBOOL]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] ; CHECK: cond.true: ; CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[A]] to i16* -; CHECK-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR1]] +; CHECK-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR2]] ; CHECK-NEXT: [[TMP1:%.*]] = bitcast i8* [[CALL]] to double* -; CHECK-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP1]]) #[[ATTR1]] +; CHECK-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP1]]) #[[ATTR2]] ; CHECK-NEXT: [[TMP2:%.*]] = bitcast i64* [[CALL1]] to i32* -; CHECK-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR1]] +; CHECK-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR2]] ; CHECK-NEXT: [[TMP3:%.*]] = bitcast float* [[CALL2]] to i32* ; CHECK-NEXT: br label [[COND_END:%.*]] ; CHECK: cond.false: @@ -215,17 +215,17 @@ cond.end: ; preds = %cond.false, %cond.t define i64* @scc_B(double* dereferenceable_or_null(8) %a) { ; CHECK: Function Attrs: nofree nosync nounwind readnone ; CHECK-LABEL: define {{[^@]+}}@scc_B -; CHECK-SAME: (double* nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (double* nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne double* [[A]], null ; CHECK-NEXT: br i1 [[TOBOOL]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] ; CHECK: cond.true: ; CHECK-NEXT: [[TMP0:%.*]] = bitcast double* [[A]] to i32* -; CHECK-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR1]] +; CHECK-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR2]] ; CHECK-NEXT: [[TMP1:%.*]] = bitcast float* [[CALL]] to double* -; CHECK-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP1]]) #[[ATTR1]] +; CHECK-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP1]]) #[[ATTR2]] ; CHECK-NEXT: [[TMP2:%.*]] = bitcast i64* [[CALL1]] to i16* -; CHECK-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR1]] +; CHECK-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR2]] ; CHECK-NEXT: br label [[COND_END:%.*]] ; CHECK: cond.false: ; CHECK-NEXT: [[TMP3:%.*]] = bitcast double* [[A]] to i8* @@ -261,25 +261,25 @@ cond.end: ; preds = %cond.false, %cond.t define i8* @scc_C(i16* dereferenceable_or_null(2) %a) { ; CHECK: Function Attrs: nofree nosync nounwind readnone ; CHECK-LABEL: define {{[^@]+}}@scc_C -; CHECK-SAME: (i16* nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (i16* nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[BC:%.*]] = bitcast i16* [[A]] to i32* -; CHECK-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[BC]]) #[[ATTR1]] +; CHECK-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[BC]]) #[[ATTR2]] ; CHECK-NEXT: [[BC2:%.*]] = bitcast float* [[CALL]] to i8* ; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i8* [[BC2]], null ; CHECK-NEXT: br i1 [[TOBOOL]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] ; CHECK: cond.true: ; CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[A]] to double* -; CHECK-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR1]] +; CHECK-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR2]] ; CHECK-NEXT: [[TMP1:%.*]] = bitcast i64* [[CALL1]] to i8* ; CHECK-NEXT: br label [[COND_END:%.*]] ; CHECK: cond.false: -; CHECK-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[A]]) #[[ATTR1]] +; CHECK-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[A]]) #[[ATTR2]] ; CHECK-NEXT: br label [[COND_END]] ; CHECK: cond.end: ; CHECK-NEXT: [[COND:%.*]] = phi i8* [ [[TMP1]], [[COND_TRUE]] ], [ [[CALL2]], [[COND_FALSE]] ] ; CHECK-NEXT: [[TMP2:%.*]] = bitcast i8* [[COND]] to i32* -; CHECK-NEXT: [[CALL3:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR1]] +; CHECK-NEXT: [[CALL3:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR2]] ; CHECK-NEXT: [[TMP3:%.*]] = bitcast float* [[CALL3]] to i8* ; CHECK-NEXT: ret i8* [[TMP3]] ; @@ -321,7 +321,7 @@ declare void @external_no_capture(i32* nocapture) define void @test_external_no_capture(i32* %p) #0 { ; CHECK: Function Attrs: noinline nounwind uwtable ; CHECK-LABEL: define {{[^@]+}}@test_external_no_capture -; CHECK-SAME: (i32* nocapture [[P:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-SAME: (i32* nocapture [[P:%.*]]) #[[ATTR3:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @external_no_capture(i32* nocapture [[P]]) ; CHECK-NEXT: ret void @@ -340,7 +340,7 @@ entry: define void @test_var_arg_call(i8* %p, i32 %a) #0 { ; CHECK: Function Attrs: noinline nounwind uwtable ; CHECK-LABEL: define {{[^@]+}}@test_var_arg_call -; CHECK-SAME: (i8* nocapture [[P:%.*]], i32 [[A:%.*]]) #[[ATTR2]] { +; CHECK-SAME: (i8* nocapture [[P:%.*]], i32 [[A:%.*]]) #[[ATTR3]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CALL:%.*]] = call i32 (i8*, ...) @printf(i8* nocapture [[P]], i32 [[A]]) ; CHECK-NEXT: ret void @@ -364,7 +364,7 @@ declare i32 @printf(i8* nocapture, ...) define i64* @not_captured_but_returned_0(i64* %a) #0 { ; CHECK: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; CHECK-LABEL: define {{[^@]+}}@not_captured_but_returned_0 -; CHECK-SAME: (i64* nofree noundef nonnull returned writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3:[0-9]+]] { +; CHECK-SAME: (i64* nofree noundef nonnull returned writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: store i64 0, i64* [[A]], align 8 ; CHECK-NEXT: ret i64* [[A]] @@ -385,7 +385,7 @@ entry: define i64* @not_captured_but_returned_1(i64* %a) #0 { ; CHECK: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; CHECK-LABEL: define {{[^@]+}}@not_captured_but_returned_1 -; CHECK-SAME: (i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3]] { +; CHECK-SAME: (i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i64, i64* [[A]], i64 1 ; CHECK-NEXT: store i64 1, i64* [[ADD_PTR]], align 8 @@ -407,18 +407,18 @@ entry: define void @test_not_captured_but_returned_calls(i64* %a) #0 { ; IS__TUNIT____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_not_captured_but_returned_calls -; IS__TUNIT____-SAME: (i64* nocapture nofree writeonly align 8 [[A:%.*]]) #[[ATTR3]] { +; IS__TUNIT____-SAME: (i64* nocapture nofree writeonly align 8 [[A:%.*]]) #[[ATTR4]] { ; 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]]) #[[ATTR8:[0-9]+]] -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR8]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR9:[0-9]+]] +; 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: ret void ; ; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; IS__CGSCC____-LABEL: define {{[^@]+}}@test_not_captured_but_returned_calls -; IS__CGSCC____-SAME: (i64* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A:%.*]]) #[[ATTR3]] { +; IS__CGSCC____-SAME: (i64* nocapture nofree noundef 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 noundef nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) #[[ATTR8:[0-9]+]] -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i64* @not_captured_but_returned_1(i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) #[[ATTR8]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) #[[ATTR9:[0-9]+]] +; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i64* @not_captured_but_returned_1(i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) #[[ATTR9]] ; IS__CGSCC____-NEXT: ret void ; entry: @@ -437,16 +437,16 @@ entry: define i64* @negative_test_not_captured_but_returned_call_0a(i64* %a) #0 { ; IS__TUNIT____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0a -; IS__TUNIT____-SAME: (i64* nofree returned writeonly align 8 "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3]] { +; IS__TUNIT____-SAME: (i64* nofree returned writeonly align 8 "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { ; 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]]) #[[ATTR8]] +; 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: ret i64* [[A]] ; ; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; IS__CGSCC____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0a -; IS__CGSCC____-SAME: (i64* nofree noundef nonnull returned writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3]] { +; IS__CGSCC____-SAME: (i64* nofree noundef 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 noundef nonnull writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A]]) #[[ATTR8]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree noundef nonnull writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A]]) #[[ATTR9]] ; IS__CGSCC____-NEXT: ret i64* [[A]] ; entry: @@ -464,18 +464,18 @@ entry: define void @negative_test_not_captured_but_returned_call_0b(i64* %a) #0 { ; IS__TUNIT____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0b -; IS__TUNIT____-SAME: (i64* nofree writeonly align 8 [[A:%.*]]) #[[ATTR3]] { +; IS__TUNIT____-SAME: (i64* nofree writeonly align 8 [[A:%.*]]) #[[ATTR4]] { ; 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]]) #[[ATTR8]] +; 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: [[TMP0:%.*]] = ptrtoint i64* [[A]] to i64 ; IS__TUNIT____-NEXT: store i64 [[TMP0]], i64* [[A]], align 8 ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; IS__CGSCC____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0b -; IS__CGSCC____-SAME: (i64* nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR3]] { +; IS__CGSCC____-SAME: (i64* nofree noundef 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 noundef nonnull writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A]]) #[[ATTR8]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree noundef nonnull writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A]]) #[[ATTR9]] ; IS__CGSCC____-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[A]] to i64 ; IS__CGSCC____-NEXT: store i64 [[TMP0]], i64* [[A]], align 8 ; IS__CGSCC____-NEXT: ret void @@ -497,16 +497,16 @@ entry: define i64* @negative_test_not_captured_but_returned_call_1a(i64* %a) #0 { ; IS__TUNIT____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1a -; IS__TUNIT____-SAME: (i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3]] { +; IS__TUNIT____-SAME: (i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call noundef nonnull align 8 dereferenceable(8) i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR8]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call noundef 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: ret i64* [[CALL]] ; ; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; IS__CGSCC____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1a -; IS__CGSCC____-SAME: (i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3]] { +; IS__CGSCC____-SAME: (i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { ; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call noundef nonnull align 8 dereferenceable(8) i64* @not_captured_but_returned_1(i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) #[[ATTR8]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call noundef nonnull align 8 dereferenceable(8) i64* @not_captured_but_returned_1(i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) #[[ATTR9]] ; IS__CGSCC____-NEXT: ret i64* [[CALL]] ; entry: @@ -524,18 +524,18 @@ entry: define void @negative_test_not_captured_but_returned_call_1b(i64* %a) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1b -; IS__TUNIT____-SAME: (i64* nofree writeonly align 8 [[A:%.*]]) #[[ATTR4:[0-9]+]] { +; IS__TUNIT____-SAME: (i64* nofree writeonly align 8 [[A:%.*]]) #[[ATTR5:[0-9]+]] { ; 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]]) #[[ATTR8]] +; 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: [[TMP0:%.*]] = ptrtoint i64* [[CALL]] to i64 ; IS__TUNIT____-NEXT: store i64 [[TMP0]], i64* [[CALL]], align 8 ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind uwtable willreturn writeonly ; IS__CGSCC____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1b -; IS__CGSCC____-SAME: (i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A:%.*]]) #[[ATTR4:[0-9]+]] { +; IS__CGSCC____-SAME: (i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A:%.*]]) #[[ATTR5:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call align 8 i64* @not_captured_but_returned_1(i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) #[[ATTR8]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call align 8 i64* @not_captured_but_returned_1(i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) #[[ATTR9]] ; IS__CGSCC____-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[CALL]] to i64 ; IS__CGSCC____-NEXT: store i64 [[TMP0]], i64* [[CALL]], align 8 ; IS__CGSCC____-NEXT: ret void @@ -561,7 +561,7 @@ entry: define i32* @ret_arg_or_unknown(i32* %b) #0 { ; CHECK: Function Attrs: noinline nounwind uwtable ; CHECK-LABEL: define {{[^@]+}}@ret_arg_or_unknown -; CHECK-SAME: (i32* [[B:%.*]]) #[[ATTR2]] { +; CHECK-SAME: (i32* [[B:%.*]]) #[[ATTR3]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null ; CHECK-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] @@ -586,7 +586,7 @@ ret_unknown: define i32* @ret_arg_or_unknown_through_phi(i32* %b) #0 { ; CHECK: Function Attrs: noinline nounwind uwtable ; CHECK-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi -; CHECK-SAME: (i32* [[B:%.*]]) #[[ATTR2]] { +; CHECK-SAME: (i32* [[B:%.*]]) #[[ATTR3]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null ; CHECK-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] @@ -623,9 +623,9 @@ 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:%.*]]) #[[ATTR6:[0-9]+]] { +; CHECK-SAME: (i32* nocapture readonly [[B:%.*]]) #[[ATTR7:[0-9]+]] { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown(i32* readonly [[B]], i32* readonly [[B]]) #[[ATTR5:[0-9]+]] +; CHECK-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown(i32* readonly [[B]], i32* readonly [[B]]) #[[ATTR6:[0-9]+]] ; CHECK-NEXT: ret void ; entry: @@ -641,9 +641,9 @@ entry: 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:%.*]]) #[[ATTR7:[0-9]+]] { +; CHECK-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) #[[ATTR8:[0-9]+]] { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown(i32* readonly [[B]], i32* readonly [[R]]) #[[ATTR7]] +; CHECK-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown(i32* readonly [[B]], i32* readonly [[R]]) #[[ATTR8]] ; CHECK-NEXT: ret i32* [[R]] ; entry: @@ -655,9 +655,9 @@ 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:%.*]]) #[[ATTR7]] { +; 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]]) #[[ATTR7]] +; CHECK-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1a(i32* readonly [[B]], i32* readonly [[R]]) #[[ATTR8]] ; CHECK-NEXT: ret i32* [[R]] ; entry: @@ -669,9 +669,9 @@ 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:%.*]]) #[[ATTR7]] { +; 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]]) #[[ATTR7]] +; CHECK-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1b(i32* nocapture readonly [[B]], i32* readonly [[R]]) #[[ATTR8]] ; CHECK-NEXT: ret i32* [[R]] ; entry: @@ -682,9 +682,9 @@ entry: 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:%.*]]) #[[ATTR7]] { +; 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]]) #[[ATTR5]] +; CHECK-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1a(i32* readonly [[B]], i32* readonly [[R]]) #[[ATTR6]] ; CHECK-NEXT: ret i32* [[R]] ; entry: @@ -713,7 +713,7 @@ 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]]) #[[ATTR5]] +; CHECK-NEXT: [[CALL:%.*]] = call i32* @readonly_i32p(i32* readonly [[B]]) #[[ATTR6]] ; CHECK-NEXT: store i32 0, i32* [[CALL]], align 4 ; CHECK-NEXT: ret void ; @@ -726,22 +726,24 @@ entry: attributes #0 = { noinline nounwind uwtable } ;. ; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR2]] = { noinline nounwind uwtable } -; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR4]] = { nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR5]] = { readonly } -; IS__TUNIT____: attributes #[[ATTR6]] = { noinline nounwind readonly uwtable } -; IS__TUNIT____: attributes #[[ATTR7]] = { nounwind readonly } -; IS__TUNIT____: attributes #[[ATTR8]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } +; IS__TUNIT____: attributes #[[ATTR3]] = { noinline nounwind uwtable } +; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR5]] = { nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; IS__TUNIT____: attributes #[[ATTR6]] = { readonly } +; IS__TUNIT____: attributes #[[ATTR7]] = { noinline nounwind readonly uwtable } +; IS__TUNIT____: attributes #[[ATTR8]] = { nounwind readonly } +; IS__TUNIT____: attributes #[[ATTR9]] = { nofree nosync nounwind willreturn writeonly } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR2]] = { noinline nounwind uwtable } -; IS__CGSCC____: attributes #[[ATTR3]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR4]] = { nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR5]] = { readonly } -; IS__CGSCC____: attributes #[[ATTR6]] = { noinline nounwind readonly uwtable } -; IS__CGSCC____: attributes #[[ATTR7]] = { nounwind readonly } -; IS__CGSCC____: attributes #[[ATTR8]] = { nounwind willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__CGSCC____: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } +; IS__CGSCC____: attributes #[[ATTR3]] = { noinline nounwind uwtable } +; IS__CGSCC____: attributes #[[ATTR4]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR5]] = { nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; IS__CGSCC____: attributes #[[ATTR6]] = { readonly } +; IS__CGSCC____: attributes #[[ATTR7]] = { noinline nounwind readonly uwtable } +; IS__CGSCC____: attributes #[[ATTR8]] = { nounwind readonly } +; IS__CGSCC____: attributes #[[ATTR9]] = { nounwind willreturn writeonly } ;. diff --git a/llvm/test/Transforms/Attributor/nodelete.ll b/llvm/test/Transforms/Attributor/nodelete.ll index 4b957ed2ee23d..1342fd39fd67a 100644 --- a/llvm/test/Transforms/Attributor/nodelete.ll +++ b/llvm/test/Transforms/Attributor/nodelete.ll @@ -32,8 +32,6 @@ define internal i64 @f2(%"a"* %this) align 2 { ; IS__CGSCC____-LABEL: define {{[^@]+}}@f2 ; IS__CGSCC____-SAME: () #[[ATTR0]] align 2 { ; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[THIS_ADDR:%.*]] = alloca %a*, align 8 -; IS__CGSCC____-NEXT: [[THIS1:%.*]] = load %a*, %a** [[THIS_ADDR]], align 8 ; IS__CGSCC____-NEXT: ret i64 undef ; entry: diff --git a/llvm/test/Transforms/Attributor/nofree.ll b/llvm/test/Transforms/Attributor/nofree.ll index 952721b631fa5..f1c6089caa78f 100644 --- a/llvm/test/Transforms/Attributor/nofree.ll +++ b/llvm/test/Transforms/Attributor/nofree.ll @@ -106,20 +106,30 @@ end: define void @mutual_recursion1() #0 { -; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; CHECK-LABEL: define {{[^@]+}}@mutual_recursion1 -; CHECK-SAME: () #[[ATTR3]] { -; CHECK-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR4:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion1 +; IS__CGSCC_NPM-SAME: () #[[ATTR3]] { +; IS__CGSCC_NPM-NEXT: ret void ; call void @mutual_recursion2() ret void } define void @mutual_recursion2() #0 { -; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; CHECK-LABEL: define {{[^@]+}}@mutual_recursion2 -; CHECK-SAME: () #[[ATTR3]] { -; CHECK-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion2 +; IS__CGSCC_NPM-SAME: () #[[ATTR3]] { +; IS__CGSCC_NPM-NEXT: ret void ; call void @mutual_recursion1() ret void @@ -179,10 +189,15 @@ define noalias i8* @call_realloc(i8* nocapture %0, i64 %1) local_unnamed_addr #0 declare void @nofree_function() nofree readnone #0 define void @call_nofree_function() #0 { -; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; CHECK-LABEL: define {{[^@]+}}@call_nofree_function -; CHECK-SAME: () #[[ATTR3]] { -; CHECK-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@call_nofree_function +; NOT_CGSCC_NPM-SAME: () #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@call_nofree_function +; IS__CGSCC_NPM-SAME: () #[[ATTR5:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: ret void ; tail call void @nofree_function() ret void @@ -232,21 +247,32 @@ define void @call_both() #0 { declare float @llvm.floor.f32(float) define void @call_floor(float %a) #0 { -; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; CHECK-LABEL: define {{[^@]+}}@call_floor -; CHECK-SAME: (float [[A:%.*]]) #[[ATTR3]] { -; CHECK-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@call_floor +; NOT_CGSCC_NPM-SAME: (float [[A:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@call_floor +; IS__CGSCC_NPM-SAME: (float [[A:%.*]]) #[[ATTR5]] { +; IS__CGSCC_NPM-NEXT: ret void ; tail call float @llvm.floor.f32(float %a) ret void } define float @call_floor2(float %a) #0 { -; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; CHECK-LABEL: define {{[^@]+}}@call_floor2 -; CHECK-SAME: (float [[A:%.*]]) #[[ATTR6:[0-9]+]] { -; CHECK-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR11:[0-9]+]] -; CHECK-NEXT: ret float [[C]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@call_floor2 +; NOT_CGSCC_NPM-SAME: (float [[A:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR11:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret float [[C]] +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@call_floor2 +; IS__CGSCC_NPM-SAME: (float [[A:%.*]]) #[[ATTR5]] { +; IS__CGSCC_NPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR11:[0-9]+]] +; IS__CGSCC_NPM-NEXT: ret float [[C]] ; %c = tail call float @llvm.floor.f32(float %a) ret float %c @@ -256,20 +282,30 @@ define float @call_floor2(float %a) #0 { ; Check propagation. define void @f1() #0 { -; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; CHECK-LABEL: define {{[^@]+}}@f1 -; CHECK-SAME: () #[[ATTR3]] { -; CHECK-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f1 +; IS__CGSCC_NPM-SAME: () #[[ATTR5]] { +; IS__CGSCC_NPM-NEXT: ret void ; tail call void @nofree_function() ret void } define void @f2() #0 { -; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; CHECK-LABEL: define {{[^@]+}}@f2 -; CHECK-SAME: () #[[ATTR3]] { -; CHECK-NEXT: ret void +; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@f2 +; IS__TUNIT____-SAME: () #[[ATTR4]] { +; IS__TUNIT____-NEXT: ret void +; +; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@f2 +; IS__CGSCC____-SAME: () #[[ATTR3]] { +; IS__CGSCC____-NEXT: ret void ; tail call void @f1() ret void @@ -414,17 +450,31 @@ attributes #0 = { nounwind uwtable noinline } attributes #1 = { nounwind } attributes #2 = { nobuiltin nounwind } ;. -; CHECK: attributes #[[ATTR0]] = { nounwind } -; CHECK: attributes #[[ATTR1]] = { noinline nounwind uwtable } -; CHECK: attributes #[[ATTR2]] = { nobuiltin nounwind } -; CHECK: attributes #[[ATTR3]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; CHECK: attributes #[[ATTR4:[0-9]+]] = { nofree noinline nounwind readnone uwtable } -; CHECK: attributes #[[ATTR5:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; CHECK: attributes #[[ATTR6]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; CHECK: attributes #[[ATTR7]] = { nofree nounwind } -; CHECK: attributes #[[ATTR8:[0-9]+]] = { nobuiltin nofree nounwind } -; CHECK: attributes #[[ATTR9:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; CHECK: attributes #[[ATTR10:[0-9]+]] = { nounwind willreturn } -; CHECK: attributes #[[ATTR11]] = { readnone willreturn } -; CHECK: attributes #[[ATTR12]] = { willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { noinline nounwind uwtable } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nobuiltin nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR5:[0-9]+]] = { nofree noinline nounwind readnone uwtable } +; NOT_CGSCC_NPM: attributes #[[ATTR6:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { nofree nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR8:[0-9]+]] = { nobuiltin nofree nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR9:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR10:[0-9]+]] = { nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR11]] = { readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR12]] = { willreturn } +;. +; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nounwind } +; IS__CGSCC_NPM: attributes #[[ATTR1]] = { noinline nounwind uwtable } +; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nobuiltin nounwind } +; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR4:[0-9]+]] = { nofree noinline nounwind readnone uwtable } +; IS__CGSCC_NPM: attributes #[[ATTR5]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR6:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree nounwind } +; IS__CGSCC_NPM: attributes #[[ATTR8:[0-9]+]] = { nobuiltin nofree nounwind } +; IS__CGSCC_NPM: attributes #[[ATTR9:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR10:[0-9]+]] = { nounwind willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR11]] = { readnone willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR12]] = { willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/nonnull.ll b/llvm/test/Transforms/Attributor/nonnull.ll index f4dcff85e78ab..7d4f6ecc08b4f 100644 --- a/llvm/test/Transforms/Attributor/nonnull.ll +++ b/llvm/test/Transforms/Attributor/nonnull.ll @@ -31,16 +31,27 @@ define i8* @test2(i8* nonnull %p) { } define i8* @test2A(i1 %c, i8* %ret) { -; CHECK: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn -; CHECK-LABEL: define {{[^@]+}}@test2A -; CHECK-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0:[0-9]+]] { -; CHECK-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] -; CHECK: A: -; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11:[0-9]+]] [ "nonnull"(i8* [[RET]]) ] -; CHECK-NEXT: ret i8* [[RET]] -; CHECK: B: -; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "nonnull"(i8* [[RET]]) ] -; CHECK-NEXT: ret i8* [[RET]] +; NOT_CGSCC_NPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2A +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0:[0-9]+]] { +; 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) #[[ATTR12:[0-9]+]] [ "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) #[[ATTR12]] [ "nonnull"(i8* [[RET]]) ] +; NOT_CGSCC_NPM-NEXT: ret i8* [[RET]] +; +; IS__CGSCC_NPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test2A +; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] +; IS__CGSCC_NPM: A: +; IS__CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11:[0-9]+]] [ "nonnull"(i8* [[RET]]) ] +; IS__CGSCC_NPM-NEXT: ret i8* [[RET]] +; IS__CGSCC_NPM: B: +; IS__CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "nonnull"(i8* [[RET]]) ] +; IS__CGSCC_NPM-NEXT: ret i8* [[RET]] ; br i1 %c, label %A, label %B A: @@ -52,16 +63,27 @@ B: } define i8* @test2B(i1 %c, i8* %ret) { -; CHECK: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn -; CHECK-LABEL: define {{[^@]+}}@test2B -; CHECK-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0]] { -; CHECK-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] -; CHECK: A: -; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "dereferenceable"(i8* [[RET]], i32 4) ] -; CHECK-NEXT: ret i8* [[RET]] -; CHECK: B: -; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "dereferenceable"(i8* [[RET]], i32 4) ] -; CHECK-NEXT: ret i8* [[RET]] +; NOT_CGSCC_NPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2B +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0]] { +; 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) #[[ATTR12]] [ "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) #[[ATTR12]] [ "dereferenceable"(i8* [[RET]], i32 4) ] +; NOT_CGSCC_NPM-NEXT: ret i8* [[RET]] +; +; IS__CGSCC_NPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test2B +; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0]] { +; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] +; IS__CGSCC_NPM: A: +; IS__CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "dereferenceable"(i8* [[RET]], i32 4) ] +; IS__CGSCC_NPM-NEXT: ret i8* [[RET]] +; IS__CGSCC_NPM: B: +; IS__CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "dereferenceable"(i8* [[RET]], i32 4) ] +; IS__CGSCC_NPM-NEXT: ret i8* [[RET]] ; br i1 %c, label %A, label %B A: @@ -117,20 +139,30 @@ define i8* @test3(i1 %c) { ; nonnull if neither can ever return null. (In this case, they ; just never return period.) define i8* @test4_helper() { -; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; CHECK-LABEL: define {{[^@]+}}@test4_helper -; CHECK-SAME: () #[[ATTR1]] { -; CHECK-NEXT: ret i8* undef +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test4_helper +; NOT_CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i8* undef +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test4_helper +; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { +; IS__CGSCC_NPM-NEXT: ret i8* undef ; %ret = call i8* @test4() ret i8* %ret } define i8* @test4() { -; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; CHECK-LABEL: define {{[^@]+}}@test4 -; CHECK-SAME: () #[[ATTR1]] { -; CHECK-NEXT: ret i8* undef +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test4 +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret i8* undef +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test4 +; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { +; IS__CGSCC_NPM-NEXT: ret i8* undef ; %ret = call i8* @test4_helper() ret i8* %ret @@ -139,14 +171,23 @@ define i8* @test4() { ; 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) { -; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; CHECK-LABEL: define {{[^@]+}}@test5_helper -; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; CHECK-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; CHECK: rec: -; CHECK-NEXT: br label [[END]] -; CHECK: end: -; CHECK-NEXT: ret i8* null +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test5_helper +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { +; 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__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test5_helper +; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] +; IS__CGSCC_NPM: rec: +; IS__CGSCC_NPM-NEXT: br label [[END]] +; IS__CGSCC_NPM: end: +; IS__CGSCC_NPM-NEXT: ret i8* null ; br i1 %c, label %rec, label %end rec: @@ -157,10 +198,15 @@ end: } define i8* @test5(i1 %c) { -; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; CHECK-LABEL: define {{[^@]+}}@test5 -; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; CHECK-NEXT: ret i8* null +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test5 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret i8* null +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test5 +; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; IS__CGSCC_NPM-NEXT: ret i8* null ; %ret = call i8* @test5_helper(i1 %c) ret i8* %ret @@ -169,16 +215,27 @@ define i8* @test5(i1 %c) { ; Local analysis, but going through a self recursive phi define i8* @test6a() { ; -; CHECK: Function Attrs: noreturn -; CHECK-LABEL: define {{[^@]+}}@test6a -; CHECK-SAME: () #[[ATTR2:[0-9]+]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[RET:%.*]] = call i8* @ret_nonnull() -; CHECK-NEXT: br label [[LOOP:%.*]] -; CHECK: loop: -; CHECK-NEXT: unreachable -; CHECK: exit: -; CHECK-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: noreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test6a +; NOT_CGSCC_NPM-SAME: () #[[ATTR3:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = call i8* @ret_nonnull() +; NOT_CGSCC_NPM-NEXT: br label [[LOOP:%.*]] +; NOT_CGSCC_NPM: loop: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: exit: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; IS__CGSCC_NPM: Function Attrs: noreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test6a +; IS__CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = call i8* @ret_nonnull() +; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]] +; IS__CGSCC_NPM: loop: +; IS__CGSCC_NPM-NEXT: unreachable +; IS__CGSCC_NPM: exit: +; IS__CGSCC_NPM-NEXT: unreachable ; entry: %ret = call i8* @ret_nonnull() @@ -247,12 +304,19 @@ define i8* @test9(i8* %a, i64 %n) { ; ATTRIBUTOR_OPM: define i8* @test10 ; ATTRIBUTOR_NPM: define nonnull i8* @test10 define i8* @test10(i8* %a, i64 %n) { -; CHECK: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn -; CHECK-LABEL: define {{[^@]+}}@test10 -; CHECK-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0]] { -; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] -; CHECK-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] -; CHECK-NEXT: ret i8* [[B]] +; NOT_CGSCC_NPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test10 +; NOT_CGSCC_NPM-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] +; NOT_CGSCC_NPM-NEXT: ret i8* [[B]] +; +; IS__CGSCC_NPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test10 +; IS__CGSCC_NPM-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0]] { +; IS__CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] +; IS__CGSCC_NPM-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] +; IS__CGSCC_NPM-NEXT: ret i8* [[B]] ; %cmp = icmp ne i64 %n, 0 call void @llvm.assume(i1 %cmp) @@ -306,12 +370,19 @@ define void @test12(i8* nonnull %a) { ; Simple Argument Tests declare i8* @unknown() define void @test13_helper() { -; CHECK-LABEL: define {{[^@]+}}@test13_helper() { -; CHECK-NEXT: [[NONNULLPTR:%.*]] = tail call nonnull i8* @ret_nonnull() -; CHECK-NEXT: [[MAYBENULLPTR:%.*]] = tail call i8* @unknown() -; CHECK-NEXT: tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]]) #[[ATTR3:[0-9]+]] -; CHECK-NEXT: tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]]) #[[ATTR3]] -; CHECK-NEXT: ret void +; 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]]) #[[ATTR4:[0-9]+]] +; 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]]) #[[ATTR4]] +; 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]]) #[[ATTR3:[0-9]+]] +; 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]]) #[[ATTR3]] +; IS__CGSCC_NPM-NEXT: ret void ; %nonnullptr = tail call i8* @ret_nonnull() %maybenullptr = tail call i8* @unknown() @@ -321,13 +392,21 @@ define void @test13_helper() { } define internal void @test13(i8* %a, i8* %b, i8* %c) { ; -; CHECK: Function Attrs: nounwind -; CHECK-LABEL: define {{[^@]+}}@test13 -; CHECK-SAME: (i8* noalias nocapture nofree nonnull readnone [[A:%.*]], i8* noalias nocapture nofree readnone [[B:%.*]], i8* noalias nocapture nofree readnone [[C:%.*]]) #[[ATTR3]] { -; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR3]] -; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[B]]) #[[ATTR3]] -; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[C]]) #[[ATTR3]] -; CHECK-NEXT: ret void +; 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:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[B]]) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[C]]) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; 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:%.*]]) #[[ATTR3]] { +; IS__CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR3]] +; IS__CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[B]]) #[[ATTR3]] +; IS__CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[C]]) #[[ATTR3]] +; IS__CGSCC_NPM-NEXT: ret void ; call void @use_i8_ptr(i8* %a) call void @use_i8_ptr(i8* %b) @@ -351,27 +430,49 @@ declare nonnull i8* @nonnull() define internal i32* @f1(i32* %arg) { ; FIXME: missing nonnull It should be nonnull @f1(i32* nonnull readonly %arg) -; CHECK: Function Attrs: argmemonly nofree nosync nounwind readonly -; CHECK-LABEL: define {{[^@]+}}@f1 -; CHECK-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; CHECK-NEXT: bb: -; CHECK-NEXT: [[TMP:%.*]] = icmp eq i32* [[ARG]], null -; CHECK-NEXT: br i1 [[TMP]], label [[BB9:%.*]], label [[BB1:%.*]] -; CHECK: bb1: -; CHECK-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARG]], align 4 -; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP2]], 0 -; CHECK-NEXT: br i1 [[TMP3]], label [[BB6:%.*]], label [[BB4:%.*]] -; CHECK: bb4: -; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 1 -; CHECK-NEXT: [[TMP5B:%.*]] = tail call i32* @f3(i32* nofree nonnull readonly [[TMP5]]) #[[ATTR12:[0-9]+]] -; CHECK-NEXT: [[TMP5C:%.*]] = getelementptr inbounds i32, i32* [[TMP5B]], i64 -1 -; CHECK-NEXT: br label [[BB9]] -; CHECK: bb6: -; CHECK-NEXT: [[TMP7:%.*]] = tail call i32* @f2(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR12]] -; CHECK-NEXT: ret i32* [[TMP7]] -; CHECK: bb9: -; CHECK-NEXT: [[TMP10:%.*]] = phi i32* [ [[TMP5C]], [[BB4]] ], [ inttoptr (i64 4 to i32*), [[BB:%.*]] ] -; CHECK-NEXT: ret i32* [[TMP10]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f1 +; NOT_CGSCC_NPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { +; 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]]) #[[ATTR13:[0-9]+]] +; 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 i32* @f2(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR13]] +; 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__CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f1 +; IS__CGSCC_NPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: bb: +; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = icmp eq i32* [[ARG]], null +; IS__CGSCC_NPM-NEXT: br i1 [[TMP]], label [[BB9:%.*]], label [[BB1:%.*]] +; IS__CGSCC_NPM: bb1: +; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARG]], align 4 +; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP2]], 0 +; IS__CGSCC_NPM-NEXT: br i1 [[TMP3]], label [[BB6:%.*]], label [[BB4:%.*]] +; IS__CGSCC_NPM: bb4: +; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 1 +; IS__CGSCC_NPM-NEXT: [[TMP5B:%.*]] = tail call i32* @f3(i32* nofree nonnull readonly [[TMP5]]) #[[ATTR12:[0-9]+]] +; IS__CGSCC_NPM-NEXT: [[TMP5C:%.*]] = getelementptr inbounds i32, i32* [[TMP5B]], i64 -1 +; IS__CGSCC_NPM-NEXT: br label [[BB9]] +; IS__CGSCC_NPM: bb6: +; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = tail call i32* @f2(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR12]] +; IS__CGSCC_NPM-NEXT: ret i32* [[TMP7]] +; IS__CGSCC_NPM: bb9: +; IS__CGSCC_NPM-NEXT: [[TMP10:%.*]] = phi i32* [ [[TMP5C]], [[BB4]] ], [ inttoptr (i64 4 to i32*), [[BB:%.*]] ] +; IS__CGSCC_NPM-NEXT: ret i32* [[TMP10]] ; bb: @@ -399,12 +500,19 @@ bb9: ; preds = %bb4, %bb } define internal i32* @f2(i32* %arg) { -; CHECK: Function Attrs: argmemonly nofree nosync nounwind readonly -; CHECK-LABEL: define {{[^@]+}}@f2 -; CHECK-SAME: (i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR4]] { -; CHECK-NEXT: bb: -; CHECK-NEXT: [[TMP:%.*]] = tail call i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR12]] -; CHECK-NEXT: ret i32* [[TMP]] +; 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:%.*]]) #[[ATTR5]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = tail call i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR13]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[TMP]] +; +; IS__CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f2 +; IS__CGSCC_NPM-SAME: (i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR4]] { +; IS__CGSCC_NPM-NEXT: bb: +; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = tail call i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR12]] +; IS__CGSCC_NPM-NEXT: ret i32* [[TMP]] ; bb: %tmp = tail call i32* @f1(i32* %arg) @@ -413,12 +521,19 @@ bb: define dso_local noalias i32* @f3(i32* %arg) { ; FIXME: missing nonnull. It should be nonnull @f3(i32* nonnull readonly %arg) -; CHECK: Function Attrs: argmemonly nofree nosync nounwind readonly -; CHECK-LABEL: define {{[^@]+}}@f3 -; CHECK-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4]] { -; CHECK-NEXT: bb: -; CHECK-NEXT: [[TMP:%.*]] = call i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR12]] -; CHECK-NEXT: ret i32* [[TMP]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f3 +; NOT_CGSCC_NPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR5]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = call i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR13]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[TMP]] +; +; IS__CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f3 +; IS__CGSCC_NPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4]] { +; IS__CGSCC_NPM-NEXT: bb: +; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = call i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR12]] +; IS__CGSCC_NPM-NEXT: ret i32* [[TMP]] ; bb: ; FIXME: missing nonnull. It should be @f1(i32* nonnull readonly %arg) @@ -449,17 +564,29 @@ declare void @fun3(i8*, i8*, i8*) #1 ; fun2(nonnull %a, %b) ; We can say that %a is nonnull but %b is not. define void @f16(i8* %a, i8 * %b, i8 %c) { -; CHECK: Function Attrs: nounwind willreturn -; CHECK-LABEL: define {{[^@]+}}@f16 -; CHECK-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR5:[0-9]+]] { -; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 -; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; CHECK: if.then: -; CHECK-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* nonnull [[B]]) #[[ATTR5]] -; CHECK-NEXT: ret void -; CHECK: if.else: -; CHECK-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) #[[ATTR5]] -; CHECK-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f16 +; NOT_CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR6:[0-9]+]] { +; 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]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: if.else: +; NOT_CGSCC_NPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) #[[ATTR6]] +; NOT_CGSCC_NPM-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:%.*]]) #[[ATTR5:[0-9]+]] { +; 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]]) #[[ATTR5]] +; IS__CGSCC_NPM-NEXT: ret void +; IS__CGSCC_NPM: if.else: +; IS__CGSCC_NPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) #[[ATTR5]] +; IS__CGSCC_NPM-NEXT: ret void ; %cmp = icmp eq i8 %c, 0 br i1 %cmp, label %if.then, label %if.else @@ -479,20 +606,35 @@ if.else: ; We can say that %a is nonnull define void @f17(i8* %a, i8 %c) { ; -; CHECK: Function Attrs: nounwind willreturn -; CHECK-LABEL: define {{[^@]+}}@f17 -; CHECK-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR5]] { -; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 -; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; CHECK: if.then: -; CHECK-NEXT: tail call void @fun0() #[[ATTR5]] -; CHECK-NEXT: br label [[CONT:%.*]] -; CHECK: if.else: -; CHECK-NEXT: tail call void @fun0() #[[ATTR5]] -; CHECK-NEXT: br label [[CONT]] -; CHECK: cont: -; CHECK-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR5]] -; CHECK-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f17 +; NOT_CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR6]] { +; 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() #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[CONT:%.*]] +; NOT_CGSCC_NPM: if.else: +; NOT_CGSCC_NPM-NEXT: tail call void @fun0() #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[CONT]] +; NOT_CGSCC_NPM: cont: +; NOT_CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR6]] +; NOT_CGSCC_NPM-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:%.*]]) #[[ATTR5]] { +; 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() #[[ATTR5]] +; IS__CGSCC_NPM-NEXT: br label [[CONT:%.*]] +; IS__CGSCC_NPM: if.else: +; IS__CGSCC_NPM-NEXT: tail call void @fun0() #[[ATTR5]] +; IS__CGSCC_NPM-NEXT: br label [[CONT]] +; IS__CGSCC_NPM: cont: +; IS__CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR5]] +; IS__CGSCC_NPM-NEXT: ret void ; %cmp = icmp eq i8 %c, 0 br i1 %cmp, label %if.then, label %if.else @@ -518,29 +660,53 @@ cont: ; fun1(nonnull %a) define void @f18(i8* %a, i8* %b, i8 %c) { -; CHECK: Function Attrs: nounwind willreturn -; CHECK-LABEL: define {{[^@]+}}@f18 -; CHECK-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR5]] { -; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 [[C]], 0 -; CHECK-NEXT: br i1 [[CMP1]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; CHECK: if.then: -; CHECK-NEXT: tail call void @fun0() #[[ATTR5]] -; CHECK-NEXT: br label [[CONT:%.*]] -; CHECK: if.else: -; CHECK-NEXT: tail call void @fun0() #[[ATTR5]] -; CHECK-NEXT: br label [[CONT]] -; CHECK: cont: -; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 1 -; CHECK-NEXT: br i1 [[CMP2]], label [[CONT_THEN:%.*]], label [[CONT_ELSE:%.*]] -; CHECK: cont.then: -; CHECK-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR5]] -; CHECK-NEXT: br label [[CONT2:%.*]] -; CHECK: cont.else: -; CHECK-NEXT: tail call void @fun0() #[[ATTR5]] -; CHECK-NEXT: br label [[CONT2]] -; CHECK: cont2: -; CHECK-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR5]] -; CHECK-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f18 +; NOT_CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR6]] { +; 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() #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[CONT:%.*]] +; NOT_CGSCC_NPM: if.else: +; NOT_CGSCC_NPM-NEXT: tail call void @fun0() #[[ATTR6]] +; 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]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[CONT2:%.*]] +; NOT_CGSCC_NPM: cont.else: +; NOT_CGSCC_NPM-NEXT: tail call void @fun0() #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[CONT2]] +; NOT_CGSCC_NPM: cont2: +; NOT_CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR6]] +; NOT_CGSCC_NPM-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:%.*]]) #[[ATTR5]] { +; 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() #[[ATTR5]] +; IS__CGSCC_NPM-NEXT: br label [[CONT:%.*]] +; IS__CGSCC_NPM: if.else: +; IS__CGSCC_NPM-NEXT: tail call void @fun0() #[[ATTR5]] +; 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]]) #[[ATTR5]] +; IS__CGSCC_NPM-NEXT: br label [[CONT2:%.*]] +; IS__CGSCC_NPM: cont.else: +; IS__CGSCC_NPM-NEXT: tail call void @fun0() #[[ATTR5]] +; IS__CGSCC_NPM-NEXT: br label [[CONT2]] +; IS__CGSCC_NPM: cont2: +; IS__CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR5]] +; IS__CGSCC_NPM-NEXT: ret void ; %cmp1 = icmp eq i8 %c, 0 br i1 %cmp1, label %if.then, label %if.else @@ -567,20 +733,35 @@ cont2: ; TEST 19: Loop define void @f19(i8* %a, i8* %b, i8 %c) { -; CHECK: Function Attrs: nounwind -; CHECK-LABEL: define {{[^@]+}}@f19 -; CHECK-SAME: (i8* [[A:%.*]], i8* nonnull [[B:%.*]], i8 [[C:%.*]]) #[[ATTR3]] { -; CHECK-NEXT: br label [[LOOP_HEADER:%.*]] -; CHECK: loop.header: -; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 0 -; CHECK-NEXT: br i1 [[CMP2]], label [[LOOP_BODY:%.*]], label [[LOOP_EXIT:%.*]] -; CHECK: loop.body: -; CHECK-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR3]] -; CHECK-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR3]] -; CHECK-NEXT: br label [[LOOP_HEADER]] -; CHECK: loop.exit: -; CHECK-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR3]] -; CHECK-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f19 +; NOT_CGSCC_NPM-SAME: (i8* [[A:%.*]], i8* nonnull [[B:%.*]], i8 [[C:%.*]]) #[[ATTR4]] { +; 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]]) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: br label [[LOOP_HEADER]] +; NOT_CGSCC_NPM: loop.exit: +; NOT_CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR4]] +; 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:%.*]]) #[[ATTR3]] { +; 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]]) #[[ATTR3]] +; IS__CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR3]] +; IS__CGSCC_NPM-NEXT: br label [[LOOP_HEADER]] +; IS__CGSCC_NPM: loop.exit: +; IS__CGSCC_NPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR3]] +; IS__CGSCC_NPM-NEXT: ret void ; br label %loop.header loop.header: @@ -713,11 +894,17 @@ define i8 @parent6(i8* %a, i8* %b) { ; The nonnull callsite is guaranteed to execute, so the argument must be nonnull throughout the parent. define i8 @parent7(i8* %a) { -; CHECK-LABEL: define {{[^@]+}}@parent7 -; CHECK-SAME: (i8* nonnull [[A:%.*]]) { -; CHECK-NEXT: [[RET:%.*]] = call i8 @use1safecall(i8* nonnull readonly [[A]]) #[[ATTR13:[0-9]+]] -; CHECK-NEXT: call void @use1nonnull(i8* nonnull [[A]]) -; CHECK-NEXT: ret i8 [[RET]] +; 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]]) #[[ATTR14:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: call void @use1nonnull(i8* nonnull [[A]]) +; NOT_CGSCC_NPM-NEXT: ret i8 [[RET]] +; +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@parent7 +; IS__CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]]) { +; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = call i8 @use1safecall(i8* nonnull readonly [[A]]) #[[ATTR13:[0-9]+]] +; IS__CGSCC_NPM-NEXT: call void @use1nonnull(i8* nonnull [[A]]) +; IS__CGSCC_NPM-NEXT: ret i8 [[RET]] ; @@ -731,18 +918,31 @@ define i8 @parent7(i8* %a) { declare i32 @esfp(...) 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:%.*]]) #[[ATTR3]] personality i8* bitcast (i32 (...)* @esfp to i8*) { -; CHECK-NEXT: entry: -; CHECK-NEXT: invoke void @use2nonnull(i8* nonnull [[A]], i8* nonnull [[B]]) -; CHECK-NEXT: to label [[CONT:%.*]] unwind label [[EXC:%.*]] -; CHECK: cont: -; CHECK-NEXT: ret i1 false -; CHECK: exc: -; CHECK-NEXT: [[LP:%.*]] = landingpad { i8*, i32 } -; CHECK-NEXT: filter [0 x i8*] zeroinitializer -; CHECK-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@parent8 +; NOT_CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]], i8* nocapture nofree readnone [[BOGUS1:%.*]], i8* nonnull [[B:%.*]]) #[[ATTR4]] personality i8* bitcast (i32 (...)* @esfp to i8*) { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: invoke void @use2nonnull(i8* nonnull [[A]], i8* nonnull [[B]]) +; NOT_CGSCC_NPM-NEXT: to label [[CONT:%.*]] unwind label [[EXC:%.*]] +; NOT_CGSCC_NPM: cont: +; NOT_CGSCC_NPM-NEXT: ret i1 false +; NOT_CGSCC_NPM: exc: +; NOT_CGSCC_NPM-NEXT: [[LP:%.*]] = landingpad { i8*, i32 } +; NOT_CGSCC_NPM-NEXT: filter [0 x i8*] zeroinitializer +; NOT_CGSCC_NPM-NEXT: unreachable +; +; IS__CGSCC_NPM: Function Attrs: nounwind +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@parent8 +; IS__CGSCC_NPM-SAME: (i8* nonnull [[A:%.*]], i8* nocapture nofree readnone [[BOGUS1:%.*]], i8* nonnull [[B:%.*]]) #[[ATTR3]] personality i8* bitcast (i32 (...)* @esfp to i8*) { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: invoke void @use2nonnull(i8* nonnull [[A]], i8* nonnull [[B]]) +; IS__CGSCC_NPM-NEXT: to label [[CONT:%.*]] unwind label [[EXC:%.*]] +; IS__CGSCC_NPM: cont: +; IS__CGSCC_NPM-NEXT: ret i1 false +; IS__CGSCC_NPM: exc: +; IS__CGSCC_NPM-NEXT: [[LP:%.*]] = landingpad { i8*, i32 } +; IS__CGSCC_NPM-NEXT: filter [0 x i8*] zeroinitializer +; IS__CGSCC_NPM-NEXT: unreachable ; entry: @@ -772,11 +972,17 @@ define i32* @gep1(i32* %p) { define i32* @gep1_no_null_opt(i32* %p) #0 { ; Should't be able to derive nonnull based on gep. -; CHECK: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn -; CHECK-LABEL: define {{[^@]+}}@gep1_no_null_opt -; CHECK-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR7:[0-9]+]] { -; CHECK-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 -; CHECK-NEXT: ret i32* [[Q]] +; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@gep1_no_null_opt +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 +; NOT_CGSCC_NPM-NEXT: ret i32* [[Q]] +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@gep1_no_null_opt +; IS__CGSCC_NPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR7:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 +; IS__CGSCC_NPM-NEXT: ret i32* [[Q]] ; %q = getelementptr inbounds i32, i32* %p, i32 1 ret i32* %q @@ -825,11 +1031,17 @@ define i32* @g1() { declare void @use_i32_ptr(i32* readnone nocapture) nounwind define internal void @called_by_weak(i32* %a) { -; CHECK: Function Attrs: nounwind -; CHECK-LABEL: define {{[^@]+}}@called_by_weak -; CHECK-SAME: (i32* noalias nocapture nonnull readnone [[A:%.*]]) #[[ATTR3]] { -; CHECK-NEXT: call void @use_i32_ptr(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR3]] -; CHECK-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@called_by_weak +; NOT_CGSCC_NPM-SAME: (i32* noalias nocapture nonnull readnone [[A:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: call void @use_i32_ptr(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR4]] +; 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:%.*]]) #[[ATTR3]] { +; IS__CGSCC_NPM-NEXT: call void @use_i32_ptr(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR3]] +; IS__CGSCC_NPM-NEXT: ret void ; call void @use_i32_ptr(i32* %a) ret void @@ -838,10 +1050,15 @@ define internal void @called_by_weak(i32* %a) { ; Check we do not annotate the function interface of this weak function. define weak_odr void @weak_caller(i32* nonnull %a) { ; -; CHECK-LABEL: define {{[^@]+}}@weak_caller -; CHECK-SAME: (i32* nonnull [[A:%.*]]) { -; CHECK-NEXT: call void @called_by_weak(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR3]] -; CHECK-NEXT: ret void +; 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]]) #[[ATTR4]] +; 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]]) #[[ATTR3]] +; IS__CGSCC_NPM-NEXT: ret void ; call void @called_by_weak(i32* %a) ret void @@ -849,22 +1066,34 @@ define weak_odr void @weak_caller(i32* nonnull %a) { ; Expect nonnull define internal void @control(i32* dereferenceable(4) %a) { -; CHECK: Function Attrs: nounwind -; CHECK-LABEL: define {{[^@]+}}@control -; CHECK-SAME: (i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR3]] { -; CHECK-NEXT: call void @use_i32_ptr(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR3]] -; CHECK-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@control +; NOT_CGSCC_NPM-SAME: (i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: call void @use_i32_ptr(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: nounwind +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@control +; IS__CGSCC_NPM-SAME: (i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR3]] { +; IS__CGSCC_NPM-NEXT: call void @use_i32_ptr(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR3]] +; IS__CGSCC_NPM-NEXT: ret void ; call void @use_i32_ptr(i32* %a) ret void } ; Avoid nonnull as we do not touch naked functions define internal void @naked(i32* dereferenceable(4) %a) naked { -; CHECK: Function Attrs: naked -; CHECK-LABEL: define {{[^@]+}}@naked -; CHECK-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR8:[0-9]+]] { -; CHECK-NEXT: call void @use_i32_ptr(i32* [[A]]) -; CHECK-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: naked +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@naked +; NOT_CGSCC_NPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR9:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: call void @use_i32_ptr(i32* [[A]]) +; NOT_CGSCC_NPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: naked +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@naked +; IS__CGSCC_NPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR8:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: call void @use_i32_ptr(i32* [[A]]) +; IS__CGSCC_NPM-NEXT: ret void ; call void @use_i32_ptr(i32* %a) ret void @@ -872,22 +1101,35 @@ define internal void @naked(i32* dereferenceable(4) %a) naked { ; Avoid nonnull as we do not touch optnone 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:%.*]]) #[[ATTR9:[0-9]+]] { -; CHECK-NEXT: call void @use_i32_ptr(i32* [[A]]) -; CHECK-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: noinline optnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@optnone +; NOT_CGSCC_NPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR10:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: call void @use_i32_ptr(i32* [[A]]) +; NOT_CGSCC_NPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: noinline optnone +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@optnone +; IS__CGSCC_NPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR9:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: call void @use_i32_ptr(i32* [[A]]) +; IS__CGSCC_NPM-NEXT: ret void ; call void @use_i32_ptr(i32* %a) ret void } define void @make_live(i32* nonnull dereferenceable(8) %a) { -; CHECK-LABEL: define {{[^@]+}}@make_live -; CHECK-SAME: (i32* noundef nonnull align 16 dereferenceable(8) [[A:%.*]]) { -; CHECK-NEXT: call void @naked(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) -; CHECK-NEXT: call void @control(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR3]] -; CHECK-NEXT: call void @optnone(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) -; CHECK-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@make_live +; NOT_CGSCC_NPM-SAME: (i32* noundef nonnull align 16 dereferenceable(8) [[A:%.*]]) { +; NOT_CGSCC_NPM-NEXT: call void @naked(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) +; NOT_CGSCC_NPM-NEXT: call void @control(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: call void @optnone(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) +; NOT_CGSCC_NPM-NEXT: ret void +; +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@make_live +; IS__CGSCC_NPM-SAME: (i32* noundef nonnull align 16 dereferenceable(8) [[A:%.*]]) { +; IS__CGSCC_NPM-NEXT: call void @naked(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) +; IS__CGSCC_NPM-NEXT: call void @control(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR3]] +; IS__CGSCC_NPM-NEXT: call void @optnone(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) +; IS__CGSCC_NPM-NEXT: ret void ; call void @naked(i32* nonnull dereferenceable(8) align 16 %a) call void @control(i32* nonnull dereferenceable(8) align 16 %a) @@ -908,35 +1150,51 @@ define i32 @nonnull_exec_ctx_1(i32* %a, i32 %b) { ; ; IS________OPM: Function Attrs: nounwind ; IS________OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1 -; IS________OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR3]] { +; IS________OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR4]] { ; IS________OPM-NEXT: en: ; IS________OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 ; IS________OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] ; IS________OPM: ex: -; IS________OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR3]] +; IS________OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]] ; IS________OPM-NEXT: ret i32 [[TMP5]] ; IS________OPM: hd: ; IS________OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; IS________OPM-NEXT: tail call void @h(i32* [[A]]) #[[ATTR3]] +; IS________OPM-NEXT: tail call void @h(i32* [[A]]) #[[ATTR4]] ; IS________OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 ; IS________OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] ; IS________OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] ; -; IS________NPM: Function Attrs: nounwind willreturn -; IS________NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1 -; IS________NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] { -; IS________NPM-NEXT: en: -; IS________NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; IS________NPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; IS________NPM: ex: -; IS________NPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR5]] -; IS________NPM-NEXT: ret i32 [[TMP5]] -; IS________NPM: hd: -; IS________NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; IS________NPM-NEXT: tail call void @h(i32* [[A]]) #[[ATTR5]] -; IS________NPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; IS________NPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; IS________NPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] +; IS__TUNIT_NPM: Function Attrs: nounwind willreturn +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1 +; IS__TUNIT_NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] { +; 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]]) #[[ATTR6]] +; 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]]) #[[ATTR6]] +; 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 +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1 +; IS__CGSCC_NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] { +; 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: 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]]) #[[ATTR5]] +; 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]] ; en: %tmp3 = icmp eq i32 %b, 0 @@ -958,39 +1216,57 @@ define i32 @nonnull_exec_ctx_1b(i32* %a, i32 %b) { ; ; IS________OPM: Function Attrs: nounwind ; IS________OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b -; IS________OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR3]] { +; IS________OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR4]] { ; IS________OPM-NEXT: en: ; IS________OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 ; IS________OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] ; IS________OPM: ex: -; IS________OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR3]] +; IS________OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]] ; IS________OPM-NEXT: ret i32 [[TMP5]] ; IS________OPM: hd: ; IS________OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; IS________OPM-NEXT: tail call void @h(i32* [[A]]) #[[ATTR3]] +; IS________OPM-NEXT: tail call void @h(i32* [[A]]) #[[ATTR4]] ; IS________OPM-NEXT: br label [[HD2]] ; IS________OPM: hd2: ; IS________OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 ; IS________OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] ; IS________OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] ; -; IS________NPM: Function Attrs: nounwind willreturn -; IS________NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b -; IS________NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] { -; IS________NPM-NEXT: en: -; IS________NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; IS________NPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; IS________NPM: ex: -; IS________NPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR5]] -; IS________NPM-NEXT: ret i32 [[TMP5]] -; IS________NPM: hd: -; IS________NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; IS________NPM-NEXT: tail call void @h(i32* [[A]]) #[[ATTR5]] -; IS________NPM-NEXT: br label [[HD2]] -; IS________NPM: hd2: -; IS________NPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; IS________NPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; IS________NPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] +; IS__TUNIT_NPM: Function Attrs: nounwind willreturn +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b +; IS__TUNIT_NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] { +; 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]]) #[[ATTR6]] +; 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]]) #[[ATTR6]] +; 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 +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b +; IS__CGSCC_NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] { +; 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: 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]]) #[[ATTR5]] +; IS__CGSCC_NPM-NEXT: br label [[HD2]] +; IS__CGSCC_NPM: hd2: +; 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]] ; en: %tmp3 = icmp eq i32 %b, 0 @@ -1013,21 +1289,37 @@ hd2: define i32 @nonnull_exec_ctx_2(i32* %a, i32 %b) willreturn nounwind { ; -; CHECK: Function Attrs: nounwind willreturn -; CHECK-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2 -; CHECK-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] { -; CHECK-NEXT: en: -; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; CHECK-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; CHECK: ex: -; CHECK-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR3]] -; CHECK-NEXT: ret i32 [[TMP5]] -; CHECK: hd: -; CHECK-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; CHECK-NEXT: tail call void @h(i32* nonnull [[A]]) #[[ATTR3]] -; CHECK-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; CHECK-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; CHECK-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] +; NOT_CGSCC_NPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2 +; NOT_CGSCC_NPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] { +; 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]]) #[[ATTR4]] +; 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]]) #[[ATTR4]] +; 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__CGSCC_NPM: Function Attrs: nounwind willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2 +; IS__CGSCC_NPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] { +; 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]]) #[[ATTR3]] +; 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]]) #[[ATTR3]] +; 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]] ; en: %tmp3 = icmp eq i32 %b, 0 @@ -1047,23 +1339,41 @@ hd: define i32 @nonnull_exec_ctx_2b(i32* %a, i32 %b) willreturn nounwind { ; -; CHECK: Function Attrs: nounwind willreturn -; CHECK-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b -; CHECK-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] { -; CHECK-NEXT: en: -; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; CHECK-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; CHECK: ex: -; CHECK-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR3]] -; CHECK-NEXT: ret i32 [[TMP5]] -; CHECK: hd: -; CHECK-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; CHECK-NEXT: tail call void @h(i32* nonnull [[A]]) #[[ATTR3]] -; CHECK-NEXT: br label [[HD2]] -; CHECK: hd2: -; CHECK-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; CHECK-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; CHECK-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] +; NOT_CGSCC_NPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b +; NOT_CGSCC_NPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] { +; 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]]) #[[ATTR4]] +; 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]]) #[[ATTR4]] +; 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__CGSCC_NPM: Function Attrs: nounwind willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b +; IS__CGSCC_NPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] { +; 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]]) #[[ATTR3]] +; 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]]) #[[ATTR3]] +; IS__CGSCC_NPM-NEXT: br label [[HD2]] +; IS__CGSCC_NPM: hd2: +; 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]] ; en: %tmp3 = icmp eq i32 %b, 0 @@ -1200,14 +1510,23 @@ declare i8* @strrchr(i8* %0, i32 %1) nofree nounwind readonly willreturn ; We should not mark the return of @strrchr as `nonnull`, it may well be NULL! define i8* @mybasename(i8* nofree readonly %str) { -; CHECK: Function Attrs: nofree nounwind readonly willreturn -; CHECK-LABEL: define {{[^@]+}}@mybasename -; CHECK-SAME: (i8* nofree readonly [[STR:%.*]]) #[[ATTR10:[0-9]+]] { -; CHECK-NEXT: [[CALL:%.*]] = call i8* @strrchr(i8* nofree readonly [[STR]], i32 noundef 47) #[[ATTR13]] -; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i8* [[CALL]], null -; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[CALL]], i64 1 -; CHECK-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i8* [[ADD_PTR]], i8* [[STR]] -; CHECK-NEXT: ret i8* [[COND]] +; NOT_CGSCC_NPM: Function Attrs: nofree nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@mybasename +; NOT_CGSCC_NPM-SAME: (i8* nofree readonly [[STR:%.*]]) #[[ATTR11:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i8* @strrchr(i8* nofree readonly [[STR]], i32 noundef 47) #[[ATTR14]] +; 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__CGSCC_NPM: Function Attrs: nofree nounwind readonly willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@mybasename +; IS__CGSCC_NPM-SAME: (i8* nofree readonly [[STR:%.*]]) #[[ATTR10:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i8* @strrchr(i8* nofree readonly [[STR]], i32 noundef 47) #[[ATTR13]] +; IS__CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i8* [[CALL]], null +; IS__CGSCC_NPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[CALL]], i64 1 +; IS__CGSCC_NPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i8* [[ADD_PTR]], i8* [[STR]] +; IS__CGSCC_NPM-NEXT: ret i8* [[COND]] ; %call = call i8* @strrchr(i8* %str, i32 47) %tobool = icmp ne i8* %call, null @@ -1224,12 +1543,19 @@ define void @nonnull_assume_pos(i8* %arg) { ; ATTRIBUTOR-NEXT: [[TMP1:%.*]] = call i8* @unknown() ; ATTRIBUTOR-NEXT: ret void ; -; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_pos -; CHECK-SAME: (i8* nocapture nofree nonnull readnone [[ARG:%.*]]) { -; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "nonnull"(i8* [[ARG]]) ] -; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]] -; CHECK-NEXT: [[TMP1:%.*]] = call i8* @unknown() -; CHECK-NEXT: ret void +; 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) #[[ATTR12]] [ "nonnull"(i8* [[ARG]]) ] +; NOT_CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i8* @unknown() +; NOT_CGSCC_NPM-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) #[[ATTR11]] [ "nonnull"(i8* [[ARG]]) ] +; IS__CGSCC_NPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]] +; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i8* @unknown() +; IS__CGSCC_NPM-NEXT: ret void ; call void @llvm.assume(i1 true) ["nonnull"(i8* %arg)] call void @use_i8_ptr(i8* %arg) @@ -1250,17 +1576,29 @@ define void @nonnull_assume_neg(i8* %arg) { ; ATTRIBUTOR-NEXT: ret void ; ; -; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_neg -; CHECK-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) { -; CHECK-NEXT: [[TMP1:%.*]] = call i8* @unknown() -; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG]]) #[[ATTR3]] -; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ] -; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]] -; CHECK-NEXT: [[TMP2:%.*]] = call i8* @unknown() -; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]] -; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ] -; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]] -; CHECK-NEXT: ret void +; 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]]) #[[ATTR4]] +; 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]]) #[[ATTR4]] +; 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]]) #[[ATTR4]] +; 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]]) #[[ATTR4]] +; 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]]) #[[ATTR3]] +; 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]]) #[[ATTR3]] +; 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]]) #[[ATTR3]] +; 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]]) #[[ATTR3]] +; IS__CGSCC_NPM-NEXT: ret void ; call i8* @unknown() call void @use_i8_ptr(i8* %arg) @@ -1312,18 +1650,34 @@ declare void @nonnull_callee(i8* nonnull %p) attributes #0 = { null_pointer_is_valid } attributes #1 = { nounwind willreturn} ;. -; CHECK: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; CHECK: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; CHECK: attributes #[[ATTR2]] = { noreturn } -; CHECK: attributes #[[ATTR3]] = { nounwind } -; CHECK: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind readonly } -; CHECK: attributes #[[ATTR5]] = { nounwind willreturn } -; CHECK: attributes #[[ATTR6:[0-9]+]] = { nounwind readonly willreturn } -; CHECK: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } -; CHECK: attributes #[[ATTR8]] = { naked } -; CHECK: attributes #[[ATTR9]] = { noinline optnone } -; CHECK: attributes #[[ATTR10]] = { nofree nounwind readonly willreturn } -; CHECK: attributes #[[ATTR11]] = { willreturn } -; CHECK: attributes #[[ATTR12]] = { nofree nosync nounwind readonly } -; CHECK: attributes #[[ATTR13]] = { readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { noreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind readonly } +; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR7:[0-9]+]] = { nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { naked } +; NOT_CGSCC_NPM: attributes #[[ATTR10]] = { noinline optnone } +; NOT_CGSCC_NPM: attributes #[[ATTR11]] = { nofree nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR12]] = { willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR13]] = { nofree nosync nounwind readonly } +; NOT_CGSCC_NPM: attributes #[[ATTR14]] = { readonly willreturn } +;. +; IS__CGSCC_NPM: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR2]] = { noreturn } +; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nounwind } +; IS__CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind readonly } +; IS__CGSCC_NPM: attributes #[[ATTR5]] = { nounwind willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR6:[0-9]+]] = { nounwind readonly willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR8]] = { naked } +; IS__CGSCC_NPM: attributes #[[ATTR9]] = { noinline optnone } +; IS__CGSCC_NPM: attributes #[[ATTR10]] = { nofree nounwind readonly willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR11]] = { willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR12]] = { nofree nosync nounwind readonly } +; IS__CGSCC_NPM: attributes #[[ATTR13]] = { readonly willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/norecurse.ll b/llvm/test/Transforms/Attributor/norecurse.ll index 23ca0c987f868..61bba0a6044ed 100644 --- a/llvm/test/Transforms/Attributor/norecurse.ll +++ b/llvm/test/Transforms/Attributor/norecurse.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=3 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=3 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM +; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=4 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM +; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=4 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM @@ -14,9 +14,9 @@ define i32 @leaf() { } define i32 @self_rec() { -; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn ; CHECK-LABEL: define {{[^@]+}}@self_rec -; CHECK-SAME: () #[[ATTR0]] { +; CHECK-SAME: () #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: ret i32 4 ; %a = call i32 @self_rec() @@ -24,19 +24,29 @@ define i32 @self_rec() { } define i32 @indirect_rec() { -; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; CHECK-LABEL: define {{[^@]+}}@indirect_rec -; CHECK-SAME: () #[[ATTR0]] { -; CHECK-NEXT: ret i32 undef +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@indirect_rec +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i32 undef +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@indirect_rec +; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { +; IS__CGSCC_NPM-NEXT: ret i32 undef ; %a = call i32 @indirect_rec2() ret i32 %a } define i32 @indirect_rec2() { -; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; CHECK-LABEL: define {{[^@]+}}@indirect_rec2 -; CHECK-SAME: () #[[ATTR0]] { -; CHECK-NEXT: ret i32 undef +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@indirect_rec2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i32 undef +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@indirect_rec2 +; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { +; IS__CGSCC_NPM-NEXT: ret i32 undef ; %a = call i32 @indirect_rec() ret i32 %a @@ -45,7 +55,7 @@ define i32 @indirect_rec2() { define i32 @extern() { ; CHECK: Function Attrs: nosync readnone ; CHECK-LABEL: define {{[^@]+}}@extern -; CHECK-SAME: () #[[ATTR1:[0-9]+]] { +; CHECK-SAME: () #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: [[A:%.*]] = call i32 @k() ; CHECK-NEXT: ret i32 [[A]] ; @@ -60,8 +70,8 @@ declare i32 @k() readnone define void @intrinsic(i8* %dest, i8* %src, i32 %len) { ; CHECK: Function Attrs: argmemonly nofree nosync nounwind willreturn ; CHECK-LABEL: define {{[^@]+}}@intrinsic -; CHECK-SAME: (i8* nocapture nofree writeonly [[DEST:%.*]], i8* nocapture nofree readonly [[SRC:%.*]], i32 [[LEN:%.*]]) #[[ATTR3:[0-9]+]] { -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[DEST]], i8* noalias nocapture nofree readonly [[SRC]], i32 [[LEN]], i1 noundef false) #[[ATTR7:[0-9]+]] +; CHECK-SAME: (i8* nocapture nofree writeonly [[DEST:%.*]], i8* nocapture nofree readonly [[SRC:%.*]], i32 [[LEN:%.*]]) #[[ATTR4:[0-9]+]] { +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[DEST]], i8* noalias nocapture nofree readonly [[SRC]], i32 [[LEN]], i1 noundef false) #[[ATTR8:[0-9]+]] ; CHECK-NEXT: ret void ; call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i1 false) @@ -75,7 +85,7 @@ declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i1) define internal i32 @called_by_norecurse() { ; CHECK: Function Attrs: norecurse nosync readnone ; CHECK-LABEL: define {{[^@]+}}@called_by_norecurse -; CHECK-SAME: () #[[ATTR5:[0-9]+]] { +; CHECK-SAME: () #[[ATTR6:[0-9]+]] { ; CHECK-NEXT: [[A:%.*]] = call i32 @k() ; CHECK-NEXT: ret i32 undef ; @@ -85,13 +95,13 @@ define internal i32 @called_by_norecurse() { define void @m() norecurse { ; IS__TUNIT____: Function Attrs: norecurse nosync readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@m -; IS__TUNIT____-SAME: () #[[ATTR5]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() #[[ATTR1]] +; IS__TUNIT____-SAME: () #[[ATTR6]] { +; 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: () #[[ATTR5]] { +; IS__CGSCC____-SAME: () #[[ATTR6]] { ; IS__CGSCC____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() ; IS__CGSCC____-NEXT: ret void ; @@ -102,7 +112,7 @@ define void @m() norecurse { define internal i32 @called_by_norecurse_indirectly() { ; CHECK: Function Attrs: norecurse nosync readnone ; CHECK-LABEL: define {{[^@]+}}@called_by_norecurse_indirectly -; CHECK-SAME: () #[[ATTR5]] { +; CHECK-SAME: () #[[ATTR6]] { ; CHECK-NEXT: [[A:%.*]] = call i32 @k() ; CHECK-NEXT: ret i32 [[A]] ; @@ -112,13 +122,13 @@ define internal i32 @called_by_norecurse_indirectly() { define internal i32 @o() { ; IS__TUNIT____: Function Attrs: norecurse nosync readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@o -; IS__TUNIT____-SAME: () #[[ATTR5]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() #[[ATTR1]] +; IS__TUNIT____-SAME: () #[[ATTR6]] { +; 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: () #[[ATTR5]] { +; IS__CGSCC____-SAME: () #[[ATTR6]] { ; IS__CGSCC____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() ; IS__CGSCC____-NEXT: ret i32 [[A]] ; @@ -128,13 +138,13 @@ define internal i32 @o() { define i32 @p() norecurse { ; IS__TUNIT____: Function Attrs: norecurse nosync readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@p -; IS__TUNIT____-SAME: () #[[ATTR5]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @o() #[[ATTR1]] +; 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: () #[[ATTR5]] { +; IS__CGSCC____-SAME: () #[[ATTR6]] { ; IS__CGSCC____-NEXT: [[A:%.*]] = call i32 @o() ; IS__CGSCC____-NEXT: ret i32 [[A]] ; @@ -143,9 +153,9 @@ define i32 @p() norecurse { } define void @f(i32 %x) { -; NOT_CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f -; NOT_CGSCC_NPM-SAME: (i32 [[X:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-SAME: (i32 [[X:%.*]]) #[[ATTR1]] { ; NOT_CGSCC_NPM-NEXT: entry: ; NOT_CGSCC_NPM-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 ; NOT_CGSCC_NPM-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 @@ -216,7 +226,7 @@ define i32 @eval_func1(i32 (i32)* , i32) local_unnamed_addr { define i32 @eval_func2(i32 (i32)* , i32) local_unnamed_addr null_pointer_is_valid{ ; CHECK: Function Attrs: null_pointer_is_valid ; CHECK-LABEL: define {{[^@]+}}@eval_func2 -; CHECK-SAME: (i32 (i32)* nocapture nofree noundef [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR6:[0-9]+]] { +; CHECK-SAME: (i32 (i32)* nocapture nofree noundef [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] { ; CHECK-NEXT: [[TMP3:%.*]] = tail call i32 [[TMP0]](i32 [[TMP1]]) ; CHECK-NEXT: ret i32 [[TMP3]] ; @@ -242,11 +252,12 @@ Dead: ;. ; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; CHECK: attributes #[[ATTR1]] = { nosync readnone } -; CHECK: attributes #[[ATTR2:[0-9]+]] = { readnone } -; CHECK: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn } -; CHECK: attributes #[[ATTR4:[0-9]+]] = { argmemonly nofree nounwind willreturn } -; CHECK: attributes #[[ATTR5]] = { norecurse nosync readnone } -; CHECK: attributes #[[ATTR6]] = { null_pointer_is_valid } -; CHECK: attributes #[[ATTR7]] = { willreturn } +; CHECK: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR2]] = { nosync readnone } +; CHECK: attributes #[[ATTR3:[0-9]+]] = { readnone } +; CHECK: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn } +; CHECK: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn } +; CHECK: attributes #[[ATTR6]] = { norecurse nosync readnone } +; CHECK: attributes #[[ATTR7]] = { null_pointer_is_valid } +; CHECK: attributes #[[ATTR8]] = { willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/noreturn.ll b/llvm/test/Transforms/Attributor/noreturn.ll index 5b35208683dd7..dfe40db52288f 100644 --- a/llvm/test/Transforms/Attributor/noreturn.ll +++ b/llvm/test/Transforms/Attributor/noreturn.ll @@ -17,7 +17,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" ; } ; define void @srec0() #0 { -; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; CHECK-LABEL: define {{[^@]+}}@srec0 ; CHECK-SAME: () #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: @@ -36,7 +36,7 @@ entry: ; } ; define i32 @srec16(i32 %a) #0 { -; CHECK: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; CHECK: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn ; CHECK-LABEL: define {{[^@]+}}@srec16 ; CHECK-SAME: (i32 [[A:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: entry: @@ -130,7 +130,7 @@ return: ; No predecessors! define i32 @multiple_noreturn_calls(i32 %a) #0 { ; CHECK: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn ; CHECK-LABEL: define {{[^@]+}}@multiple_noreturn_calls -; CHECK-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (i32 [[A:%.*]]) #[[ATTR3:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 ; CHECK-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] @@ -165,7 +165,7 @@ cond.end: ; preds = %cond.false, %cond.t define i32 @endless_loop_but_willreturn() willreturn { ; CHECK: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn ; CHECK-LABEL: define {{[^@]+}}@endless_loop_but_willreturn -; CHECK-SAME: () #[[ATTR3:[0-9]+]] { +; CHECK-SAME: () #[[ATTR4:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: br label [[WHILE_BODY:%.*]] ; CHECK: while.body: @@ -182,7 +182,7 @@ while.body: ; preds = %entry, %while.body define i32 @UB_and_willreturn() willreturn { ; CHECK: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn ; CHECK-LABEL: define {{[^@]+}}@UB_and_willreturn -; CHECK-SAME: () #[[ATTR3]] { +; CHECK-SAME: () #[[ATTR4]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: unreachable ; @@ -192,8 +192,9 @@ entry: attributes #0 = { noinline nounwind uwtable } ;. -; CHECK: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; CHECK: attributes #[[ATTR1]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; CHECK: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; CHECK: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } ; CHECK: attributes #[[ATTR2]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } -; CHECK: attributes #[[ATTR3]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR3]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; CHECK: attributes #[[ATTR4]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/nosync.ll b/llvm/test/Transforms/Attributor/nosync.ll index c7e794776f0b6..0226e00bfb2a0 100644 --- a/llvm/test/Transforms/Attributor/nosync.ll +++ b/llvm/test/Transforms/Attributor/nosync.ll @@ -204,21 +204,21 @@ define i32 @scc1(i32* %0) noinline nounwind uwtable { ; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nounwind uwtable ; IS__TUNIT____-LABEL: define {{[^@]+}}@scc1 ; IS__TUNIT____-SAME: (i32* nofree [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__TUNIT____-NEXT: tail call void @scc2(i32* nofree [[TMP0]]) #[[ATTR19:[0-9]+]] -; IS__TUNIT____-NEXT: [[VAL:%.*]] = tail call i32 @volatile_load(i32* nofree align 4 [[TMP0]]) #[[ATTR19]] +; IS__TUNIT____-NEXT: tail call void @scc2(i32* nofree [[TMP0]]) #[[ATTR18:[0-9]+]] +; IS__TUNIT____-NEXT: [[VAL:%.*]] = tail call i32 @volatile_load(i32* nofree align 4 [[TMP0]]) #[[ATTR18]] ; IS__TUNIT____-NEXT: ret i32 [[VAL]] ; ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline nounwind uwtable ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@scc1 ; IS__CGSCC_OPM-SAME: (i32* nofree [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: tail call void @scc2(i32* nofree [[TMP0]]) #[[ATTR19:[0-9]+]] -; IS__CGSCC_OPM-NEXT: [[VAL:%.*]] = tail call i32 @volatile_load(i32* nofree noundef align 4 [[TMP0]]) #[[ATTR20:[0-9]+]] +; IS__CGSCC_OPM-NEXT: tail call void @scc2(i32* nofree [[TMP0]]) #[[ATTR18:[0-9]+]] +; IS__CGSCC_OPM-NEXT: [[VAL:%.*]] = tail call i32 @volatile_load(i32* nofree noundef align 4 [[TMP0]]) #[[ATTR19:[0-9]+]] ; IS__CGSCC_OPM-NEXT: ret i32 [[VAL]] ; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline nounwind uwtable ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@scc1 ; IS__CGSCC_NPM-SAME: (i32* nofree [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: tail call void @scc2(i32* nofree [[TMP0]]) #[[ATTR19:[0-9]+]] +; IS__CGSCC_NPM-NEXT: tail call void @scc2(i32* nofree [[TMP0]]) #[[ATTR18:[0-9]+]] ; IS__CGSCC_NPM-NEXT: [[VAL:%.*]] = tail call i32 @volatile_load(i32* nofree noundef align 4 [[TMP0]]) #[[ATTR14:[0-9]+]] ; IS__CGSCC_NPM-NEXT: ret i32 [[VAL]] ; @@ -231,7 +231,7 @@ define void @scc2(i32* %0) noinline nounwind uwtable { ; CHECK: Function Attrs: argmemonly nofree noinline nounwind uwtable ; CHECK-LABEL: define {{[^@]+}}@scc2 ; CHECK-SAME: (i32* nofree [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] { -; CHECK-NEXT: [[TMP2:%.*]] = tail call i32 @scc1(i32* nofree [[TMP0]]) #[[ATTR19:[0-9]+]] +; CHECK-NEXT: [[TMP2:%.*]] = tail call i32 @scc1(i32* nofree [[TMP0]]) #[[ATTR18:[0-9]+]] ; CHECK-NEXT: ret void ; tail call i32 @scc1(i32* %0); @@ -361,13 +361,13 @@ define i32 @memcpy_volatile(i8* %ptr1, i8* %ptr2) { ; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree nounwind willreturn ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@memcpy_volatile ; NOT_CGSCC_OPM-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR10:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[PTR1]], i8* noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR20:[0-9]+]] +; NOT_CGSCC_OPM-NEXT: 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:[0-9]+]] ; NOT_CGSCC_OPM-NEXT: ret i32 4 ; ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nounwind willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@memcpy_volatile ; IS__CGSCC_OPM-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR10:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[PTR1]], i8* noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR21:[0-9]+]] +; IS__CGSCC_OPM-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[PTR1]], i8* noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR20:[0-9]+]] ; IS__CGSCC_OPM-NEXT: ret i32 4 ; call void @llvm.memcpy(i8* %ptr1, i8* %ptr2, i32 8, i1 1) @@ -382,13 +382,13 @@ define i32 @memset_non_volatile(i8* %ptr1, i8 %val) { ; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@memset_non_volatile ; NOT_CGSCC_OPM-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR11:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR21:[0-9]+]] +; NOT_CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR20:[0-9]+]] ; NOT_CGSCC_OPM-NEXT: ret i32 4 ; ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@memset_non_volatile ; IS__CGSCC_OPM-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR11:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR22:[0-9]+]] +; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR21:[0-9]+]] ; IS__CGSCC_OPM-NEXT: ret i32 4 ; call void @llvm.memset(i8* %ptr1, i8 %val, i32 8, i1 0) @@ -444,7 +444,7 @@ declare float @llvm.cos(float %val) readnone ; TEST 19 - positive, readnone & non-convergent intrinsic. define i32 @cos_test(float %x) { -; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn ; CHECK-LABEL: define {{[^@]+}}@cos_test ; CHECK-SAME: (float [[X:%.*]]) #[[ATTR15:[0-9]+]] { ; CHECK-NEXT: ret i32 4 @@ -456,14 +456,14 @@ define i32 @cos_test(float %x) { define float @cos_test2(float %x) { ; NOT_CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@cos_test2 -; NOT_CGSCC_OPM-SAME: (float [[X:%.*]]) #[[ATTR16:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) #[[ATTR22:[0-9]+]] +; NOT_CGSCC_OPM-SAME: (float [[X:%.*]]) #[[ATTR15]] { +; NOT_CGSCC_OPM-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) #[[ATTR21:[0-9]+]] ; NOT_CGSCC_OPM-NEXT: ret float [[C]] ; ; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@cos_test2 -; IS__CGSCC_OPM-SAME: (float [[X:%.*]]) #[[ATTR16:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) #[[ATTR23:[0-9]+]] +; IS__CGSCC_OPM-SAME: (float [[X:%.*]]) #[[ATTR15]] { +; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) #[[ATTR22:[0-9]+]] ; IS__CGSCC_OPM-NEXT: ret float [[C]] ; %c = call float @llvm.cos(float %x) @@ -485,14 +485,13 @@ define float @cos_test2(float %x) { ; NOT_CGSCC_OPM: attributes #[[ATTR12:[0-9]+]] = { convergent readnone } ; NOT_CGSCC_OPM: attributes #[[ATTR13]] = { readnone } ; NOT_CGSCC_OPM: attributes #[[ATTR14]] = { nounwind } -; NOT_CGSCC_OPM: attributes #[[ATTR15]] = { nofree norecurse nosync nounwind readnone willreturn } -; NOT_CGSCC_OPM: attributes #[[ATTR16]] = { nofree nosync nounwind readnone willreturn } -; NOT_CGSCC_OPM: attributes #[[ATTR17:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } -; NOT_CGSCC_OPM: attributes #[[ATTR18:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; NOT_CGSCC_OPM: attributes #[[ATTR19]] = { nofree nounwind } -; NOT_CGSCC_OPM: attributes #[[ATTR20]] = { willreturn } -; NOT_CGSCC_OPM: attributes #[[ATTR21]] = { willreturn writeonly } -; NOT_CGSCC_OPM: attributes #[[ATTR22]] = { readnone willreturn } +; NOT_CGSCC_OPM: attributes #[[ATTR15]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_OPM: attributes #[[ATTR16:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; NOT_CGSCC_OPM: attributes #[[ATTR17:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; NOT_CGSCC_OPM: attributes #[[ATTR18]] = { nofree nounwind } +; NOT_CGSCC_OPM: attributes #[[ATTR19]] = { willreturn } +; NOT_CGSCC_OPM: attributes #[[ATTR20]] = { willreturn writeonly } +; NOT_CGSCC_OPM: attributes #[[ATTR21]] = { readnone willreturn } ;. ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind optsize readnone ssp uwtable willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind uwtable willreturn } @@ -509,13 +508,12 @@ define float @cos_test2(float %x) { ; IS__CGSCC_OPM: attributes #[[ATTR12:[0-9]+]] = { convergent readnone } ; IS__CGSCC_OPM: attributes #[[ATTR13]] = { readnone } ; IS__CGSCC_OPM: attributes #[[ATTR14]] = { nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR15]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR16]] = { nofree nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR17:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR18:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR19]] = { nofree nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR20]] = { nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR21]] = { willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR22]] = { willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR23]] = { readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR15]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR16:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR17:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR18]] = { nofree nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR19]] = { nounwind willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR20]] = { willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR21]] = { willreturn writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR22]] = { readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/nounwind.ll b/llvm/test/Transforms/Attributor/nounwind.ll index f3007d64d7e5c..51fd4df488402 100644 --- a/llvm/test/Transforms/Attributor/nounwind.ll +++ b/llvm/test/Transforms/Attributor/nounwind.ll @@ -16,10 +16,15 @@ define i32 @foo1() { ; TEST 2 define i32 @scc1_foo() { -; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; CHECK-LABEL: define {{[^@]+}}@scc1_foo -; CHECK-SAME: () #[[ATTR0]] { -; CHECK-NEXT: ret i32 1 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@scc1_foo +; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i32 1 +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@scc1_foo +; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { +; IS__CGSCC_NPM-NEXT: ret i32 1 ; %1 = call i32 @scc1_bar() ret i32 1 @@ -28,10 +33,15 @@ define i32 @scc1_foo() { ; TEST 3 define i32 @scc1_bar() { -; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; CHECK-LABEL: define {{[^@]+}}@scc1_bar -; CHECK-SAME: () #[[ATTR0]] { -; CHECK-NEXT: ret i32 1 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@scc1_bar +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i32 1 +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@scc1_bar +; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { +; IS__CGSCC_NPM-NEXT: ret i32 1 ; %1 = call i32 @scc1_foo() ret i32 1 @@ -133,5 +143,8 @@ declare i8* @__cxa_begin_catch(i8*) declare void @__cxa_end_catch() ;. -; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +;. +; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/potential.ll b/llvm/test/Transforms/Attributor/potential.ll index 74317150f658f..7621329c97591 100644 --- a/llvm/test/Transforms/Attributor/potential.ll +++ b/llvm/test/Transforms/Attributor/potential.ll @@ -55,7 +55,6 @@ define internal i32 @call_with_two_values(i32 %c) { ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@call_with_two_values ; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[RET:%.*]] = add i32 0, 0 ; IS__CGSCC____-NEXT: ret i32 undef ; %csret1 = call i32 @iszero2(i32 %c) @@ -104,7 +103,9 @@ define internal i32 @iszero3(i32 %c) { define internal i32 @less_than_two(i32 %c) { ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@less_than_two -; IS__CGSCC____-SAME: () #[[ATTR0]] { +; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp slt i32 undef, 2 +; IS__CGSCC____-NEXT: [[RET:%.*]] = zext i1 true to i32 ; IS__CGSCC____-NEXT: ret i32 undef ; %cmp = icmp slt i32 %c, 2 @@ -183,37 +184,21 @@ define i1 @potential_test6(i32 %c) { } define i1 @potential_test7(i32 %c) { -; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@potential_test7 -; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR2]], !range [[RNG0]] -; IS__TUNIT_OPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR2]], !range [[RNG1:![0-9]+]] -; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] -; IS__TUNIT_OPM-NEXT: ret i1 [[RET]] -; -; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test7 -; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR1]], !range [[RNG0]] -; IS__TUNIT_NPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR1]], !range [[RNG1:![0-9]+]] -; IS__TUNIT_NPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] -; IS__TUNIT_NPM-NEXT: ret i1 [[RET]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test7 -; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR2]], !range [[RNG0]] -; IS__CGSCC_OPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR3:[0-9]+]], !range [[RNG1:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] -; IS__CGSCC_OPM-NEXT: ret i1 [[RET]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test7 -; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR1]], !range [[RNG0]] -; IS__CGSCC_NPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR2:[0-9]+]], !range [[RNG1:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] -; IS__CGSCC_NPM-NEXT: ret i1 [[RET]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________OPM-LABEL: define {{[^@]+}}@potential_test7 +; IS________OPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; IS________OPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR2]], !range [[RNG0]] +; IS________OPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR2]], !range [[RNG1:![0-9]+]] +; IS________OPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] +; IS________OPM-NEXT: ret i1 [[RET]] +; +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@potential_test7 +; IS________NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; IS________NPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR1]], !range [[RNG0]] +; IS________NPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR1]], !range [[RNG1:![0-9]+]] +; IS________NPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] +; IS________NPM-NEXT: ret i1 [[RET]] ; %csret1 = call i32 @return1or3(i32 %c) %csret2 = call i32 @return3or4(i32 %c) @@ -582,29 +567,17 @@ define i32 @potential_test13_caller2() { } define i32 @potential_test13_caller3() { -; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@potential_test13_caller3 -; IS__TUNIT_OPM-SAME: () #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR2]], !range [[RNG2]] -; IS__TUNIT_OPM-NEXT: ret i32 [[RET]] -; -; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test13_caller3 -; IS__TUNIT_NPM-SAME: () #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR1]], !range [[RNG2]] -; IS__TUNIT_NPM-NEXT: ret i32 [[RET]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test13_caller3 -; IS__CGSCC_OPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR3]], !range [[RNG2]] -; IS__CGSCC_OPM-NEXT: ret i32 [[RET]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test13_caller3 -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR2]], !range [[RNG2]] -; IS__CGSCC_NPM-NEXT: ret i32 [[RET]] +; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________OPM-LABEL: define {{[^@]+}}@potential_test13_caller3 +; IS________OPM-SAME: () #[[ATTR0]] { +; IS________OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR2]], !range [[RNG2]] +; IS________OPM-NEXT: ret i32 [[RET]] +; +; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; IS________NPM-LABEL: define {{[^@]+}}@potential_test13_caller3 +; IS________NPM-SAME: () #[[ATTR0]] { +; IS________NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR1]], !range [[RNG2]] +; IS________NPM-NEXT: ret i32 [[RET]] ; %ret = call i32 @potential_test13_callee(i32 undef) ret i32 %ret @@ -664,11 +637,9 @@ define i1 @potential_test16(i1 %c0, i1 %c1) { ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone } ; IS__CGSCC_OPM: attributes #[[ATTR2]] = { readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nounwind readnone willreturn } ;. ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nounwind readnone willreturn } ;. ; CHECK: [[META0:![0-9]+]] = !{i32 1, i32 4} ; CHECK: [[META1:![0-9]+]] = !{i32 3, i32 5} diff --git a/llvm/test/Transforms/Attributor/range.ll b/llvm/test/Transforms/Attributor/range.ll index c4286251ca4b1..614571f060f80 100644 --- a/llvm/test/Transforms/Attributor/range.ll +++ b/llvm/test/Transforms/Attributor/range.ll @@ -1123,7 +1123,8 @@ define internal i32 @less_than_65536(i32 %arg) { define internal i1 @is_less_than_65536(i32 %arg) { ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@is_less_than_65536 -; IS__CGSCC____-SAME: () #[[ATTR1]] { +; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp ult i32 undef, 65536 ; IS__CGSCC____-NEXT: ret i1 undef ; %cmp = icmp ult i32 %arg, 65536 @@ -1315,7 +1316,8 @@ define internal i1 @is_less_than_100_2(i32 %c) { ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@is_less_than_100_2 -; IS__CGSCC____-SAME: () #[[ATTR1]] { +; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp slt i32 undef, 100 ; IS__CGSCC____-NEXT: ret i1 undef ; %cmp = icmp slt i32 %c, 100 @@ -1354,17 +1356,17 @@ define internal i1 @non_zero(i8 %v) { ; Avoid range metadata for %l below define i1 @context(i8* %p) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@context -; IS__TUNIT_OPM-SAME: (i8* nocapture nofree noundef nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT_OPM: t: -; IS__TUNIT_OPM-NEXT: [[R:%.*]] = call i1 @non_zero(i8 [[L]]) #[[ATTR5]] -; IS__TUNIT_OPM-NEXT: ret i1 [[R]] -; IS__TUNIT_OPM: f: -; IS__TUNIT_OPM-NEXT: ret i1 false +; IS________OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; IS________OPM-LABEL: define {{[^@]+}}@context +; IS________OPM-SAME: (i8* nocapture nofree noundef nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR0]] { +; IS________OPM-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 +; IS________OPM-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] +; IS________OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS________OPM: t: +; IS________OPM-NEXT: [[R:%.*]] = call i1 @non_zero(i8 [[L]]) #[[ATTR5]] +; IS________OPM-NEXT: ret i1 [[R]] +; IS________OPM: f: +; IS________OPM-NEXT: ret i1 false ; ; IS________NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn ; IS________NPM-LABEL: define {{[^@]+}}@context @@ -1376,18 +1378,6 @@ define i1 @context(i8* %p) { ; IS________NPM-NEXT: ret i1 true ; IS________NPM: f: ; IS________NPM-NEXT: ret i1 false -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@context -; IS__CGSCC_OPM-SAME: (i8* nocapture nofree noundef nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_OPM: t: -; IS__CGSCC_OPM-NEXT: [[R:%.*]] = call i1 @non_zero(i8 [[L]]) #[[ATTR6:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i1 [[R]] -; IS__CGSCC_OPM: f: -; IS__CGSCC_OPM-NEXT: ret i1 false ; %l = load i8, i8* %p %c = icmp slt i8 0, %l @@ -1518,7 +1508,6 @@ declare void @barney(i32 signext, i32 signext) ; IS__CGSCC_OPM: attributes #[[ATTR3]] = { readonly willreturn } ; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nounwind readnone } ; IS__CGSCC_OPM: attributes #[[ATTR5]] = { readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR6]] = { nounwind readnone willreturn } ;. ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll b/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll index d39af8c562851..2c8e29b007e51 100644 --- a/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll +++ b/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll @@ -296,7 +296,7 @@ define internal i32* @internal_ret1_rw(i32* %r0, i32* %w0) { ; IS__CGSCC____-NEXT: store i32 [[TMP1]], i32* [[W0]], align 4 ; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] ; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] -; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR4]] +; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR5:[0-9]+]] ; IS__CGSCC____-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] ; IS__CGSCC____-NEXT: br label [[RETURN]] ; IS__CGSCC____: return: @@ -339,8 +339,8 @@ define i32* @external_source_ret2_nrw(i32* %n0, i32* %r0, i32* %w0) { ; IS__CGSCC____-LABEL: define {{[^@]+}}@external_source_ret2_nrw ; IS__CGSCC____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR2:[0-9]+]] { ; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR4]] -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR5:[0-9]+]] +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR5]] +; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR4]] ; IS__CGSCC____-NEXT: ret i32* [[CALL1]] ; entry: @@ -362,6 +362,6 @@ entry: ; IS__CGSCC____: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } ; IS__CGSCC____: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind } ; IS__CGSCC____: attributes #[[ATTR3]] = { nofree nosync nounwind } -; IS__CGSCC____: attributes #[[ATTR4]] = { nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR5]] = { nounwind } +; IS__CGSCC____: attributes #[[ATTR4]] = { nounwind } +; IS__CGSCC____: attributes #[[ATTR5]] = { nounwind willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/returned.ll b/llvm/test/Transforms/Attributor/returned.ll index b760a83a4a006..f1d281dfcbc7f 100644 --- a/llvm/test/Transforms/Attributor/returned.ll +++ b/llvm/test/Transforms/Attributor/returned.ll @@ -58,7 +58,7 @@ define i32 @scc_r1(i32 %a, i32 %r, i32 %b) #0 { ; IS__TUNIT____-LABEL: define {{[^@]+}}@scc_r1 ; IS__TUNIT____-SAME: (i32 [[A:%.*]], i32 returned [[R:%.*]], i32 [[B:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR9:[0-9]+]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR10:[0-9]+]] ; IS__TUNIT____-NEXT: ret i32 [[R]] ; ; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn @@ -82,18 +82,18 @@ define i32 @scc_r2(i32 %a, i32 %b, i32 %r) #0 { ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] ; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR10]] ; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] ; IS__TUNIT____: if.end: ; IS__TUNIT____-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] ; IS__TUNIT____-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] ; IS__TUNIT____: if.then3: -; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR10]] ; IS__TUNIT____-NEXT: br label [[RETURN]] ; IS__TUNIT____: if.end12: ; IS__TUNIT____-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] @@ -101,7 +101,7 @@ define i32 @scc_r2(i32 %a, i32 %b, i32 %r) #0 { ; 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]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR10]] ; IS__TUNIT____-NEXT: br label [[COND_END]] ; IS__TUNIT____: cond.end: ; IS__TUNIT____-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] @@ -197,18 +197,18 @@ define i32 @scc_rX(i32 %a, i32 %b, i32 %r) #0 { ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] ; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR10]] ; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] ; IS__TUNIT____: if.end: ; IS__TUNIT____-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] ; IS__TUNIT____-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] ; IS__TUNIT____: if.then3: -; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[B]]) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[B]], i32 undef) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[B]]) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[B]], i32 undef) #[[ATTR10]] ; IS__TUNIT____-NEXT: br label [[RETURN]] ; IS__TUNIT____: if.end12: ; IS__TUNIT____-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] @@ -216,7 +216,7 @@ define i32 @scc_rX(i32 %a, i32 %b, i32 %r) #0 { ; 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]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR10]] ; IS__TUNIT____-NEXT: br label [[COND_END]] ; IS__TUNIT____: cond.end: ; IS__TUNIT____-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] @@ -333,7 +333,7 @@ define double* @ptr_scc_r1(double* %a, double* %r, double* %b) #0 { ; IS__TUNIT____-LABEL: define {{[^@]+}}@ptr_scc_r1 ; IS__TUNIT____-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]], double* nocapture nofree readnone [[B:%.*]]) #[[ATTR1]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] ; IS__TUNIT____-NEXT: ret double* [[R]] ; ; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable @@ -357,18 +357,18 @@ define double* @ptr_scc_r2(double* %a, double* %b, double* %r) #0 { ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp ugt double* [[A]], [[B]] ; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] ; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] ; IS__TUNIT____: if.end: ; IS__TUNIT____-NEXT: [[CMP2:%.*]] = icmp ult double* [[A]], [[B]] ; IS__TUNIT____-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] ; IS__TUNIT____: if.then3: -; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[B]], double* noalias nocapture nofree readnone undef) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[B]], double* noalias nocapture nofree readnone undef) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] +; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR10]] ; IS__TUNIT____-NEXT: br label [[RETURN]] ; IS__TUNIT____: if.end12: ; IS__TUNIT____-NEXT: [[CMP13:%.*]] = icmp eq double* [[A]], [[B]] @@ -376,7 +376,7 @@ define double* @ptr_scc_r2(double* %a, double* %b, double* %r) #0 { ; IS__TUNIT____: cond.true: ; IS__TUNIT____-NEXT: br label [[COND_END:%.*]] ; IS__TUNIT____: cond.false: -; IS__TUNIT____-NEXT: [[CALL14:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL14:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] ; IS__TUNIT____-NEXT: br label [[COND_END]] ; IS__TUNIT____: cond.end: ; IS__TUNIT____-NEXT: [[COND:%.*]] = phi double* [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] @@ -472,12 +472,19 @@ return: ; preds = %cond.end, %if.then3 ; } ; define i32* @rt0(i32* %a) #0 { -; CHECK: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable -; CHECK-LABEL: define {{[^@]+}}@rt0 -; CHECK-SAME: (i32* nofree noundef nonnull readonly returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3:[0-9]+]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @rt0(i32* nofree noundef nonnull readonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[A]]) #[[ATTR10:[0-9]+]] -; CHECK-NEXT: ret i32* [[A]] +; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@rt0 +; IS__TUNIT____-SAME: (i32* nofree noundef nonnull readonly returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3:[0-9]+]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt0(i32* nofree noundef nonnull readonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[A]]) #[[ATTR11:[0-9]+]] +; IS__TUNIT____-NEXT: ret i32* [[A]] +; +; IS__CGSCC____: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@rt0 +; IS__CGSCC____-SAME: (i32* nofree noundef nonnull readonly returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3:[0-9]+]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @rt0(i32* nofree noundef nonnull readonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[A]]) #[[ATTR10:[0-9]+]] +; IS__CGSCC____-NEXT: ret i32* [[A]] ; entry: %v = load i32, i32* %a, align 4 @@ -494,11 +501,17 @@ entry: ; } ; define i32* @rt1(i32* %a) #0 { -; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; CHECK-LABEL: define {{[^@]+}}@rt1 -; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: ret i32* undef +; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; IS__TUNIT____-LABEL: define {{[^@]+}}@rt1 +; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR4:[0-9]+]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: ret i32* undef +; +; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; IS__CGSCC____-LABEL: define {{[^@]+}}@rt1 +; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: ret i32* undef ; entry: %v = load i32, i32* %a, align 4 @@ -515,7 +528,7 @@ define i32* @rt2_helper(i32* %a) #0 { ; 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]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt2(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR10]] ; IS__TUNIT____-NEXT: ret i32* [[A]] ; ; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable @@ -538,7 +551,7 @@ define i32* @rt2(i32* %a, i32 *%b) #0 { ; 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]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt2_helper(i32* noalias nofree readnone [[A]]) #[[ATTR10]] ; IS__TUNIT____-NEXT: br label [[IF_END]] ; IS__TUNIT____: if.end: ; IS__TUNIT____-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ] @@ -577,7 +590,7 @@ define i32* @rt3_helper(i32* %a, i32* %b) #0 { ; IS__TUNIT____-LABEL: define {{[^@]+}}@rt3_helper ; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] { ; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR10]] ; IS__TUNIT____-NEXT: ret i32* [[B]] ; ; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable @@ -600,7 +613,7 @@ define i32* @rt3(i32* %a, i32 *%b) #0 { ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null ; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt3_helper(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR9]] +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt3_helper(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR10]] ; IS__TUNIT____-NEXT: br label [[IF_END]] ; IS__TUNIT____: if.end: ; IS__TUNIT____-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ] @@ -644,11 +657,17 @@ if.end: declare void @unknown_fn(i32* (i32*)*) #0 define i32* @calls_unknown_fn(i32* %r) #0 { -; CHECK: Function Attrs: noinline nounwind uwtable -; CHECK-LABEL: define {{[^@]+}}@calls_unknown_fn -; CHECK-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR4:[0-9]+]] { -; CHECK-NEXT: tail call void @unknown_fn(i32* (i32*)* noundef nonnull @calls_unknown_fn) #[[ATTR11:[0-9]+]] -; CHECK-NEXT: ret i32* [[R]] +; IS__TUNIT____: Function Attrs: noinline nounwind uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@calls_unknown_fn +; IS__TUNIT____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR5:[0-9]+]] { +; IS__TUNIT____-NEXT: tail call void @unknown_fn(i32* (i32*)* noundef nonnull @calls_unknown_fn) #[[ATTR12:[0-9]+]] +; IS__TUNIT____-NEXT: ret i32* [[R]] +; +; IS__CGSCC____: Function Attrs: noinline nounwind uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@calls_unknown_fn +; IS__CGSCC____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR4:[0-9]+]] { +; IS__CGSCC____-NEXT: tail call void @unknown_fn(i32* (i32*)* noundef nonnull @calls_unknown_fn) #[[ATTR11:[0-9]+]] +; IS__CGSCC____-NEXT: ret i32* [[R]] ; tail call void @unknown_fn(i32* (i32*)* nonnull @calls_unknown_fn) ret i32* %r @@ -669,23 +688,36 @@ define i32* @calls_unknown_fn(i32* %r) #0 { ; Verify the maybe-redefined function is not annotated: ; define linkonce_odr i32* @maybe_redefined_fn(i32* %r) #0 { -; CHECK: Function Attrs: noinline nounwind uwtable -; CHECK-LABEL: define {{[^@]+}}@maybe_redefined_fn -; CHECK-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: ret i32* [[R]] +; IS__TUNIT____: Function Attrs: noinline nounwind uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@maybe_redefined_fn +; IS__TUNIT____-SAME: (i32* [[R:%.*]]) #[[ATTR5]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: ret i32* [[R]] +; +; IS__CGSCC____: Function Attrs: noinline nounwind uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@maybe_redefined_fn +; IS__CGSCC____-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: ret i32* [[R]] ; entry: ret i32* %r } define i32* @calls_maybe_redefined_fn(i32* %r) #0 { -; CHECK: Function Attrs: noinline norecurse nounwind uwtable -; CHECK-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn -; CHECK-SAME: (i32* returned [[R:%.*]]) #[[ATTR5:[0-9]+]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) #[[ATTR11]] -; CHECK-NEXT: ret i32* [[R]] +; IS__TUNIT____: Function Attrs: noinline norecurse nounwind uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn +; IS__TUNIT____-SAME: (i32* returned [[R:%.*]]) #[[ATTR6:[0-9]+]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) #[[ATTR12]] +; IS__TUNIT____-NEXT: ret i32* [[R]] +; +; IS__CGSCC____: Function Attrs: noinline norecurse nounwind uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn +; IS__CGSCC____-SAME: (i32* returned [[R:%.*]]) #[[ATTR5:[0-9]+]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) #[[ATTR11]] +; IS__CGSCC____-NEXT: ret i32* [[R]] ; entry: %call = call i32* @maybe_redefined_fn(i32* %r) @@ -705,23 +737,36 @@ entry: ; Verify the maybe-redefined function is not annotated: ; define linkonce_odr i32* @maybe_redefined_fn2(i32* %r) #0 { -; CHECK: Function Attrs: noinline nounwind uwtable -; CHECK-LABEL: define {{[^@]+}}@maybe_redefined_fn2 -; CHECK-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: ret i32* [[R]] +; IS__TUNIT____: Function Attrs: noinline nounwind uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@maybe_redefined_fn2 +; IS__TUNIT____-SAME: (i32* [[R:%.*]]) #[[ATTR5]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: ret i32* [[R]] +; +; IS__CGSCC____: Function Attrs: noinline nounwind uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@maybe_redefined_fn2 +; IS__CGSCC____-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: ret i32* [[R]] ; entry: ret i32* %r } define i32* @calls_maybe_redefined_fn2(i32* %r) #0 { -; CHECK: Function Attrs: noinline norecurse nounwind uwtable -; CHECK-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2 -; CHECK-SAME: (i32* [[R:%.*]]) #[[ATTR5]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) #[[ATTR11]] -; CHECK-NEXT: ret i32* [[CALL]] +; IS__TUNIT____: Function Attrs: noinline norecurse nounwind uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2 +; IS__TUNIT____-SAME: (i32* [[R:%.*]]) #[[ATTR6]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) #[[ATTR12]] +; IS__TUNIT____-NEXT: ret i32* [[CALL]] +; +; IS__CGSCC____: Function Attrs: noinline norecurse nounwind uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2 +; IS__CGSCC____-SAME: (i32* [[R:%.*]]) #[[ATTR5]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) #[[ATTR11]] +; IS__CGSCC____-NEXT: ret i32* [[CALL]] ; entry: %call = call i32* @maybe_redefined_fn2(i32* %r) @@ -783,7 +828,7 @@ define double @recursion_select_and_phi(i32 %a, double %b) #0 { ; 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: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) #[[ATTR10]] ; IS__TUNIT____-NEXT: br label [[IF_END]] ; IS__TUNIT____: if.end: ; IS__TUNIT____-NEXT: ret double [[B]] @@ -1041,17 +1086,29 @@ ret_undef1: declare i32* @unknown(i32*) define i32* @ret_arg_or_unknown(i32* %b) #0 { -; CHECK: Function Attrs: noinline nounwind uwtable -; CHECK-LABEL: define {{[^@]+}}@ret_arg_or_unknown -; CHECK-SAME: (i32* [[B:%.*]]) #[[ATTR4]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null -; CHECK-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] -; CHECK: ret_arg: -; CHECK-NEXT: ret i32* [[B]] -; CHECK: ret_unknown: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) -; CHECK-NEXT: ret i32* [[CALL]] +; IS__TUNIT____: Function Attrs: noinline nounwind uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_arg_or_unknown +; IS__TUNIT____-SAME: (i32* [[B:%.*]]) #[[ATTR5]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; IS__TUNIT____: ret_arg: +; IS__TUNIT____-NEXT: ret i32* [[B]] +; IS__TUNIT____: ret_unknown: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) +; IS__TUNIT____-NEXT: ret i32* [[CALL]] +; +; IS__CGSCC____: Function Attrs: noinline nounwind uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_arg_or_unknown +; IS__CGSCC____-SAME: (i32* [[B:%.*]]) #[[ATTR4]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; IS__CGSCC____: ret_arg: +; IS__CGSCC____-NEXT: ret i32* [[B]] +; IS__CGSCC____: ret_unknown: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) +; IS__CGSCC____-NEXT: ret i32* [[CALL]] ; entry: %cmp = icmp eq i32* %b, null @@ -1066,20 +1123,35 @@ ret_unknown: } define i32* @ret_arg_or_unknown_through_phi(i32* %b) #0 { -; CHECK: Function Attrs: noinline nounwind uwtable -; CHECK-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi -; CHECK-SAME: (i32* [[B:%.*]]) #[[ATTR4]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null -; CHECK-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] -; CHECK: ret_arg: -; CHECK-NEXT: br label [[R:%.*]] -; CHECK: ret_unknown: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) -; CHECK-NEXT: br label [[R]] -; CHECK: r: -; CHECK-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ] -; CHECK-NEXT: ret i32* [[PHI]] +; IS__TUNIT____: Function Attrs: noinline nounwind uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi +; IS__TUNIT____-SAME: (i32* [[B:%.*]]) #[[ATTR5]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; IS__TUNIT____: ret_arg: +; IS__TUNIT____-NEXT: br label [[R:%.*]] +; IS__TUNIT____: ret_unknown: +; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) +; IS__TUNIT____-NEXT: br label [[R]] +; IS__TUNIT____: r: +; IS__TUNIT____-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ] +; IS__TUNIT____-NEXT: ret i32* [[PHI]] +; +; IS__CGSCC____: Function Attrs: noinline nounwind uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi +; IS__CGSCC____-SAME: (i32* [[B:%.*]]) #[[ATTR4]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; IS__CGSCC____: ret_arg: +; IS__CGSCC____-NEXT: br label [[R:%.*]] +; IS__CGSCC____: ret_unknown: +; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) +; IS__CGSCC____-NEXT: br label [[R]] +; IS__CGSCC____: r: +; IS__CGSCC____-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ] +; IS__CGSCC____-NEXT: ret i32* [[PHI]] ; entry: %cmp = icmp eq i32* %b, null @@ -1198,20 +1270,35 @@ r: declare void @noreturn() noreturn; define i32 @deadblockphi3(i32 %A, i1 %c) #0 { -; CHECK: Function Attrs: noinline nounwind uwtable -; CHECK-LABEL: define {{[^@]+}}@deadblockphi3 -; CHECK-SAME: (i32 returned [[A:%.*]], i1 [[C:%.*]]) #[[ATTR4]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] -; CHECK: unreachablecall: -; CHECK-NEXT: call void @noreturn() #[[ATTR6:[0-9]+]] -; CHECK-NEXT: unreachable -; CHECK: unreachableblock2: -; CHECK-NEXT: unreachable -; CHECK: unreachableblock3: -; CHECK-NEXT: unreachable -; CHECK: r: -; CHECK-NEXT: ret i32 [[A]] +; IS__TUNIT____: Function Attrs: noinline nounwind uwtable +; IS__TUNIT____-LABEL: define {{[^@]+}}@deadblockphi3 +; IS__TUNIT____-SAME: (i32 returned [[A:%.*]], i1 [[C:%.*]]) #[[ATTR5]] { +; IS__TUNIT____-NEXT: entry: +; IS__TUNIT____-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] +; IS__TUNIT____: unreachablecall: +; IS__TUNIT____-NEXT: call void @noreturn() #[[ATTR7:[0-9]+]] +; IS__TUNIT____-NEXT: unreachable +; IS__TUNIT____: unreachableblock2: +; IS__TUNIT____-NEXT: unreachable +; IS__TUNIT____: unreachableblock3: +; IS__TUNIT____-NEXT: unreachable +; IS__TUNIT____: r: +; IS__TUNIT____-NEXT: ret i32 [[A]] +; +; IS__CGSCC____: Function Attrs: noinline nounwind uwtable +; IS__CGSCC____-LABEL: define {{[^@]+}}@deadblockphi3 +; IS__CGSCC____-SAME: (i32 returned [[A:%.*]], i1 [[C:%.*]]) #[[ATTR4]] { +; IS__CGSCC____-NEXT: entry: +; IS__CGSCC____-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] +; IS__CGSCC____: unreachablecall: +; IS__CGSCC____-NEXT: call void @noreturn() #[[ATTR6:[0-9]+]] +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: unreachableblock2: +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: unreachableblock3: +; IS__CGSCC____-NEXT: unreachable +; IS__CGSCC____: r: +; IS__CGSCC____-NEXT: ret i32 [[A]] ; entry: br i1 %c, label %r, label %unreachablecall @@ -1269,21 +1356,37 @@ define weak_odr align 16 i32* @non_exact_4(i32* align 32 %a) { ; We can use the return information of the weak function non_exact_4. ; FIXME: %c2 and %c3 should be replaced but not %c0 or %c1! define i32 @exact(i32* align 8 %a, i32* align 8 %b) { -; CHECK: Function Attrs: norecurse -; CHECK-LABEL: define {{[^@]+}}@exact -; CHECK-SAME: (i32* align 8 [[A:%.*]], i32* align 8 [[B:%.*]]) #[[ATTR7:[0-9]+]] { -; CHECK-NEXT: [[C0:%.*]] = call i32 @non_exact_0() -; CHECK-NEXT: [[C1:%.*]] = call i32 @non_exact_1(i32 noundef 1) -; CHECK-NEXT: [[C2:%.*]] = call i32 @non_exact_2(i32 noundef 2) -; CHECK-NEXT: [[C3:%.*]] = call align 32 i32* @non_exact_3(i32* align 32 [[A]]) -; CHECK-NEXT: [[C4:%.*]] = call align 16 i32* @non_exact_4(i32* align 32 [[B]]) -; CHECK-NEXT: [[C3L:%.*]] = load i32, i32* [[A]], align 32 -; CHECK-NEXT: [[C4L:%.*]] = load i32, i32* [[C4]], align 16 -; CHECK-NEXT: [[ADD1:%.*]] = add i32 [[C0]], [[C1]] -; CHECK-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], 2 -; CHECK-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[C3L]] -; CHECK-NEXT: [[ADD4:%.*]] = add i32 [[ADD3]], [[C4L]] -; CHECK-NEXT: ret i32 [[ADD4]] +; IS__TUNIT____: Function Attrs: norecurse +; IS__TUNIT____-LABEL: define {{[^@]+}}@exact +; IS__TUNIT____-SAME: (i32* align 8 [[A:%.*]], i32* align 8 [[B:%.*]]) #[[ATTR8:[0-9]+]] { +; IS__TUNIT____-NEXT: [[C0:%.*]] = call i32 @non_exact_0() +; IS__TUNIT____-NEXT: [[C1:%.*]] = call i32 @non_exact_1(i32 noundef 1) +; IS__TUNIT____-NEXT: [[C2:%.*]] = call i32 @non_exact_2(i32 noundef 2) +; IS__TUNIT____-NEXT: [[C3:%.*]] = call align 32 i32* @non_exact_3(i32* align 32 [[A]]) +; IS__TUNIT____-NEXT: [[C4:%.*]] = call align 16 i32* @non_exact_4(i32* align 32 [[B]]) +; IS__TUNIT____-NEXT: [[C3L:%.*]] = load i32, i32* [[A]], align 32 +; IS__TUNIT____-NEXT: [[C4L:%.*]] = load i32, i32* [[C4]], align 16 +; IS__TUNIT____-NEXT: [[ADD1:%.*]] = add i32 [[C0]], [[C1]] +; IS__TUNIT____-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], 2 +; IS__TUNIT____-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[C3L]] +; IS__TUNIT____-NEXT: [[ADD4:%.*]] = add i32 [[ADD3]], [[C4L]] +; IS__TUNIT____-NEXT: ret i32 [[ADD4]] +; +; IS__CGSCC____: Function Attrs: norecurse +; IS__CGSCC____-LABEL: define {{[^@]+}}@exact +; IS__CGSCC____-SAME: (i32* align 8 [[A:%.*]], i32* align 8 [[B:%.*]]) #[[ATTR7:[0-9]+]] { +; IS__CGSCC____-NEXT: [[C0:%.*]] = call i32 @non_exact_0() +; IS__CGSCC____-NEXT: [[C1:%.*]] = call i32 @non_exact_1(i32 noundef 1) +; IS__CGSCC____-NEXT: [[C2:%.*]] = call i32 @non_exact_2(i32 noundef 2) +; IS__CGSCC____-NEXT: [[C3:%.*]] = call align 32 i32* @non_exact_3(i32* align 32 [[A]]) +; IS__CGSCC____-NEXT: [[C4:%.*]] = call align 16 i32* @non_exact_4(i32* align 32 [[B]]) +; IS__CGSCC____-NEXT: [[C3L:%.*]] = load i32, i32* [[A]], align 32 +; IS__CGSCC____-NEXT: [[C4L:%.*]] = load i32, i32* [[C4]], align 16 +; IS__CGSCC____-NEXT: [[ADD1:%.*]] = add i32 [[C0]], [[C1]] +; IS__CGSCC____-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], 2 +; IS__CGSCC____-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[C3L]] +; IS__CGSCC____-NEXT: [[ADD4:%.*]] = add i32 [[ADD3]], [[C4L]] +; IS__CGSCC____-NEXT: ret i32 [[ADD4]] ; %c0 = call i32 @non_exact_0() %c1 = call i32 @non_exact_1(i32 1) @@ -1377,15 +1480,16 @@ attributes #0 = { noinline nounwind uwtable } ; IS__TUNIT____: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } ; IS__TUNIT____: attributes #[[ATTR2]] = { nofree noinline norecurse nosync nounwind readnone uwtable } ; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree noinline nosync nounwind readonly uwtable } -; IS__TUNIT____: attributes #[[ATTR4]] = { noinline nounwind uwtable } -; IS__TUNIT____: attributes #[[ATTR5]] = { noinline norecurse nounwind uwtable } -; IS__TUNIT____: attributes #[[ATTR6]] = { noreturn } -; IS__TUNIT____: attributes #[[ATTR7]] = { norecurse } -; IS__TUNIT____: attributes #[[ATTR8:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR9]] = { nofree nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR10]] = { nofree nosync nounwind readonly } -; IS__TUNIT____: attributes #[[ATTR11]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR12:[0-9]+]] = { nounwind readnone } +; IS__TUNIT____: attributes #[[ATTR4]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__TUNIT____: attributes #[[ATTR5]] = { noinline nounwind uwtable } +; IS__TUNIT____: attributes #[[ATTR6]] = { noinline norecurse nounwind uwtable } +; IS__TUNIT____: attributes #[[ATTR7]] = { noreturn } +; IS__TUNIT____: attributes #[[ATTR8]] = { norecurse } +; IS__TUNIT____: attributes #[[ATTR9:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes #[[ATTR10]] = { nofree nosync nounwind readnone } +; IS__TUNIT____: attributes #[[ATTR11]] = { nofree nosync nounwind readonly } +; IS__TUNIT____: attributes #[[ATTR12]] = { nounwind } +; IS__TUNIT____: attributes #[[ATTR13:[0-9]+]] = { nounwind readnone } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } ; IS__CGSCC____: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable willreturn } @@ -1399,5 +1503,4 @@ attributes #0 = { noinline nounwind uwtable } ; IS__CGSCC____: attributes #[[ATTR9]] = { nofree nosync nounwind readnone } ; IS__CGSCC____: attributes #[[ATTR10]] = { nofree nosync nounwind readonly } ; IS__CGSCC____: attributes #[[ATTR11]] = { nounwind } -; IS__CGSCC____: attributes #[[ATTR12:[0-9]+]] = { nounwind readnone } ;. diff --git a/llvm/test/Transforms/Attributor/value-simplify-gpu.ll b/llvm/test/Transforms/Attributor/value-simplify-gpu.ll index 66c41ba598ca9..0ed49765575ad 100644 --- a/llvm/test/Transforms/Attributor/value-simplify-gpu.ll +++ b/llvm/test/Transforms/Attributor/value-simplify-gpu.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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=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/value-simplify-instances.ll b/llvm/test/Transforms/Attributor/value-simplify-instances.ll index a7c072c985315..16d1bb7d1ecb0 100644 --- a/llvm/test/Transforms/Attributor/value-simplify-instances.ll +++ b/llvm/test/Transforms/Attributor/value-simplify-instances.ll @@ -26,16 +26,16 @@ define internal i1 @recursive_inst_comparator(i1* %a, i1* %b) { } define internal i1 @recursive_inst_generator(i1 %c, i1* %p) { -; IS________OPM-LABEL: define {{[^@]+}}@recursive_inst_generator -; IS________OPM-SAME: (i1 [[C:%.*]], i1* nofree [[P:%.*]]) { -; IS________OPM-NEXT: [[A:%.*]] = call i1* @geti1Ptr() -; IS________OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS________OPM: t: -; IS________OPM-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[P]]) #[[ATTR6:[0-9]+]] -; IS________OPM-NEXT: ret i1 [[R1]] -; IS________OPM: f: -; IS________OPM-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, i1* nofree [[A]]) -; IS________OPM-NEXT: ret i1 [[R2]] +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@recursive_inst_generator +; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]], i1* nofree [[P:%.*]]) { +; IS__TUNIT_OPM-NEXT: [[A:%.*]] = call i1* @geti1Ptr() +; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__TUNIT_OPM: t: +; IS__TUNIT_OPM-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[P]]) #[[ATTR6:[0-9]+]] +; IS__TUNIT_OPM-NEXT: ret i1 [[R1]] +; IS__TUNIT_OPM: f: +; IS__TUNIT_OPM-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, i1* nofree [[A]]) +; IS__TUNIT_OPM-NEXT: ret i1 [[R2]] ; ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@recursive_inst_generator ; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]], i1* nofree [[P:%.*]]) { @@ -48,12 +48,23 @@ define internal i1 @recursive_inst_generator(i1 %c, i1* %p) { ; IS__TUNIT_NPM-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, i1* nofree [[A]]) ; IS__TUNIT_NPM-NEXT: ret i1 [[R2]] ; +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@recursive_inst_generator +; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i1* nofree [[P:%.*]]) { +; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i1* @geti1Ptr() +; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; IS__CGSCC_OPM: t: +; IS__CGSCC_OPM-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[P]]) +; IS__CGSCC_OPM-NEXT: ret i1 [[R1]] +; IS__CGSCC_OPM: f: +; IS__CGSCC_OPM-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, i1* nofree [[A]]) +; IS__CGSCC_OPM-NEXT: ret i1 [[R2]] +; ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_inst_generator ; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) { ; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i1* @geti1Ptr() ; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; IS__CGSCC_NPM: t: -; IS__CGSCC_NPM-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[A]]) #[[ATTR6:[0-9]+]] +; IS__CGSCC_NPM-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[A]]) ; IS__CGSCC_NPM-NEXT: ret i1 [[R1]] ; IS__CGSCC_NPM: f: ; IS__CGSCC_NPM-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true) diff --git a/llvm/test/Transforms/Attributor/willreturn.ll b/llvm/test/Transforms/Attributor/willreturn.ll index 3746ac2e5a103..9b56703de9617 100644 --- a/llvm/test/Transforms/Attributor/willreturn.ll +++ b/llvm/test/Transforms/Attributor/willreturn.ll @@ -317,9 +317,9 @@ define void @conditional_exit(i32 %0, i32* nocapture readonly %1) local_unnamed_ declare float @llvm.floor.f32(float) define void @call_floor(float %a) #0 { -; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; CHECK-LABEL: define {{[^@]+}}@call_floor -; CHECK-SAME: (float [[A:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (float [[A:%.*]]) #[[ATTR9:[0-9]+]] { ; CHECK-NEXT: ret void ; tail call float @llvm.floor.f32(float %a) @@ -329,13 +329,13 @@ define void @call_floor(float %a) #0 { define float @call_floor2(float %a) #0 { ; IS________OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; IS________OPM-LABEL: define {{[^@]+}}@call_floor2 -; IS________OPM-SAME: (float [[A:%.*]]) #[[ATTR9:[0-9]+]] { +; IS________OPM-SAME: (float [[A:%.*]]) #[[ATTR9]] { ; IS________OPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR27:[0-9]+]] ; IS________OPM-NEXT: ret float [[C]] ; ; IS________NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; IS________NPM-LABEL: define {{[^@]+}}@call_floor2 -; IS________NPM-SAME: (float [[A:%.*]]) #[[ATTR9:[0-9]+]] { +; IS________NPM-SAME: (float [[A:%.*]]) #[[ATTR9]] { ; IS________NPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR29:[0-9]+]] ; IS________NPM-NEXT: ret float [[C]] ; diff --git a/llvm/test/Transforms/OpenMP/remove_globalization.ll b/llvm/test/Transforms/OpenMP/remove_globalization.ll index bc9ede6292ab3..c42e6430254b9 100644 --- a/llvm/test/Transforms/OpenMP/remove_globalization.ll +++ b/llvm/test/Transforms/OpenMP/remove_globalization.ll @@ -30,18 +30,18 @@ define void @kernel() { ; CHECK-LABEL: define {{[^@]+}}@kernel() { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(%struct.ident_t* nonnull null, i8 1, i1 false, i1 true) -; CHECK-NEXT: call void @foo() #[[ATTR3:[0-9]+]] -; CHECK-NEXT: call void @bar() #[[ATTR3]] -; CHECK-NEXT: call void @unknown_no_openmp() #[[ATTR2:[0-9]+]] +; CHECK-NEXT: call void @foo() #[[ATTR4:[0-9]+]] +; CHECK-NEXT: call void @bar() #[[ATTR4]] +; CHECK-NEXT: call void @unknown_no_openmp() #[[ATTR3:[0-9]+]] ; CHECK-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* nonnull null, i8 1, i1 true) ; CHECK-NEXT: ret void ; ; CHECK-DISABLED-LABEL: define {{[^@]+}}@kernel() { ; CHECK-DISABLED-NEXT: entry: ; CHECK-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(%struct.ident_t* nonnull null, i8 1, i1 false, i1 true) -; CHECK-DISABLED-NEXT: call void @foo() #[[ATTR3:[0-9]+]] -; CHECK-DISABLED-NEXT: call void @bar() #[[ATTR3]] -; CHECK-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR2:[0-9]+]] +; CHECK-DISABLED-NEXT: call void @foo() #[[ATTR4:[0-9]+]] +; CHECK-DISABLED-NEXT: call void @bar() #[[ATTR4]] +; CHECK-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR3:[0-9]+]] ; CHECK-DISABLED-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* nonnull null, i8 1, i1 true) ; CHECK-DISABLED-NEXT: ret void ; @@ -78,17 +78,17 @@ define internal void @bar() { ; CHECK-LABEL: define {{[^@]+}}@bar ; CHECK-SAME: () #[[ATTR0]] { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[TMP0:%.*]] = call i8* @__kmpc_alloc_shared(i64 noundef 4) #[[ATTR3]], !dbg [[DBG8:![0-9]+]] -; CHECK-NEXT: call void @share(i8* nofree writeonly [[TMP0]]) #[[ATTR4:[0-9]+]] -; CHECK-NEXT: call void @__kmpc_free_shared(i8* [[TMP0]], i64 noundef 4) #[[ATTR3]] +; CHECK-NEXT: [[TMP0:%.*]] = call i8* @__kmpc_alloc_shared(i64 noundef 4) #[[ATTR4]], !dbg [[DBG8:![0-9]+]] +; CHECK-NEXT: call void @share(i8* nofree writeonly [[TMP0]]) #[[ATTR5:[0-9]+]] +; CHECK-NEXT: call void @__kmpc_free_shared(i8* [[TMP0]], i64 noundef 4) #[[ATTR4]] ; CHECK-NEXT: ret void ; ; CHECK-DISABLED-LABEL: define {{[^@]+}}@bar ; CHECK-DISABLED-SAME: () #[[ATTR0]] { ; CHECK-DISABLED-NEXT: entry: -; CHECK-DISABLED-NEXT: [[TMP0:%.*]] = call i8* @__kmpc_alloc_shared(i64 noundef 4) #[[ATTR3]], !dbg [[DBG8:![0-9]+]] -; CHECK-DISABLED-NEXT: call void @share(i8* nofree writeonly [[TMP0]]) #[[ATTR4:[0-9]+]] -; CHECK-DISABLED-NEXT: call void @__kmpc_free_shared(i8* [[TMP0]], i64 noundef 4) #[[ATTR3]] +; CHECK-DISABLED-NEXT: [[TMP0:%.*]] = call i8* @__kmpc_alloc_shared(i64 noundef 4) #[[ATTR4]], !dbg [[DBG8:![0-9]+]] +; CHECK-DISABLED-NEXT: call void @share(i8* nofree writeonly [[TMP0]]) #[[ATTR5:[0-9]+]] +; CHECK-DISABLED-NEXT: call void @__kmpc_free_shared(i8* [[TMP0]], i64 noundef 4) #[[ATTR4]] ; CHECK-DISABLED-NEXT: ret void ; entry: @@ -99,19 +99,29 @@ entry: } define internal void @use(i8* %x) { +; CHECK-LABEL: define {{[^@]+}}@use +; CHECK-SAME: (i8* noalias nocapture nofree readnone [[X:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: ret void +; +; CHECK-DISABLED-LABEL: define {{[^@]+}}@use +; CHECK-DISABLED-SAME: (i8* noalias nocapture nofree readnone [[X:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-DISABLED-NEXT: entry: +; CHECK-DISABLED-NEXT: ret void +; entry: ret void } define internal void @share(i8* %x) { ; CHECK-LABEL: define {{[^@]+}}@share -; CHECK-SAME: (i8* nofree writeonly [[X:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-SAME: (i8* nofree writeonly [[X:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: store i8* [[X]], i8** @S, align 8 ; CHECK-NEXT: ret void ; ; CHECK-DISABLED-LABEL: define {{[^@]+}}@share -; CHECK-DISABLED-SAME: (i8* nofree writeonly [[X:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-DISABLED-SAME: (i8* nofree writeonly [[X:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-DISABLED-NEXT: entry: ; CHECK-DISABLED-NEXT: store i8* [[X]], i8** @S, align 8 ; CHECK-DISABLED-NEXT: ret void @@ -125,12 +135,14 @@ define void @unused() { ; CHECK-LABEL: define {{[^@]+}}@unused() { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 +; CHECK-NEXT: call void @use(i8* noalias readnone undef) ; CHECK-NEXT: ret void ; ; CHECK-DISABLED-LABEL: define {{[^@]+}}@unused() { ; CHECK-DISABLED-NEXT: entry: -; CHECK-DISABLED-NEXT: [[TMP0:%.*]] = call i8* @__kmpc_alloc_shared(i64 4) #[[ATTR3]], !dbg [[DBG11:![0-9]+]] -; CHECK-DISABLED-NEXT: call void @__kmpc_free_shared(i8* [[TMP0]], i64 4) #[[ATTR3]] +; CHECK-DISABLED-NEXT: [[TMP0:%.*]] = call i8* @__kmpc_alloc_shared(i64 4), !dbg [[DBG11:![0-9]+]] +; CHECK-DISABLED-NEXT: call void @use(i8* noalias readnone [[TMP0]]) +; CHECK-DISABLED-NEXT: call void @__kmpc_free_shared(i8* [[TMP0]], i64 4) ; CHECK-DISABLED-NEXT: ret void ; entry: @@ -169,16 +181,18 @@ declare void @unknown_no_openmp() "llvm.assume"="omp_no_openmp" !14 = !DILocation(line: 6, column: 2, scope: !9) ;. ; CHECK: attributes #[[ATTR0]] = { nosync nounwind } -; CHECK: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind willreturn writeonly } -; CHECK: attributes #[[ATTR2]] = { "llvm.assume"="omp_no_openmp" } -; CHECK: attributes #[[ATTR3]] = { nounwind } -; CHECK: attributes #[[ATTR4]] = { nosync nounwind writeonly } +; CHECK: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind willreturn writeonly } +; CHECK: attributes #[[ATTR3]] = { "llvm.assume"="omp_no_openmp" } +; CHECK: attributes #[[ATTR4]] = { nounwind } +; CHECK: attributes #[[ATTR5]] = { nosync nounwind writeonly } ;. ; CHECK-DISABLED: attributes #[[ATTR0]] = { nosync nounwind } -; CHECK-DISABLED: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind willreturn writeonly } -; CHECK-DISABLED: attributes #[[ATTR2]] = { "llvm.assume"="omp_no_openmp" } -; CHECK-DISABLED: attributes #[[ATTR3]] = { nounwind } -; CHECK-DISABLED: attributes #[[ATTR4]] = { nosync nounwind writeonly } +; CHECK-DISABLED: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CHECK-DISABLED: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind willreturn writeonly } +; CHECK-DISABLED: attributes #[[ATTR3]] = { "llvm.assume"="omp_no_openmp" } +; CHECK-DISABLED: attributes #[[ATTR4]] = { nounwind } +; CHECK-DISABLED: attributes #[[ATTR5]] = { nosync nounwind writeonly } ;. ; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 13.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) ; CHECK: [[META1:![0-9]+]] = !DIFile(filename: "remove_globalization.c", directory: "/tmp/remove_globalization.c")