diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll @@ -1,41 +1,26 @@ ; 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-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM define internal i32 @deref(i32* %x) nounwind { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@deref -; IS__TUNIT_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[X]], align 4 -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP2]] ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@deref -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[X_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[X_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP2]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@deref -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[X]], align 4 -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP2]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@deref -; IS__CGSCC_NPM-SAME: (i32 returned [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[X_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[X_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP0]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@deref +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[X_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[X_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP2]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@deref +; NOT_TUNIT_NPM-SAME: (i32 returned [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[X_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[X_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP0]] ; entry: %tmp2 = load i32, i32* %x, align 4 @@ -43,41 +28,24 @@ } define i32 @f(i32 %x) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@f -; IS__TUNIT_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 -; IS__TUNIT_OPM-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = call i32 @deref(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X_ADDR]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP1]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f -; IS__TUNIT_NPM-SAME: (i32 [[X:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[X_ADDR]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i32 @deref(i32 [[TMP0]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP1]] ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = call i32 @deref(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X_ADDR]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP1]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_NPM-SAME: (i32 returned [[X:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 -; IS__CGSCC_NPM-NEXT: ret i32 [[X]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f +; NOT_CGSCC_NPM-SAME: (i32 [[X:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[X_ADDR]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i32 @deref(i32 [[TMP0]]) #[[ATTR2:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP1]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f +; NOT_TUNIT_NPM-SAME: (i32 returned [[X:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 [[X]] ; entry: %x_addr = alloca i32 @@ -86,13 +54,9 @@ ret i32 %tmp1 } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind readonly willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readonly willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-07-02-array-indexing.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-07-02-array-indexing.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-07-02-array-indexing.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-07-02-array-indexing.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ; PR2498 @@ -9,31 +7,31 @@ ; because there is a load of %A in the entry block define internal i32 @callee(i1 %C, i32* %A) { ; -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@callee -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[A_0:%.*]] = load i32, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: br label [[F:%.*]] -; IS__TUNIT____: T: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: F: -; IS__TUNIT____-NEXT: [[A_2:%.*]] = getelementptr i32, i32* [[A]], i32 2 -; IS__TUNIT____-NEXT: [[R:%.*]] = load i32, i32* [[A_2]], align 4 -; IS__TUNIT____-NEXT: ret i32 [[R]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callee +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[A_0:%.*]] = load i32, i32* [[A]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[F:%.*]] +; NOT_CGSCC_NPM: T: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: F: +; NOT_CGSCC_NPM-NEXT: [[A_2:%.*]] = getelementptr i32, i32* [[A]], i32 2 +; NOT_CGSCC_NPM-NEXT: [[R:%.*]] = load i32, i32* [[A_2]], align 4 +; NOT_CGSCC_NPM-NEXT: ret i32 [[R]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@callee -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[A_0:%.*]] = load i32, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: br label [[F:%.*]] -; IS__CGSCC____: T: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: F: -; IS__CGSCC____-NEXT: [[A_2:%.*]] = getelementptr i32, i32* [[A]], i32 2 -; IS__CGSCC____-NEXT: [[R:%.*]] = load i32, i32* [[A_2]], align 4 -; IS__CGSCC____-NEXT: ret i32 [[R]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callee +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[A_0:%.*]] = load i32, i32* [[A]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[F:%.*]] +; NOT_TUNIT_NPM: T: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: F: +; NOT_TUNIT_NPM-NEXT: [[A_2:%.*]] = getelementptr i32, i32* [[A]], i32 2 +; NOT_TUNIT_NPM-NEXT: [[R:%.*]] = load i32, i32* [[A_2]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 [[R]] ; entry: ; Unconditonally load the element at %A @@ -51,26 +49,26 @@ } define i32 @foo(i32* %A) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (i32* nocapture nofree readonly [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[X:%.*]] = call i32 @callee(i32* nocapture nofree readonly align 4 [[A]]) #[[ATTR1:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 [[X]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readonly [[A:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = call i32 @callee(i32* nocapture nofree readonly align 4 [[A]]) #[[ATTR1:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[X]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[X:%.*]] = call i32 @callee(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]]) #[[ATTR1:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 [[X]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = call i32 @callee(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]]) #[[ATTR1:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[X]] ; %X = call i32 @callee(i1 false, i32* %A) ; [#uses=1] ret i32 %X } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readonly willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nosync nounwind readonly willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-07-CGUpdate.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-07-CGUpdate.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-07-CGUpdate.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-07-CGUpdate.ll @@ -1,39 +1,37 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM define internal fastcc i32 @hash(i32* %ts, i32 %mod) nounwind { -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@hash -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@hash +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: unreachable } define void @encode(i32* %m, i32* %ts, i32* %new) nounwind { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@encode -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[M:%.*]], i32* nocapture nofree readnone [[TS:%.*]], i32* nocapture nofree readnone [[NEW:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@encode +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[M:%.*]], i32* nocapture nofree readnone [[TS:%.*]], i32* nocapture nofree readnone [[NEW:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@encode -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[M:%.*]], i32* nocapture nofree readnone [[TS:%.*]], i32* nocapture nofree readnone [[NEW:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@encode +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree readnone [[M:%.*]], i32* nocapture nofree readnone [[TS:%.*]], i32* nocapture nofree readnone [[NEW:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: %0 = call fastcc i32 @hash( i32* %ts, i32 0 ) nounwind ; [#uses=0] unreachable } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll @@ -1,19 +1,17 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM define internal fastcc i32 @term_SharingList(i32* %Term, i32* %List) nounwind { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@term_SharingList -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br i1 false, label [[BB:%.*]], label [[BB5:%.*]] -; IS__CGSCC____: bb: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: bb5: -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@term_SharingList +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br i1 false, label [[BB:%.*]], label [[BB5:%.*]] +; NOT_TUNIT_NPM: bb: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: bb5: +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; entry: br i1 false, label %bb, label %bb5 @@ -27,25 +25,25 @@ } define i32 @term_Sharing(i32* %Term) nounwind { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@term_Sharing -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[TERM:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br i1 false, label [[BB_I:%.*]], label [[BB14:%.*]] -; IS__TUNIT____: bb.i: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: bb14: -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@term_Sharing +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[TERM:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br i1 false, label [[BB_I:%.*]], label [[BB14:%.*]] +; NOT_CGSCC_NPM: bb.i: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: bb14: +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@term_Sharing -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[TERM:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br i1 false, label [[BB_I:%.*]], label [[BB14:%.*]] -; IS__CGSCC____: bb.i: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: bb14: -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@term_Sharing +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree readnone [[TERM:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br i1 false, label [[BB_I:%.*]], label [[BB14:%.*]] +; NOT_TUNIT_NPM: bb.i: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: bb14: +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; entry: br i1 false, label %bb.i, label %bb14 @@ -58,7 +56,7 @@ ret i32 0 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ; Test that we only promote arguments when the caller/callee have compatible ; function attrubtes. @@ -9,21 +7,14 @@ target triple = "x86_64-unknown-linux-gnu" define internal fastcc void @no_promote_avx2(<4 x i64>* %arg, <4 x i64>* readonly %arg1) #0 { -; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS________OPM-LABEL: define {{[^@]+}}@no_promote_avx2 -; IS________OPM-SAME: (<4 x i64>* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[ARG:%.*]], <4 x i64>* nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[ARG1:%.*]]) #[[ATTR0:[0-9]+]] { -; IS________OPM-NEXT: bb: -; IS________OPM-NEXT: [[TMP:%.*]] = load <4 x i64>, <4 x i64>* [[ARG1]], align 32 -; IS________OPM-NEXT: store <4 x i64> [[TMP]], <4 x i64>* [[ARG]], align 32 -; IS________OPM-NEXT: ret void ; -; IS________NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS________NPM-LABEL: define {{[^@]+}}@no_promote_avx2 -; IS________NPM-SAME: (<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[ARG:%.*]], <4 x i64>* noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[ARG1:%.*]]) #[[ATTR0:[0-9]+]] { -; IS________NPM-NEXT: bb: -; IS________NPM-NEXT: [[TMP:%.*]] = load <4 x i64>, <4 x i64>* [[ARG1]], align 32 -; IS________NPM-NEXT: store <4 x i64> [[TMP]], <4 x i64>* [[ARG]], align 32 -; IS________NPM-NEXT: ret void +; CHECK: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@no_promote_avx2 +; CHECK-SAME: (<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[ARG:%.*]], <4 x i64>* noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[ARG1:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: bb: +; CHECK-NEXT: [[TMP:%.*]] = load <4 x i64>, <4 x i64>* [[ARG1]], align 32 +; CHECK-NEXT: store <4 x i64> [[TMP]], <4 x i64>* [[ARG]], align 32 +; CHECK-NEXT: ret void ; bb: %tmp = load <4 x i64>, <4 x i64>* %arg1 @@ -32,57 +23,32 @@ } define void @no_promote(<4 x i64>* %arg) #1 { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@no_promote -; IS__TUNIT_OPM-SAME: (<4 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: bb: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3:[0-9]+]] -; IS__TUNIT_OPM-NEXT: call fastcc void @no_promote_avx2(<4 x i64>* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64>* nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) #[[ATTR4:[0-9]+]] -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 -; IS__TUNIT_OPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 -; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@no_promote -; IS__TUNIT_NPM-SAME: (<4 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3:[0-9]+]] -; IS__TUNIT_NPM-NEXT: call fastcc void @no_promote_avx2(<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64>* noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) #[[ATTR4:[0-9]+]] -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 -; IS__TUNIT_NPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 -; IS__TUNIT_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@no_promote +; NOT_CGSCC_NPM-SAME: (<4 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: call fastcc void @no_promote_avx2(<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64>* noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) #[[ATTR4:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 +; NOT_CGSCC_NPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@no_promote -; IS__CGSCC_OPM-SAME: (<4 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3:[0-9]+]] -; IS__CGSCC_OPM-NEXT: call fastcc void @no_promote_avx2(<4 x i64>* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64>* nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) #[[ATTR4:[0-9]+]] -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 -; IS__CGSCC_OPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@no_promote -; IS__CGSCC_NPM-SAME: (<4 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3:[0-9]+]] -; IS__CGSCC_NPM-NEXT: call fastcc void @no_promote_avx2(<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64>* noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) #[[ATTR4:[0-9]+]] -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 -; IS__CGSCC_NPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 -; IS__CGSCC_NPM-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@no_promote +; NOT_TUNIT_NPM-SAME: (<4 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: call fastcc void @no_promote_avx2(<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64>* noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) #[[ATTR4:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 +; NOT_TUNIT_NPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = alloca <4 x i64>, align 32 @@ -96,33 +62,26 @@ } define internal fastcc void @promote_avx2(<4 x i64>* %arg, <4 x i64>* readonly %arg1) #0 { -; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS________OPM-LABEL: define {{[^@]+}}@promote_avx2 -; IS________OPM-SAME: (<4 x i64>* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[ARG:%.*]], <4 x i64>* nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[ARG1:%.*]]) #[[ATTR0]] { -; IS________OPM-NEXT: bb: -; IS________OPM-NEXT: [[TMP:%.*]] = load <4 x i64>, <4 x i64>* [[ARG1]], align 32 -; IS________OPM-NEXT: store <4 x i64> [[TMP]], <4 x i64>* [[ARG]], align 32 -; IS________OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@promote_avx2 -; IS__TUNIT_NPM-SAME: (<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[ARG:%.*]], <4 x i64> [[TMP0:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <4 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: store <4 x i64> [[TMP0]], <4 x i64>* [[ARG1_PRIV]], align 32 -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = load <4 x i64>, <4 x i64>* [[ARG1_PRIV]], align 32 -; IS__TUNIT_NPM-NEXT: store <4 x i64> [[TMP]], <4 x i64>* [[ARG]], align 32 -; IS__TUNIT_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@promote_avx2 +; NOT_CGSCC_NPM-SAME: (<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[ARG:%.*]], <4 x i64> [[TMP0:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <4 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: store <4 x i64> [[TMP0]], <4 x i64>* [[ARG1_PRIV]], align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = load <4 x i64>, <4 x i64>* [[ARG1_PRIV]], align 32 +; NOT_CGSCC_NPM-NEXT: store <4 x i64> [[TMP]], <4 x i64>* [[ARG]], align 32 +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@promote_avx2 -; IS__CGSCC_NPM-SAME: (<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[ARG:%.*]], <4 x i64> [[TMP0:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <4 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: store <4 x i64> [[TMP0]], <4 x i64>* [[ARG1_PRIV]], align 32 -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = load <4 x i64>, <4 x i64>* [[ARG1_PRIV]], align 32 -; IS__CGSCC_NPM-NEXT: store <4 x i64> [[TMP0]], <4 x i64>* [[ARG]], align 32 -; IS__CGSCC_NPM-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@promote_avx2 +; NOT_TUNIT_NPM-SAME: (<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[ARG:%.*]], <4 x i64> [[TMP0:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <4 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: store <4 x i64> [[TMP0]], <4 x i64>* [[ARG1_PRIV]], align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = load <4 x i64>, <4 x i64>* [[ARG1_PRIV]], align 32 +; NOT_TUNIT_NPM-NEXT: store <4 x i64> [[TMP0]], <4 x i64>* [[ARG]], align 32 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = load <4 x i64>, <4 x i64>* %arg1 @@ -131,59 +90,34 @@ } define void @promote(<4 x i64>* %arg) #0 { -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@promote -; IS__TUNIT_OPM-SAME: (<4 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: bb: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3]] -; IS__TUNIT_OPM-NEXT: call fastcc void @promote_avx2(<4 x i64>* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64>* nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) #[[ATTR4]] -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 -; IS__TUNIT_OPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@promote -; IS__TUNIT_NPM-SAME: (<4 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3]] -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <4 x i64>, <4 x i64>* [[TMP]], align 32 -; IS__TUNIT_NPM-NEXT: call fastcc void @promote_avx2(<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64> [[TMP0]]) #[[ATTR4]] -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 -; IS__TUNIT_NPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 -; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@promote -; IS__CGSCC_OPM-SAME: (<4 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3]] -; IS__CGSCC_OPM-NEXT: call fastcc void @promote_avx2(<4 x i64>* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64>* nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 -; IS__CGSCC_OPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 -; IS__CGSCC_OPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@promote +; NOT_CGSCC_NPM-SAME: (<4 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3]] +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <4 x i64>, <4 x i64>* [[TMP]], align 32 +; NOT_CGSCC_NPM-NEXT: call fastcc void @promote_avx2(<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64> [[TMP0]]) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 +; NOT_CGSCC_NPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@promote -; IS__CGSCC_NPM-SAME: (<4 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3]] -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <4 x i64>, <4 x i64>* [[TMP]], align 32 -; IS__CGSCC_NPM-NEXT: call fastcc void @promote_avx2(<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64> [[TMP0]]) #[[ATTR4]] -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 -; IS__CGSCC_NPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 -; IS__CGSCC_NPM-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@promote +; NOT_TUNIT_NPM-SAME: (<4 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <4 x i64>, <4 x i64>* [[TMP]], align 32 +; NOT_TUNIT_NPM-NEXT: call fastcc void @promote_avx2(<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64> [[TMP0]]) #[[ATTR4]] +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 +; NOT_TUNIT_NPM-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = alloca <4 x i64>, align 32 @@ -203,15 +137,15 @@ attributes #1 = { nounwind uwtable } attributes #2 = { argmemonly nounwind } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "target-features"="+avx2" } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree nosync nounwind uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR3:[0-9]+]] = { willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "target-features"="+avx2" } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "target-features"="+avx2" } -; IS__CGSCC____: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree nosync nounwind uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR2:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR3:[0-9]+]] = { willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR4:[0-9]+]] = { nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "target-features"="+avx2" } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { nounwind willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ; Test that we only promote arguments when the caller/callee have compatible ; function attrubtes. @@ -11,33 +9,26 @@ ; This should promote define internal fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #0 { ; -; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS________OPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512 -; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR0:[0-9]+]] { -; IS________OPM-NEXT: bb: -; IS________OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512 -; IS__TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512 -; IS__CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512 +; NOT_CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512 +; NOT_TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -47,59 +38,34 @@ define void @avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* %arg) #0 { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer512 -; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: bb: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6:[0-9]+]] -; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7:[0-9]+]] -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer512 -; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6:[0-9]+]] -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7:[0-9]+]] -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer512 -; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6:[0-9]+]] -; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7:[0-9]+]] -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer512 -; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6:[0-9]+]] -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7:[0-9]+]] -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer512 +; NOT_CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; NOT_CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer512 +; NOT_TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; NOT_TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = alloca <8 x i64>, align 32 @@ -115,33 +81,26 @@ ; This should promote define internal fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #1 { ; -; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS________OPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256 -; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR1:[0-9]+]] { -; IS________OPM-NEXT: bb: -; IS________OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256 -; IS__TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256 -; IS__CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256 +; NOT_CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256 +; NOT_TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -151,59 +110,34 @@ define void @avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* %arg) #1 { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer256 -; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: bb: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer256 -; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer256 -; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer256 -; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer256 +; NOT_CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; NOT_CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer256 +; NOT_TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; NOT_TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = alloca <8 x i64>, align 32 @@ -219,33 +153,26 @@ ; This should promote define internal fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #1 { ; -; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS________OPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256 -; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR1]] { -; IS________OPM-NEXT: bb: -; IS________OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256 -; IS__TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256 -; IS__CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256 +; NOT_CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256 +; NOT_TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -255,59 +182,34 @@ define void @avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* %arg) #0 { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer256 -; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: bb: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer256 -; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer256 -; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer256 -; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer256 +; NOT_CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; NOT_CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer256 +; NOT_TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; NOT_TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = alloca <8 x i64>, align 32 @@ -323,33 +225,26 @@ ; This should promote define internal fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #0 { ; -; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS________OPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512 -; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR0]] { -; IS________OPM-NEXT: bb: -; IS________OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512 -; IS__TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512 -; IS__CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512 +; NOT_CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512 +; NOT_TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -359,59 +254,34 @@ define void @avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* %arg) #1 { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer512 -; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: bb: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer512 -; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer512 -; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer512 -; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer512 +; NOT_CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; NOT_CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer512 +; NOT_TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; NOT_TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = alloca <8 x i64>, align 32 @@ -427,21 +297,14 @@ ; This should not promote define internal fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #1 { ; -; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS________OPM-LABEL: define {{[^@]+}}@callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256 -; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR1]] { -; IS________OPM-NEXT: bb: -; IS________OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________OPM-NEXT: ret void -; -; IS________NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS________NPM-LABEL: define {{[^@]+}}@callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256 -; IS________NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR1:[0-9]+]] { -; IS________NPM-NEXT: bb: -; IS________NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________NPM-NEXT: ret void +; +; CHECK: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256 +; CHECK-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: bb: +; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; CHECK-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; CHECK-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -451,57 +314,32 @@ define void @avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* %arg) #2 { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@avx512_legal256_prefer256_call_avx512_legal512_prefer256 -; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: bb: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal256_prefer256_call_avx512_legal512_prefer256 -; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@avx512_legal256_prefer256_call_avx512_legal512_prefer256 -; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal256_prefer256_call_avx512_legal512_prefer256 -; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal256_prefer256_call_avx512_legal512_prefer256 +; NOT_CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal256_prefer256_call_avx512_legal512_prefer256 +; NOT_TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; NOT_TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = alloca <8 x i64>, align 32 @@ -517,21 +355,14 @@ ; This should not promote define internal fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #2 { ; -; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS________OPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256 -; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR2:[0-9]+]] { -; IS________OPM-NEXT: bb: -; IS________OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________OPM-NEXT: ret void -; -; IS________NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS________NPM-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256 -; IS________NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR2:[0-9]+]] { -; IS________NPM-NEXT: bb: -; IS________NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________NPM-NEXT: ret void +; +; CHECK: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256 +; CHECK-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-NEXT: bb: +; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 +; CHECK-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; CHECK-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -541,57 +372,32 @@ define void @avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* %arg) #1 { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal256_prefer256 -; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: bb: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal256_prefer256 -; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal256_prefer256 -; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal256_prefer256 -; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal256_prefer256 +; NOT_CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal256_prefer256 +; NOT_TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; NOT_TUNIT_NPM-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = alloca <8 x i64>, align 32 @@ -607,33 +413,26 @@ ; This should promote define internal fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #3 { ; -; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS________OPM-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256 -; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR3:[0-9]+]] { -; IS________OPM-NEXT: bb: -; IS________OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256 -; IS__TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256 -; IS__CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256 +; NOT_CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256 +; NOT_TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -643,59 +442,34 @@ define void @avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* %arg) #4 { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@avx2_legal256_prefer256_call_avx2_legal512_prefer256 -; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: bb: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@avx2_legal256_prefer256_call_avx2_legal512_prefer256 -; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@avx2_legal256_prefer256_call_avx2_legal512_prefer256 -; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@avx2_legal256_prefer256_call_avx2_legal512_prefer256 -; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@avx2_legal256_prefer256_call_avx2_legal512_prefer256 +; NOT_CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; NOT_CGSCC_NPM-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@avx2_legal256_prefer256_call_avx2_legal512_prefer256 +; NOT_TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; NOT_TUNIT_NPM-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = alloca <8 x i64>, align 32 @@ -711,33 +485,26 @@ ; This should promote define internal fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #4 { ; -; IS________OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS________OPM-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256 -; IS________OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR4:[0-9]+]] { -; IS________OPM-NEXT: bb: -; IS________OPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64 -; IS________OPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS________OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256 -; IS__TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256 -; IS__CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR4]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256 +; NOT_CGSCC_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256 +; NOT_TUNIT_NPM-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -747,59 +514,34 @@ define void @avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* %arg) #3 { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@avx2_legal512_prefer256_call_avx2_legal256_prefer256 -; IS__TUNIT_OPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: bb: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__TUNIT_OPM-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__TUNIT_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@avx2_legal512_prefer256_call_avx2_legal256_prefer256 -; IS__TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3]] { -; IS__TUNIT_NPM-NEXT: bb: -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__TUNIT_NPM-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@avx2_legal512_prefer256_call_avx2_legal256_prefer256 -; IS__CGSCC_OPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR3]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__CGSCC_OPM-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__CGSCC_OPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@avx2_legal512_prefer256_call_avx2_legal256_prefer256 -; IS__CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR3]] { -; IS__CGSCC_NPM-NEXT: bb: -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 -; IS__CGSCC_NPM-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 -; IS__CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@avx2_legal512_prefer256_call_avx2_legal256_prefer256 +; NOT_CGSCC_NPM-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; NOT_CGSCC_NPM-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; NOT_CGSCC_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@avx2_legal512_prefer256_call_avx2_legal256_prefer256 +; NOT_TUNIT_NPM-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR6]] +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; NOT_TUNIT_NPM-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; NOT_TUNIT_NPM-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = alloca <8 x i64>, align 32 @@ -822,21 +564,21 @@ attributes #4 = { inlinehint norecurse nounwind uwtable "target-features"="+avx2" "min-legal-vector-width"="256" "prefer-vector-width"="256" } attributes #5 = { argmemonly nounwind } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="512" "target-features"="+avx512vl" } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } -; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } -; IS__TUNIT____: attributes #[[ATTR3:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } -; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx2" } -; IS__TUNIT____: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR6:[0-9]+]] = { willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR7:[0-9]+]] = { nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="512" "target-features"="+avx512vl" } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx2" } +; NOT_CGSCC_NPM: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="512" "target-features"="+avx512vl" } -; IS__CGSCC____: attributes #[[ATTR1:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } -; IS__CGSCC____: attributes #[[ATTR2:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } -; IS__CGSCC____: attributes #[[ATTR3:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } -; IS__CGSCC____: attributes #[[ATTR4:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx2" } -; IS__CGSCC____: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR6:[0-9]+]] = { willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR7:[0-9]+]] = { nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="512" "target-features"="+avx512vl" } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx2" } +; NOT_TUNIT_NPM: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR6]] = { willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR7]] = { nounwind willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll @@ -4,9 +4,7 @@ ; we don't do that anymore. It also verifies that the combination of ; globalopt and argpromotion is able to optimize the call safely. ; -; 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-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/aggregate-promote.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/aggregate-promote.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/aggregate-promote.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/aggregate-promote.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 %T = type { i32, i32, i32, i32 } @@ -11,11 +9,11 @@ ; CHECK: @[[G:[a-zA-Z0-9_$"\\.-]+]] = constant [[T:%.*]] { i32 0, i32 0, i32 17, i32 25 } ;. define internal i32 @test(%T* %p) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; entry: %a.gep = getelementptr %T, %T* %p, i64 0, i32 3 @@ -27,24 +25,24 @@ } define i32 @caller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 42 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32 42 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 42 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 42 ; entry: %v = call i32 @test(%T* @G) ret i32 %v } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll @@ -1,27 +1,20 @@ ; 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=14 -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=14 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM define void @f() { -; IS________OPM-LABEL: define {{[^@]+}}@f() { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[A:%.*]] = alloca i32, align 1 -; IS________OPM-NEXT: call void @g(i32* noalias nocapture nofree noundef nonnull readonly dereferenceable(4) [[A]]) -; IS________OPM-NEXT: ret void ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f() { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[A:%.*]] = alloca i32, align 1 -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 1 -; IS__TUNIT_NPM-NEXT: call void @g(i32 [[TMP0]]) -; IS__TUNIT_NPM-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f() { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = alloca i32, align 1 +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 1 +; NOT_CGSCC_NPM-NEXT: call void @g(i32 [[TMP0]]) +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f() { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: call void @g(i32 undef) -; IS__CGSCC_NPM-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f() { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: call void @g(i32 undef) +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %a = alloca i32, align 1 @@ -30,26 +23,21 @@ } define internal void @g(i32* %a) { -; IS________OPM-LABEL: define {{[^@]+}}@g -; IS________OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly dereferenceable(4) [[A:%.*]]) { -; IS________OPM-NEXT: [[AA:%.*]] = load i32, i32* [[A]], align 1 -; IS________OPM-NEXT: call void @z(i32 [[AA]]) -; IS________OPM-NEXT: ret void ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@g -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) { -; IS__TUNIT_NPM-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[A_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[AA:%.*]] = load i32, i32* [[A_PRIV]], align 1 -; IS__TUNIT_NPM-NEXT: call void @z(i32 [[AA]]) -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@g -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) { -; IS__CGSCC_NPM-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[AA:%.*]] = load i32, i32* [[A_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: call void @z(i32 undef) -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@g +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) { +; NOT_CGSCC_NPM-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[A_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[AA:%.*]] = load i32, i32* [[A_PRIV]], align 1 +; NOT_CGSCC_NPM-NEXT: call void @z(i32 [[AA]]) +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@g +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) { +; NOT_TUNIT_NPM-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[AA:%.*]] = load i32, i32* [[A_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: call void @z(i32 undef) +; NOT_TUNIT_NPM-NEXT: ret void ; %aa = load i32, i32* %a, align 1 call void @z(i32 %aa) @@ -61,68 +49,41 @@ ; Test2 ; Different alignemnt privatizable arguments define internal i32 @test(i32* %X, i64* %Y) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test -; IS__TUNIT_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]], i64* noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[Y:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: [[A:%.*]] = load i32, i32* [[X]], align 4 -; IS__TUNIT_OPM-NEXT: [[B:%.*]] = load i64, i64* [[Y]], align 8 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = add i32 [[A]], 1 -; IS__TUNIT_OPM-NEXT: [[D:%.*]] = add i64 [[B]], 1 -; IS__TUNIT_OPM-NEXT: [[COND:%.*]] = icmp sgt i64 [[D]], -1 -; IS__TUNIT_OPM-NEXT: br i1 [[COND]], label [[RETURN1:%.*]], label [[RETURN2:%.*]] -; IS__TUNIT_OPM: Return1: -; IS__TUNIT_OPM-NEXT: ret i32 [[C]] -; IS__TUNIT_OPM: Return2: -; IS__TUNIT_OPM-NEXT: ret i32 [[A]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[Y_PRIV:%.*]] = alloca i64, align 8 -; IS__TUNIT_NPM-NEXT: store i64 [[TMP1]], i64* [[Y_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[X_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[A:%.*]] = load i32, i32* [[X_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[B:%.*]] = load i64, i64* [[Y_PRIV]], align 8 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = add i32 [[A]], 1 -; IS__TUNIT_NPM-NEXT: [[D:%.*]] = add i64 [[B]], 1 -; IS__TUNIT_NPM-NEXT: [[COND:%.*]] = icmp sgt i64 [[D]], -1 -; IS__TUNIT_NPM-NEXT: br i1 [[COND]], label [[RETURN1:%.*]], label [[RETURN2:%.*]] -; IS__TUNIT_NPM: Return1: -; IS__TUNIT_NPM-NEXT: ret i32 [[C]] -; IS__TUNIT_NPM: Return2: -; IS__TUNIT_NPM-NEXT: ret i32 [[A]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]], i64* noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[Y:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = load i32, i32* [[X]], align 4 -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = load i64, i64* [[Y]], align 8 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = add i32 [[A]], 1 -; IS__CGSCC_OPM-NEXT: [[D:%.*]] = add i64 [[B]], 1 -; IS__CGSCC_OPM-NEXT: [[COND:%.*]] = icmp sgt i64 [[D]], -1 -; IS__CGSCC_OPM-NEXT: br i1 [[COND]], label [[RETURN1:%.*]], label [[RETURN2:%.*]] -; IS__CGSCC_OPM: Return1: -; IS__CGSCC_OPM-NEXT: ret i32 [[C]] -; IS__CGSCC_OPM: Return2: -; IS__CGSCC_OPM-NEXT: ret i32 [[A]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[Y_PRIV:%.*]] = alloca i64, align 8 -; IS__CGSCC_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: store i32 2, i32* [[X_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = load i32, i32* [[X_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: [[B:%.*]] = load i64, i64* [[Y_PRIV]], align 8 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = add i32 2, 1 -; IS__CGSCC_NPM-NEXT: [[D:%.*]] = add i64 1, 1 -; IS__CGSCC_NPM-NEXT: [[COND:%.*]] = icmp sgt i64 2, -1 -; IS__CGSCC_NPM-NEXT: br i1 true, label [[RETURN1:%.*]], label [[RETURN2:%.*]] -; IS__CGSCC_NPM: Return1: -; IS__CGSCC_NPM-NEXT: ret i32 3 -; IS__CGSCC_NPM: Return2: -; IS__CGSCC_NPM-NEXT: ret i32 2 +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[Y_PRIV:%.*]] = alloca i64, align 8 +; NOT_CGSCC_NPM-NEXT: store i64 [[TMP1]], i64* [[Y_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[X_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = load i32, i32* [[X_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = load i64, i64* [[Y_PRIV]], align 8 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = add i32 [[A]], 1 +; NOT_CGSCC_NPM-NEXT: [[D:%.*]] = add i64 [[B]], 1 +; NOT_CGSCC_NPM-NEXT: [[COND:%.*]] = icmp sgt i64 [[D]], -1 +; NOT_CGSCC_NPM-NEXT: br i1 [[COND]], label [[RETURN1:%.*]], label [[RETURN2:%.*]] +; NOT_CGSCC_NPM: Return1: +; NOT_CGSCC_NPM-NEXT: ret i32 [[C]] +; NOT_CGSCC_NPM: Return2: +; NOT_CGSCC_NPM-NEXT: ret i32 [[A]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[Y_PRIV:%.*]] = alloca i64, align 8 +; NOT_TUNIT_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: store i32 2, i32* [[X_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = load i32, i32* [[X_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = load i64, i64* [[Y_PRIV]], align 8 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = add i32 2, 1 +; NOT_TUNIT_NPM-NEXT: [[D:%.*]] = add i64 1, 1 +; NOT_TUNIT_NPM-NEXT: [[COND:%.*]] = icmp sgt i64 2, -1 +; NOT_TUNIT_NPM-NEXT: br i1 true, label [[RETURN1:%.*]], label [[RETURN2:%.*]] +; NOT_TUNIT_NPM: Return1: +; NOT_TUNIT_NPM-NEXT: ret i32 3 +; NOT_TUNIT_NPM: Return2: +; NOT_TUNIT_NPM-NEXT: ret i32 2 ; %A = load i32, i32* %X %B = load i64, i64* %Y @@ -137,41 +98,26 @@ } define internal i32 @caller(i32* %A) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@caller -; IS__TUNIT_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: [[B:%.*]] = alloca i64, align 8 -; IS__TUNIT_OPM-NEXT: store i64 1, i64* [[B]], align 8 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i64* noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[B]]) #[[ATTR3:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret i32 [[C]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@caller -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[A_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[B:%.*]] = alloca i64, align 8 -; IS__TUNIT_NPM-NEXT: store i64 1, i64* [[B]], align 8 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[A_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i64, i64* [[B]], align 8 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = call i32 @test(i32 [[TMP2]], i64 [[TMP3]]) #[[ATTR3:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret i32 [[C]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = alloca i64, align 8 -; IS__CGSCC_OPM-NEXT: store i64 1, i64* [[B]], align 8 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i64* noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[B]]) #[[ATTR3:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 [[C]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[A_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32 undef, i64 undef) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 [[C]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[A_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = alloca i64, align 8 +; NOT_CGSCC_NPM-NEXT: store i64 1, i64* [[B]], align 8 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[A_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = load i64, i64* [[B]], align 8 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32 [[TMP2]], i64 [[TMP3]]) #[[ATTR3:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[C]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[A_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = call i32 @test(i32 undef, i64 undef) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[C]] ; %B = alloca i64 store i64 1, i64* %B @@ -180,36 +126,21 @@ } define i32 @callercaller() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callercaller -; IS__TUNIT_OPM-SAME: () #[[ATTR2:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__TUNIT_OPM-NEXT: store i32 2, i32* [[B]], align 4 -; IS__TUNIT_OPM-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret i32 [[X]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callercaller -; IS__TUNIT_NPM-SAME: () #[[ATTR2:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 2, i32* [[B]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 -; IS__TUNIT_NPM-NEXT: [[X:%.*]] = call i32 @caller(i32 [[TMP1]]) #[[ATTR4:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret i32 [[X]] ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callercaller -; IS__CGSCC_OPM-SAME: () #[[ATTR2:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: store i32 2, i32* [[B]], align 4 -; IS__CGSCC_OPM-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 [[X]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callercaller -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[X:%.*]] = call i32 @caller(i32 undef) #[[ATTR2:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 [[X]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callercaller +; NOT_CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 2, i32* [[B]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = call i32 @caller(i32 [[TMP1]]) #[[ATTR4:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[X]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callercaller +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = call i32 @caller(i32 undef) #[[ATTR2:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[X]] ; %B = alloca i32 store i32 2, i32* %B @@ -217,21 +148,15 @@ ret i32 %X } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR3:[0-9]+]] = { nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { nofree nosync nounwind willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nosync nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nounwind readnone willreturn } ;. -; IS__CGSCC_NPM: [[RNG0]] = !{i32 0, i32 4} +; NOT_TUNIT_NPM: [[RNG0]] = !{i32 0, i32 4} ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/array.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/array.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/array.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/array.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=3 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -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 ; ; FIXME: The GEP + BC + GEP solution we create is not great but correct. @@ -9,37 +7,31 @@ declare void @use(i32* nocapture readonly %arg) define void @caller() { -; IS________OPM-LABEL: define {{[^@]+}}@caller() { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[LEFT:%.*]] = alloca [3 x i32], align 4 -; IS________OPM-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [3 x i32], [3 x i32]* [[LEFT]], i64 0, i64 0 -; IS________OPM-NEXT: call void @callee(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(12) [[ARRAYDECAY]]) -; IS________OPM-NEXT: ret void ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@caller() { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[LEFT:%.*]] = alloca [3 x i32], align 4 -; IS__TUNIT_NPM-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [3 x i32], [3 x i32]* [[LEFT]], i64 0, i64 0 -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[ARRAYDECAY]] to [3 x i32]* -; IS__TUNIT_NPM-NEXT: [[DOTCAST:%.*]] = bitcast [3 x i32]* [[TMP0]] to i32* -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[DOTCAST]], align 4 -; IS__TUNIT_NPM-NEXT: [[DOT0:%.*]] = getelementptr [3 x i32], [3 x i32]* [[TMP0]], i32 0 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = bitcast [3 x i32]* [[DOT0]] to i8* -; IS__TUNIT_NPM-NEXT: [[DOT0_B4:%.*]] = getelementptr i8, i8* [[TMP2]], i32 4 -; IS__TUNIT_NPM-NEXT: [[DOT0_B4_CAST:%.*]] = bitcast i8* [[DOT0_B4]] to i32* -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[DOT0_B4_CAST]], align 4 -; IS__TUNIT_NPM-NEXT: [[DOT01:%.*]] = getelementptr [3 x i32], [3 x i32]* [[TMP0]], i32 0 -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = bitcast [3 x i32]* [[DOT01]] to i8* -; IS__TUNIT_NPM-NEXT: [[DOT0_B8:%.*]] = getelementptr i8, i8* [[TMP4]], i32 8 -; IS__TUNIT_NPM-NEXT: [[DOT0_B8_CAST:%.*]] = bitcast i8* [[DOT0_B8]] to i32* -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOT0_B8_CAST]], align 4 -; IS__TUNIT_NPM-NEXT: call void @callee(i32 [[TMP1]], i32 [[TMP3]], i32 [[TMP5]]) -; IS__TUNIT_NPM-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller() { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[LEFT:%.*]] = alloca [3 x i32], align 4 +; NOT_CGSCC_NPM-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [3 x i32], [3 x i32]* [[LEFT]], i64 0, i64 0 +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[ARRAYDECAY]] to [3 x i32]* +; NOT_CGSCC_NPM-NEXT: [[DOTCAST:%.*]] = bitcast [3 x i32]* [[TMP0]] to i32* +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[DOTCAST]], align 4 +; NOT_CGSCC_NPM-NEXT: [[DOT0:%.*]] = getelementptr [3 x i32], [3 x i32]* [[TMP0]], i32 0 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = bitcast [3 x i32]* [[DOT0]] to i8* +; NOT_CGSCC_NPM-NEXT: [[DOT0_B4:%.*]] = getelementptr i8, i8* [[TMP2]], i32 4 +; NOT_CGSCC_NPM-NEXT: [[DOT0_B4_CAST:%.*]] = bitcast i8* [[DOT0_B4]] to i32* +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[DOT0_B4_CAST]], align 4 +; NOT_CGSCC_NPM-NEXT: [[DOT01:%.*]] = getelementptr [3 x i32], [3 x i32]* [[TMP0]], i32 0 +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = bitcast [3 x i32]* [[DOT01]] to i8* +; NOT_CGSCC_NPM-NEXT: [[DOT0_B8:%.*]] = getelementptr i8, i8* [[TMP4]], i32 8 +; NOT_CGSCC_NPM-NEXT: [[DOT0_B8_CAST:%.*]] = bitcast i8* [[DOT0_B8]] to i32* +; NOT_CGSCC_NPM-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOT0_B8_CAST]], align 4 +; NOT_CGSCC_NPM-NEXT: call void @callee(i32 [[TMP1]], i32 [[TMP3]], i32 [[TMP5]]) +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller() { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: call void @callee(i32 undef, i32 undef, i32 undef) -; IS__CGSCC_NPM-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller() { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: call void @callee(i32 undef, i32 undef, i32 undef) +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %left = alloca [3 x i32], align 4 @@ -49,51 +41,46 @@ } define internal void @callee(i32* noalias %arg) { -; IS________OPM-LABEL: define {{[^@]+}}@callee -; IS________OPM-SAME: (i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(12) [[ARG:%.*]]) { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: call void @use(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(12) [[ARG]]) -; IS________OPM-NEXT: ret void ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32 [[TMP2:%.*]]) { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[ARG_PRIV:%.*]] = alloca [3 x i32], align 4 -; IS__TUNIT_NPM-NEXT: [[ARG_PRIV_CAST:%.*]] = bitcast [3 x i32]* [[ARG_PRIV]] to i32* -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[ARG_PRIV_CAST]], align 4 -; IS__TUNIT_NPM-NEXT: [[ARG_PRIV_0:%.*]] = getelementptr [3 x i32], [3 x i32]* [[ARG_PRIV]], i32 0 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast [3 x i32]* [[ARG_PRIV_0]] to i8* -; IS__TUNIT_NPM-NEXT: [[ARG_PRIV_0_B4:%.*]] = getelementptr i8, i8* [[TMP3]], i32 4 -; IS__TUNIT_NPM-NEXT: [[ARG_PRIV_0_B4_CAST:%.*]] = bitcast i8* [[ARG_PRIV_0_B4]] to i32* -; IS__TUNIT_NPM-NEXT: store i32 [[TMP1]], i32* [[ARG_PRIV_0_B4_CAST]], align 4 -; IS__TUNIT_NPM-NEXT: [[ARG_PRIV_01:%.*]] = getelementptr [3 x i32], [3 x i32]* [[ARG_PRIV]], i32 0 -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = bitcast [3 x i32]* [[ARG_PRIV_01]] to i8* -; IS__TUNIT_NPM-NEXT: [[ARG_PRIV_0_B8:%.*]] = getelementptr i8, i8* [[TMP4]], i32 8 -; IS__TUNIT_NPM-NEXT: [[ARG_PRIV_0_B8_CAST:%.*]] = bitcast i8* [[ARG_PRIV_0_B8]] to i32* -; IS__TUNIT_NPM-NEXT: store i32 [[TMP2]], i32* [[ARG_PRIV_0_B8_CAST]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = bitcast [3 x i32]* [[ARG_PRIV]] to i32* -; IS__TUNIT_NPM-NEXT: call void @use(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(12) [[TMP5]]) -; IS__TUNIT_NPM-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callee +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32 [[TMP2:%.*]]) { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[ARG_PRIV:%.*]] = alloca [3 x i32], align 4 +; NOT_CGSCC_NPM-NEXT: [[ARG_PRIV_CAST:%.*]] = bitcast [3 x i32]* [[ARG_PRIV]] to i32* +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[ARG_PRIV_CAST]], align 4 +; NOT_CGSCC_NPM-NEXT: [[ARG_PRIV_0:%.*]] = getelementptr [3 x i32], [3 x i32]* [[ARG_PRIV]], i32 0 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast [3 x i32]* [[ARG_PRIV_0]] to i8* +; NOT_CGSCC_NPM-NEXT: [[ARG_PRIV_0_B4:%.*]] = getelementptr i8, i8* [[TMP3]], i32 4 +; NOT_CGSCC_NPM-NEXT: [[ARG_PRIV_0_B4_CAST:%.*]] = bitcast i8* [[ARG_PRIV_0_B4]] to i32* +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP1]], i32* [[ARG_PRIV_0_B4_CAST]], align 4 +; NOT_CGSCC_NPM-NEXT: [[ARG_PRIV_01:%.*]] = getelementptr [3 x i32], [3 x i32]* [[ARG_PRIV]], i32 0 +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = bitcast [3 x i32]* [[ARG_PRIV_01]] to i8* +; NOT_CGSCC_NPM-NEXT: [[ARG_PRIV_0_B8:%.*]] = getelementptr i8, i8* [[TMP4]], i32 8 +; NOT_CGSCC_NPM-NEXT: [[ARG_PRIV_0_B8_CAST:%.*]] = bitcast i8* [[ARG_PRIV_0_B8]] to i32* +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP2]], i32* [[ARG_PRIV_0_B8_CAST]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP5:%.*]] = bitcast [3 x i32]* [[ARG_PRIV]] to i32* +; NOT_CGSCC_NPM-NEXT: call void @use(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(12) [[TMP5]]) +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32 [[TMP2:%.*]]) { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[ARG_PRIV:%.*]] = alloca [3 x i32], align 4 -; IS__CGSCC_NPM-NEXT: [[ARG_PRIV_CAST:%.*]] = bitcast [3 x i32]* [[ARG_PRIV]] to i32* -; IS__CGSCC_NPM-NEXT: store i32 undef, i32* [[ARG_PRIV_CAST]], align 4 -; IS__CGSCC_NPM-NEXT: [[ARG_PRIV_0:%.*]] = getelementptr [3 x i32], [3 x i32]* [[ARG_PRIV]], i32 0 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = bitcast [3 x i32]* [[ARG_PRIV_0]] to i8* -; IS__CGSCC_NPM-NEXT: [[ARG_PRIV_0_B4:%.*]] = getelementptr i8, i8* [[TMP3]], i32 4 -; IS__CGSCC_NPM-NEXT: [[ARG_PRIV_0_B4_CAST:%.*]] = bitcast i8* [[ARG_PRIV_0_B4]] to i32* -; IS__CGSCC_NPM-NEXT: store i32 undef, i32* [[ARG_PRIV_0_B4_CAST]], align 4 -; IS__CGSCC_NPM-NEXT: [[ARG_PRIV_01:%.*]] = getelementptr [3 x i32], [3 x i32]* [[ARG_PRIV]], i32 0 -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = bitcast [3 x i32]* [[ARG_PRIV_01]] to i8* -; IS__CGSCC_NPM-NEXT: [[ARG_PRIV_0_B8:%.*]] = getelementptr i8, i8* [[TMP4]], i32 8 -; IS__CGSCC_NPM-NEXT: [[ARG_PRIV_0_B8_CAST:%.*]] = bitcast i8* [[ARG_PRIV_0_B8]] to i32* -; IS__CGSCC_NPM-NEXT: store i32 undef, i32* [[ARG_PRIV_0_B8_CAST]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = bitcast [3 x i32]* [[ARG_PRIV]] to i32* -; IS__CGSCC_NPM-NEXT: call void @use(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(12) [[TMP5]]) -; IS__CGSCC_NPM-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callee +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32 [[TMP2:%.*]]) { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[ARG_PRIV:%.*]] = alloca [3 x i32], align 4 +; NOT_TUNIT_NPM-NEXT: [[ARG_PRIV_CAST:%.*]] = bitcast [3 x i32]* [[ARG_PRIV]] to i32* +; NOT_TUNIT_NPM-NEXT: store i32 undef, i32* [[ARG_PRIV_CAST]], align 4 +; NOT_TUNIT_NPM-NEXT: [[ARG_PRIV_0:%.*]] = getelementptr [3 x i32], [3 x i32]* [[ARG_PRIV]], i32 0 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = bitcast [3 x i32]* [[ARG_PRIV_0]] to i8* +; NOT_TUNIT_NPM-NEXT: [[ARG_PRIV_0_B4:%.*]] = getelementptr i8, i8* [[TMP3]], i32 4 +; NOT_TUNIT_NPM-NEXT: [[ARG_PRIV_0_B4_CAST:%.*]] = bitcast i8* [[ARG_PRIV_0_B4]] to i32* +; NOT_TUNIT_NPM-NEXT: store i32 undef, i32* [[ARG_PRIV_0_B4_CAST]], align 4 +; NOT_TUNIT_NPM-NEXT: [[ARG_PRIV_01:%.*]] = getelementptr [3 x i32], [3 x i32]* [[ARG_PRIV]], i32 0 +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = bitcast [3 x i32]* [[ARG_PRIV_01]] to i8* +; NOT_TUNIT_NPM-NEXT: [[ARG_PRIV_0_B8:%.*]] = getelementptr i8, i8* [[TMP4]], i32 8 +; NOT_TUNIT_NPM-NEXT: [[ARG_PRIV_0_B8_CAST:%.*]] = bitcast i8* [[ARG_PRIV_0_B8]] to i32* +; NOT_TUNIT_NPM-NEXT: store i32 undef, i32* [[ARG_PRIV_0_B8_CAST]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP5:%.*]] = bitcast [3 x i32]* [[ARG_PRIV]] to i32* +; NOT_TUNIT_NPM-NEXT: call void @use(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(12) [[TMP5]]) +; NOT_TUNIT_NPM-NEXT: ret void ; entry: call void @use(i32* %arg) diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 %struct.ss = type { i32, i64 } @@ -9,70 +7,45 @@ ; Don't drop 'byval' on %X here. define internal i32 @f(%struct.ss* byval(%struct.ss) %b, i32* byval(i32) %X, i32 %i) nounwind { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@f -; IS__TUNIT_OPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull byval([[STRUCT_SS:%.*]]) align 8 dereferenceable(12) [[B:%.*]], i32* noalias nocapture nofree noundef nonnull byval(i32) align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B]], i32 0, i32 0 -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__TUNIT_OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 -; IS__TUNIT_OPM-NEXT: store i32 0, i32* [[X]], align 4 -; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* [[X]], align 4 -; IS__TUNIT_OPM-NEXT: [[A:%.*]] = add i32 [[L]], [[TMP2]] -; IS__TUNIT_OPM-NEXT: ret i32 [[A]] ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP2]], i32* [[X_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 -; IS__TUNIT_NPM-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[B_PRIV_CAST]], align 4 -; IS__TUNIT_NPM-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: store i64 [[TMP1]], i64* [[B_PRIV_0_1]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 -; IS__TUNIT_NPM-NEXT: store i32 0, i32* [[X_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* [[X_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[A:%.*]] = add i32 [[L]], [[TMP2]] -; IS__TUNIT_NPM-NEXT: ret i32 [[A]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP2]], i32* [[X_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 +; NOT_CGSCC_NPM-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[B_PRIV_CAST]], align 4 +; NOT_CGSCC_NPM-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: store i64 [[TMP1]], i64* [[B_PRIV_0_1]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[X_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[X_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = add i32 [[L]], [[TMP2]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[A]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_OPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull byval([[STRUCT_SS:%.*]]) align 8 dereferenceable(12) [[B:%.*]], i32* noalias nocapture nofree noundef nonnull byval(i32) align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B]], i32 0, i32 0 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__CGSCC_OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[X]], align 4 -; IS__CGSCC_OPM-NEXT: [[L:%.*]] = load i32, i32* [[X]], align 4 -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = add i32 [[L]], [[TMP2]] -; IS__CGSCC_OPM-NEXT: ret i32 [[A]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: store i32 [[TMP2]], i32* [[X_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 -; IS__CGSCC_NPM-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* -; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[B_PRIV_CAST]], align 8 -; IS__CGSCC_NPM-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__CGSCC_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[X_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[X_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = add i32 [[L]], [[TMP2]] -; IS__CGSCC_NPM-NEXT: ret i32 [[A]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: store i32 [[TMP2]], i32* [[X_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 +; NOT_TUNIT_NPM-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[B_PRIV_CAST]], align 8 +; NOT_TUNIT_NPM-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; NOT_TUNIT_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[X_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* [[X_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = add i32 [[L]], [[TMP2]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[A]] ; entry: @@ -90,54 +63,33 @@ ; Also make sure we don't drop the call zeroext attribute. define i32 @test(i32* %X) { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly align 4 [[X:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[TMP1]], align 8 -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_SS]]) align 8 dereferenceable(12) [[S]], i32* nocapture nofree readonly byval(i32) align 4 [[X]]) #[[ATTR1:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret i32 [[C]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readonly align 4 [[X:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[TMP1]], align 8 -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[S_CAST:%.*]] = bitcast %struct.ss* [[S]] to i32* -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[S_CAST]], align 8 -; IS__TUNIT_NPM-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_1]], align 8 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[X]], align 4 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]], i32 [[TMP2]]) #[[ATTR1:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret i32 [[C]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[TMP1]], align 8 -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_SS]]) align 8 dereferenceable(12) [[S]], i32* noalias nocapture nofree noundef nonnull readonly byval(i32) align 4 dereferenceable(4) [[X]]) #[[ATTR1:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 [[C]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readonly align 4 [[X:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[TMP1]], align 8 +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[S_CAST:%.*]] = bitcast %struct.ss* [[S]] to i32* +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[S_CAST]], align 8 +; NOT_CGSCC_NPM-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_1]], align 8 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[X]], align 4 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]], i32 [[TMP2]]) #[[ATTR1:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[C]] ; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[X]], align 4 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @f(i32 undef, i64 undef, i32 [[TMP0]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 [[C]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[X]], align 4 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = call i32 @f(i32 undef, i64 undef, i32 [[TMP0]]) #[[ATTR2:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[C]] ; entry: %S = alloca %struct.ss @@ -151,13 +103,10 @@ ret i32 %c } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll @@ -1,49 +1,32 @@ ; 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=16 -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=16 -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" define internal i32 @test(i32* %X, i32* %Y) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test -; IS__TUNIT_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[Y:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: [[A:%.*]] = load i32, i32* [[X]], align 4 -; IS__TUNIT_OPM-NEXT: [[B:%.*]] = load i32, i32* [[Y]], align 4 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = add i32 [[A]], [[B]] -; IS__TUNIT_OPM-NEXT: ret i32 [[C]] ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[Y_PRIV:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP1]], i32* [[Y_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[X_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[A:%.*]] = load i32, i32* [[X_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[B:%.*]] = load i32, i32* [[Y_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = add i32 [[A]], [[B]] -; IS__TUNIT_NPM-NEXT: ret i32 [[C]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[Y_PRIV:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP1]], i32* [[Y_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[X_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = load i32, i32* [[X_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = load i32, i32* [[Y_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = add i32 [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[C]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[Y:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = load i32, i32* [[X]], align 4 -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = load i32, i32* [[Y]], align 4 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = add i32 [[A]], [[B]] -; IS__CGSCC_OPM-NEXT: ret i32 [[C]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[Y_PRIV:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: store i32 2, i32* [[Y_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = load i32, i32* [[X_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: [[B:%.*]] = load i32, i32* [[Y_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = add i32 1, 2 -; IS__CGSCC_NPM-NEXT: ret i32 3 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[Y_PRIV:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: store i32 2, i32* [[Y_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = load i32, i32* [[X_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = load i32, i32* [[Y_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = add i32 1, 2 +; NOT_TUNIT_NPM-NEXT: ret i32 3 ; %A = load i32, i32* %X %B = load i32, i32* %Y @@ -52,41 +35,26 @@ } define internal i32 @caller(i32* %B) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@caller -; IS__TUNIT_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[A]], align 4 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR3:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret i32 [[C]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@caller -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[B_PRIV:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[B_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[A]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[A]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = call i32 @test(i32 [[TMP2]], i32 [[TMP3]]) #[[ATTR3:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret i32 [[C]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[A]], align 4 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR3:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 [[C]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[B_PRIV:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[B_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[A]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[A]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32 [[TMP2]], i32 [[TMP3]]) #[[ATTR3:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[C]] ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[B_PRIV:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[B_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32 undef, i32 undef) #[[ATTR1:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[B_PRIV:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[B_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = call i32 @test(i32 undef, i32 undef) #[[ATTR1:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %A = alloca i32 store i32 1, i32* %A @@ -95,35 +63,20 @@ } define i32 @callercaller() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callercaller -; IS__TUNIT_OPM-SAME: () #[[ATTR2:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__TUNIT_OPM-NEXT: store i32 2, i32* [[B]], align 4 -; IS__TUNIT_OPM-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret i32 [[X]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callercaller -; IS__TUNIT_NPM-SAME: () #[[ATTR2:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 2, i32* [[B]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 -; IS__TUNIT_NPM-NEXT: [[X:%.*]] = call i32 @caller(i32 [[TMP1]]) #[[ATTR4:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret i32 [[X]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callercaller +; NOT_CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 2, i32* [[B]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = call i32 @caller(i32 [[TMP1]]) #[[ATTR4:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[X]] ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callercaller -; IS__CGSCC_OPM-SAME: () #[[ATTR2:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: store i32 2, i32* [[B]], align 4 -; IS__CGSCC_OPM-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 [[X]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callercaller -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: ret i32 3 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callercaller +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32 3 ; %B = alloca i32 store i32 2, i32* %B @@ -132,18 +85,12 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR3:[0-9]+]] = { nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { nofree nosync nounwind willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nosync nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll @@ -1,66 +1,43 @@ ; 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-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 %struct.ss = type { i32, i64 } define internal void @f(%struct.ss* byval(%struct.ss) %b, i32* byval(i32) %X) nounwind { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@f -; IS__TUNIT_OPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull byval([[STRUCT_SS:%.*]]) align 8 dereferenceable(12) [[B:%.*]], i32* noalias nocapture nofree noundef nonnull writeonly byval(i32) align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B]], i32 0, i32 0 -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__TUNIT_OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 -; IS__TUNIT_OPM-NEXT: store i32 0, i32* [[X]], align 4 -; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP2]], i32* [[X_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 -; IS__TUNIT_NPM-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[B_PRIV_CAST]], align 4 -; IS__TUNIT_NPM-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: store i64 [[TMP1]], i64* [[B_PRIV_0_1]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 -; IS__TUNIT_NPM-NEXT: store i32 0, i32* [[X_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP2]], i32* [[X_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 +; NOT_CGSCC_NPM-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[B_PRIV_CAST]], align 4 +; NOT_CGSCC_NPM-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: store i64 [[TMP1]], i64* [[B_PRIV_0_1]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[X_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_OPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull byval([[STRUCT_SS:%.*]]) align 8 dereferenceable(12) [[B:%.*]], i32* noalias nocapture nofree noundef nonnull writeonly byval(i32) align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B]], i32 0, i32 0 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__CGSCC_OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[X]], align 4 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 -; IS__CGSCC_NPM-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* -; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[B_PRIV_CAST]], align 8 -; IS__CGSCC_NPM-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__CGSCC_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 -; IS__CGSCC_NPM-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 +; NOT_TUNIT_NPM-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[B_PRIV_CAST]], align 8 +; NOT_TUNIT_NPM-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; NOT_TUNIT_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %tmp = getelementptr %struct.ss, %struct.ss* %b, i32 0, i32 0 @@ -74,52 +51,31 @@ define i32 @test(i32* %X) { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly align 4 [[X:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[TMP1]], align 8 -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT_OPM-NEXT: call void @f(%struct.ss* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_SS]]) align 8 dereferenceable(12) [[S]], i32* nocapture nofree readonly byval(i32) align 4 [[X]]) #[[ATTR1:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret i32 0 -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readonly align 4 [[X:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[TMP1]], align 8 -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[S_CAST:%.*]] = bitcast %struct.ss* [[S]] to i32* -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[S_CAST]], align 8 -; IS__TUNIT_NPM-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_1]], align 8 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[X]], align 4 -; IS__TUNIT_NPM-NEXT: call void @f(i32 [[TMP0]], i64 [[TMP1]], i32 [[TMP2]]) #[[ATTR1:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret i32 0 ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[TMP1]], align 8 -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__CGSCC_OPM-NEXT: call void @f(%struct.ss* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_SS]]) align 8 dereferenceable(12) [[S]], i32* noalias nocapture nofree noundef nonnull readonly byval(i32) align 4 dereferenceable(4) [[X]]) #[[ATTR1:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readonly align 4 [[X:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[TMP1]], align 8 +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[S_CAST:%.*]] = bitcast %struct.ss* [[S]] to i32* +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[S_CAST]], align 8 +; NOT_CGSCC_NPM-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_1]], align 8 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[X]], align 4 +; NOT_CGSCC_NPM-NEXT: call void @f(i32 [[TMP0]], i64 [[TMP1]], i32 [[TMP2]]) #[[ATTR1:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; entry: %S = alloca %struct.ss @@ -131,11 +87,8 @@ ret i32 0 } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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" @@ -9,54 +7,35 @@ %struct.ss = type { i32, i64 } define internal i32 @f(%struct.ss* byval(%struct.ss) %b) nounwind { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@f -; IS__TUNIT_OPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull byval([[STRUCT_SS:%.*]]) align 8 dereferenceable(12) [[B:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B]], i32 0, i32 0 -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__TUNIT_OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP1]] ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 -; IS__TUNIT_NPM-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[B_PRIV_CAST]], align 4 -; IS__TUNIT_NPM-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: store i64 [[TMP1]], i64* [[B_PRIV_0_1]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP1]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 +; NOT_CGSCC_NPM-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[B_PRIV_CAST]], align 4 +; NOT_CGSCC_NPM-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: store i64 [[TMP1]], i64* [[B_PRIV_0_1]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP1]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_OPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull byval([[STRUCT_SS:%.*]]) align 32 dereferenceable(12) [[B:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B]], i32 0, i32 0 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 32 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__CGSCC_OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 32 -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP1]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 -; IS__CGSCC_NPM-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* -; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[B_PRIV_CAST]], align 8 -; IS__CGSCC_NPM-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__CGSCC_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP1]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 +; NOT_TUNIT_NPM-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[B_PRIV_CAST]], align 8 +; NOT_TUNIT_NPM-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; NOT_TUNIT_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP1]] ; entry: %tmp = getelementptr %struct.ss, %struct.ss* %b, i32 0, i32 0 @@ -68,54 +47,35 @@ define internal i32 @g(%struct.ss* byval(%struct.ss) align 32 %b) nounwind { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@g -; IS__TUNIT_OPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull byval([[STRUCT_SS:%.*]]) align 32 dereferenceable(12) [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B]], i32 0, i32 0 -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 32 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__TUNIT_OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 32 -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP2]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@g -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 -; IS__TUNIT_NPM-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[B_PRIV_CAST]], align 4 -; IS__TUNIT_NPM-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: store i64 [[TMP1]], i64* [[B_PRIV_0_1]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 32 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 32 -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP2]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@g -; IS__CGSCC_OPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull byval([[STRUCT_SS:%.*]]) align 32 dereferenceable(12) [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B]], i32 0, i32 0 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 32 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__CGSCC_OPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 32 -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP2]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@g +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 +; NOT_CGSCC_NPM-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[B_PRIV_CAST]], align 4 +; NOT_CGSCC_NPM-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: store i64 [[TMP1]], i64* [[B_PRIV_0_1]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 32 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 32 +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP2]] ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@g -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 -; IS__CGSCC_NPM-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* -; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[B_PRIV_CAST]], align 32 -; IS__CGSCC_NPM-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 32 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 -; IS__CGSCC_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 32 -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP2]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@g +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 +; NOT_TUNIT_NPM-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[B_PRIV_CAST]], align 32 +; NOT_TUNIT_NPM-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 32 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; NOT_TUNIT_NPM-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 32 +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP2]] ; entry: %tmp = getelementptr %struct.ss, %struct.ss* %b, i32 0, i32 0 @@ -127,64 +87,39 @@ define i32 @main() nounwind { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@main -; IS__TUNIT_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[TMP1]], align 8 -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT_OPM-NEXT: [[C0:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_SS]]) align 8 dereferenceable(12) [[S]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT_OPM-NEXT: [[C1:%.*]] = call i32 @g(%struct.ss* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_SS]]) align 32 dereferenceable(12) [[S]]) #[[ATTR2]] -; IS__TUNIT_OPM-NEXT: [[A:%.*]] = add i32 [[C0]], [[C1]] -; IS__TUNIT_OPM-NEXT: ret i32 [[A]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@main -; IS__TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[TMP1]], align 8 -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[S_CAST:%.*]] = bitcast %struct.ss* [[S]] to i32* -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[S_CAST]], align 8 -; IS__TUNIT_NPM-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_1]], align 8 -; IS__TUNIT_NPM-NEXT: [[C0:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT_NPM-NEXT: [[S_CAST1:%.*]] = bitcast %struct.ss* [[S]] to i32* -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[S_CAST1]], align 32 -; IS__TUNIT_NPM-NEXT: [[S_0_12:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i64, i64* [[S_0_12]], align 32 -; IS__TUNIT_NPM-NEXT: [[C1:%.*]] = call i32 @g(i32 [[TMP2]], i64 [[TMP3]]) #[[ATTR2]] -; IS__TUNIT_NPM-NEXT: [[A:%.*]] = add i32 [[C0]], [[C1]] -; IS__TUNIT_NPM-NEXT: ret i32 [[A]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@main +; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[TMP1]], align 8 +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[S_CAST:%.*]] = bitcast %struct.ss* [[S]] to i32* +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[S_CAST]], align 8 +; NOT_CGSCC_NPM-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_1]], align 8 +; NOT_CGSCC_NPM-NEXT: [[C0:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]]) #[[ATTR2:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[S_CAST1:%.*]] = bitcast %struct.ss* [[S]] to i32* +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[S_CAST1]], align 32 +; NOT_CGSCC_NPM-NEXT: [[S_0_12:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = load i64, i64* [[S_0_12]], align 32 +; NOT_CGSCC_NPM-NEXT: [[C1:%.*]] = call i32 @g(i32 [[TMP2]], i64 [[TMP3]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = add i32 [[C0]], [[C1]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[A]] ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@main -; IS__CGSCC_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[TMP1]], align 32 -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__CGSCC_OPM-NEXT: [[C0:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_SS]]) align 32 dereferenceable(12) [[S]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC_OPM-NEXT: [[C1:%.*]] = call i32 @g(%struct.ss* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_SS]]) align 32 dereferenceable(12) [[S]]) #[[ATTR2]] -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = add i32 [[C0]], [[C1]] -; IS__CGSCC_OPM-NEXT: ret i32 [[A]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@main -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: [[C0:%.*]] = call i32 @f(i32 undef, i64 undef) #[[ATTR1:[0-9]+]] -; IS__CGSCC_NPM-NEXT: [[C1:%.*]] = call i32 @g(i32 undef, i64 undef) #[[ATTR1]] -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = add i32 [[C0]], [[C1]] -; IS__CGSCC_NPM-NEXT: ret i32 [[A]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@main +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[C0:%.*]] = call i32 @f(i32 undef, i64 undef) #[[ATTR1:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[C1:%.*]] = call i32 @g(i32 undef, i64 undef) #[[ATTR1]] +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = add i32 [[C0]], [[C1]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[A]] ; entry: %S = alloca %struct.ss @@ -200,14 +135,10 @@ ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/chained.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/chained.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/chained.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/chained.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 @G1 = constant i32 0 @@ -13,11 +11,11 @@ ;. define internal i32 @test(i32** %x) { ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; entry: %y = load i32*, i32** %x @@ -26,17 +24,17 @@ } define i32 @caller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; entry: %x = call i32 @test(i32** @G2) @@ -44,7 +42,7 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll @@ -1,32 +1,30 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; Don't promote around control flow. define internal i32 @callee(i1 %C, i32* %P) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@callee -; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: T: -; IS__TUNIT____-NEXT: ret i32 17 -; IS__TUNIT____: F: -; IS__TUNIT____-NEXT: [[X:%.*]] = load i32, i32* [[P]], align 4 -; IS__TUNIT____-NEXT: ret i32 [[X]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callee +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: T: +; NOT_CGSCC_NPM-NEXT: ret i32 17 +; NOT_CGSCC_NPM: F: +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = load i32, i32* [[P]], align 4 +; NOT_CGSCC_NPM-NEXT: ret i32 [[X]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@callee -; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: T: -; IS__CGSCC____-NEXT: ret i32 17 -; IS__CGSCC____: F: -; IS__CGSCC____-NEXT: [[X:%.*]] = load i32, i32* [[P]], align 4 -; IS__CGSCC____-NEXT: ret i32 [[X]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callee +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: T: +; NOT_TUNIT_NPM-NEXT: ret i32 17 +; NOT_TUNIT_NPM: F: +; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = load i32, i32* [[P]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 [[X]] ; entry: br i1 %C, label %T, label %F @@ -40,19 +38,19 @@ } define i32 @foo(i1 %C, i32* %P) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[X:%.*]] = call i32 @callee(i1 [[C]], i32* nocapture nofree readonly [[P]]) #[[ATTR1:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 [[X]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = call i32 @callee(i1 [[C]], i32* nocapture nofree readonly [[P]]) #[[ATTR1:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[X]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[X:%.*]] = call i32 @callee(i1 [[C]], i32* nocapture nofree readonly [[P]]) #[[ATTR1:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 [[X]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = call i32 @callee(i1 [[C]], i32* nocapture nofree readonly [[P]]) #[[ATTR1:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[X]] ; entry: %X = call i32 @callee(i1 %C, i32* %P) @@ -60,9 +58,9 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readonly willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nosync nounwind readonly willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow2.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow2.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow2.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow2.ll @@ -1,54 +1,33 @@ ; 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=10 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=10 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM target datalayout = "E-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" define internal i32 @callee(i1 %C, i32* %P) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callee -; IS__TUNIT_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: br label [[F:%.*]] -; IS__TUNIT_OPM: T: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: F: -; IS__TUNIT_OPM-NEXT: [[X:%.*]] = load i32, i32* [[P]], align 4 -; IS__TUNIT_OPM-NEXT: ret i32 [[X]] ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[P_PRIV:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[P_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: br label [[F:%.*]] -; IS__TUNIT_NPM: T: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: F: -; IS__TUNIT_NPM-NEXT: [[X:%.*]] = load i32, i32* [[P_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: ret i32 [[X]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callee +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[P_PRIV:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[P_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[F:%.*]] +; NOT_CGSCC_NPM: T: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: F: +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = load i32, i32* [[P_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: ret i32 [[X]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callee -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br label [[F:%.*]] -; IS__CGSCC_OPM: T: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: F: -; IS__CGSCC_OPM-NEXT: [[X:%.*]] = load i32, i32* [[P]], align 4 -; IS__CGSCC_OPM-NEXT: ret i32 [[X]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[P_PRIV:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: br label [[F:%.*]] -; IS__CGSCC_NPM: T: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: F: -; IS__CGSCC_NPM-NEXT: [[X:%.*]] = load i32, i32* [[P_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callee +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[P_PRIV:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: br label [[F:%.*]] +; NOT_TUNIT_NPM: T: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: F: +; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = load i32, i32* [[P_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; br i1 %C, label %T, label %F @@ -61,35 +40,20 @@ } define i32 @foo() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@foo -; IS__TUNIT_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__TUNIT_OPM-NEXT: store i32 17, i32* [[A]], align 4 -; IS__TUNIT_OPM-NEXT: [[X:%.*]] = call i32 @callee(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret i32 [[X]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@foo -; IS__TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 17, i32* [[A]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[A]], align 4 -; IS__TUNIT_NPM-NEXT: [[X:%.*]] = call i32 @callee(i32 [[TMP1]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret i32 [[X]] ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@foo -; IS__CGSCC_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: store i32 17, i32* [[A]], align 4 -; IS__CGSCC_OPM-NEXT: [[X:%.*]] = call i32 @callee(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 [[X]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo +; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 17, i32* [[A]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[A]], align 4 +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = call i32 @callee(i32 [[TMP1]]) #[[ATTR2:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[X]] ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@foo -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: ret i32 17 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32 17 ; %A = alloca i32 ; [#uses=2] store i32 17, i32* %A @@ -98,13 +62,9 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind readonly willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readonly willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/crash.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/crash.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/crash.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/crash.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 %S = type { %S* } @@ -9,27 +7,27 @@ ; Inlining should nuke the invoke (and any inlined calls) here even with ; argument promotion running along with it. define void @zot() personality i32 (...)* @wibble { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@zot -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] personality i32 (...)* @wibble { -; IS__TUNIT____-NEXT: bb: -; IS__TUNIT____-NEXT: call void @hoge() #[[ATTR1:[0-9]+]] -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: bb1: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: bb2: -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@zot +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] personality i32 (...)* @wibble { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: call void @hoge() #[[ATTR1:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: bb1: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: bb2: +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@zot -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] personality i32 (...)* @wibble { -; IS__CGSCC____-NEXT: bb: -; IS__CGSCC____-NEXT: call void @hoge() #[[ATTR2:[0-9]+]] -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: bb1: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: bb2: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@zot +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] personality i32 (...)* @wibble { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: call void @hoge() #[[ATTR2:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: bb1: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: bb2: +; NOT_TUNIT_NPM-NEXT: unreachable ; bb: invoke void @hoge() @@ -45,17 +43,17 @@ } define internal void @hoge() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@hoge -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: bb: -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@hoge +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@hoge -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: bb: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@hoge +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: unreachable ; bb: %tmp = call fastcc i8* @spam(i1 (i8*)* @eggs) @@ -64,22 +62,22 @@ } define internal fastcc i8* @spam(i1 (i8*)* %arg) { -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@spam -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: bb: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@spam +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: unreachable ; bb: unreachable } define internal i1 @eggs(i8* %arg) { -; IS__CGSCC____-LABEL: define {{[^@]+}}@eggs -; IS__CGSCC____-SAME: (i8* [[ARG:%.*]]) { -; IS__CGSCC____-NEXT: bb: -; IS__CGSCC____-NEXT: [[TMP:%.*]] = call zeroext i1 @barney() -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@eggs +; NOT_TUNIT_NPM-SAME: (i8* [[ARG:%.*]]) { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = call zeroext i1 @barney() +; NOT_TUNIT_NPM-NEXT: unreachable ; bb: %tmp = call zeroext i1 @barney(i8* %arg) @@ -87,30 +85,30 @@ } define internal i1 @barney(i8* %arg) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@barney -; IS__CGSCC____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: bb: -; IS__CGSCC____-NEXT: ret i1 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@barney +; NOT_TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: ret i1 undef ; bb: ret i1 undef } define i32 @test_inf_promote_caller(i32 %arg) { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_inf_promote_caller -; IS__TUNIT____-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: bb: -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_inf_promote_caller +; NOT_CGSCC_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_inf_promote_caller -; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: bb: -; IS__CGSCC____-NEXT: [[TMP:%.*]] = alloca [[S:%.*]], align 8 -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = alloca [[S]], align 8 -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_inf_promote_caller +; NOT_TUNIT_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca [[S:%.*]], align 8 +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = alloca [[S]], align 8 +; NOT_TUNIT_NPM-NEXT: unreachable ; bb: %tmp = alloca %S @@ -121,11 +119,11 @@ } define internal i32 @test_inf_promote_callee(%S* %arg, %S* %arg1) { -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_inf_promote_callee -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: bb: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_inf_promote_callee +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: unreachable ; bb: %tmp = getelementptr %S, %S* %arg1, i32 0, i32 0 @@ -139,10 +137,10 @@ declare i32 @wibble(...) ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { noreturn nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { noreturn nounwind readnone } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { noreturn nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { noreturn nounwind readnone } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/dbg.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/dbg.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/dbg.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/dbg.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 declare void @sink(i32) @@ -32,17 +30,17 @@ } define void @caller(i32** %Y, %struct.pair* %P) { -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller -; IS__TUNIT____-SAME: (i32** nocapture nofree readonly [[Y:%.*]], %struct.pair* nocapture nofree readnone [[P:%.*]]) { -; IS__TUNIT____-NEXT: call void @test(i32** nocapture nofree readonly align 8 [[Y]]), !dbg [[DBG4:![0-9]+]] -; IS__TUNIT____-NEXT: call void @test_byval(), !dbg [[DBG5:![0-9]+]] -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller +; NOT_CGSCC_NPM-SAME: (i32** nocapture nofree readonly [[Y:%.*]], %struct.pair* nocapture nofree readnone [[P:%.*]]) { +; NOT_CGSCC_NPM-NEXT: call void @test(i32** nocapture nofree readonly align 8 [[Y]]), !dbg [[DBG4:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: call void @test_byval(), !dbg [[DBG5:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller -; IS__CGSCC____-SAME: (i32** nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[Y:%.*]], %struct.pair* nocapture nofree readnone [[P:%.*]]) { -; IS__CGSCC____-NEXT: call void @test(i32** nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[Y]]), !dbg [[DBG4:![0-9]+]] -; IS__CGSCC____-NEXT: call void @test_byval(), !dbg [[DBG5:![0-9]+]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller +; NOT_TUNIT_NPM-SAME: (i32** nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[Y:%.*]], %struct.pair* nocapture nofree readnone [[P:%.*]]) { +; NOT_TUNIT_NPM-NEXT: call void @test(i32** nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[Y]]), !dbg [[DBG4:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: call void @test_byval(), !dbg [[DBG5:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @test(i32** %Y), !dbg !1 diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll @@ -1,8 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; TODO: The old pass manager cgscc run is disabled as it causes a crash on windows which is under investigation: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/23151 -; 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" @@ -22,29 +20,23 @@ ;. define void @run() { ; -; IS________OPM: Function Attrs: nofree noreturn nosync nounwind readnone -; IS________OPM-LABEL: define {{[^@]+}}@run -; IS________OPM-SAME: () #[[ATTR0:[0-9]+]] { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[TMP0:%.*]] = call i64 @CaptureAStruct(%struct.Foo* nocapture nofree noundef nonnull readonly byval([[STRUCT_FOO:%.*]]) align 8 dereferenceable(16) @a) #[[ATTR0]] -; IS________OPM-NEXT: unreachable ; -; IS__TUNIT_NPM: Function Attrs: nofree noreturn nosync nounwind readnone -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@run -; IS__TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[A_CAST:%.*]] = bitcast %struct.Foo* @a to i32* -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_CAST]], align 8 -; IS__TUNIT_NPM-NEXT: [[A_0_1:%.*]] = getelementptr [[STRUCT_FOO:%.*]], %struct.Foo* @a, i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_0_1]], align 8 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = call i64 @CaptureAStruct(i32 [[TMP0]], i64 [[TMP1]]) #[[ATTR0]] -; IS__TUNIT_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@run +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[A_CAST:%.*]] = bitcast %struct.Foo* @a to i32* +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_CAST]], align 8 +; NOT_CGSCC_NPM-NEXT: [[A_0_1:%.*]] = getelementptr [[STRUCT_FOO:%.*]], %struct.Foo* @a, i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_0_1]], align 8 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = call i64 @CaptureAStruct(i32 [[TMP0]], i64 [[TMP1]]) #[[ATTR0]] +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@run -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@run +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: tail call i8 @UseLongDoubleUnsafely(%union.u* byval(%union.u) align 16 bitcast (%struct.s* @b to %union.u*)) @@ -55,11 +47,11 @@ } define internal i8 @UseLongDoubleUnsafely(%union.u* byval(%union.u) align 16 %arg) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@UseLongDoubleUnsafely -; IS__CGSCC____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i8 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@UseLongDoubleUnsafely +; NOT_TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i8 undef ; entry: %bitcast = bitcast %union.u* %arg to %struct.s* @@ -69,10 +61,10 @@ } define internal x86_fp80 @UseLongDoubleSafely(%union.u* byval(%union.u) align 16 %arg) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@UseLongDoubleSafely -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret x86_fp80 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@UseLongDoubleSafely +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret x86_fp80 undef ; %gep = getelementptr inbounds %union.u, %union.u* %arg, i64 0, i32 0 %fp80 = load x86_fp80, x86_fp80* %gep @@ -80,10 +72,10 @@ } define internal i64 @AccessPaddingOfStruct(%struct.Foo* byval(%struct.Foo) %a) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@AccessPaddingOfStruct -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i64 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@AccessPaddingOfStruct +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i64 undef ; %p = bitcast %struct.Foo* %a to i64* %v = load i64, i64* %p @@ -91,58 +83,37 @@ } define internal i64 @CaptureAStruct(%struct.Foo* byval(%struct.Foo) %a) { -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@CaptureAStruct -; IS__CGSCC_OPM-SAME: (%struct.Foo* noalias nofree byval(%struct.Foo) [[A:%.*]]) -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[A_PTR:%.*]] = alloca %struct.Foo* -; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_OPM: loop: -; IS__CGSCC_OPM-NEXT: [[PHI:%.*]] = phi %struct.Foo* [ null, [[ENTRY:%.*]] ], [ [[GEP:%.*]], [[LOOP]] ] -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = phi %struct.Foo* [ [[A]], [[ENTRY]] ], [ [[TMP0]], [[LOOP]] ] -; IS__CGSCC_OPM-NEXT: store %struct.Foo* [[PHI]], %struct.Foo** [[A_PTR]], align 8 -; IS__CGSCC_OPM-NEXT: [[GEP]] = getelementptr [[STRUCT_FOO:%.*]], %struct.Foo* [[A]], i64 0 -; IS__CGSCC_OPM-NEXT: br label [[LOOP]] ; -; IS________OPM: Function Attrs: nofree noreturn nosync nounwind readnone -; IS________OPM-LABEL: define {{[^@]+}}@CaptureAStruct -; IS________OPM-SAME: (%struct.Foo* noalias nocapture nofree noundef nonnull readnone byval([[STRUCT_FOO:%.*]]) align 8 dereferenceable(16) [[A:%.*]]) #[[ATTR0]] { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[A_PTR:%.*]] = alloca %struct.Foo*, align 8 -; IS________OPM-NEXT: br label [[LOOP:%.*]] -; IS________OPM: loop: -; IS________OPM-NEXT: [[PHI:%.*]] = phi %struct.Foo* [ null, [[ENTRY:%.*]] ], [ [[A]], [[LOOP]] ] -; IS________OPM-NEXT: [[TMP0:%.*]] = phi %struct.Foo* [ [[A]], [[ENTRY]] ], [ [[TMP0]], [[LOOP]] ] -; IS________OPM-NEXT: br label [[LOOP]] ; -; IS__TUNIT_NPM: Function Attrs: nofree noreturn nosync nounwind readnone -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@CaptureAStruct -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_FOO:%.*]], align 8 -; IS__TUNIT_NPM-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.Foo* [[A_PRIV]] to i32* -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[A_PRIV_CAST]], align 4 -; IS__TUNIT_NPM-NEXT: [[A_PRIV_0_1:%.*]] = getelementptr [[STRUCT_FOO]], %struct.Foo* [[A_PRIV]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: store i64 [[TMP1]], i64* [[A_PRIV_0_1]], align 8 -; IS__TUNIT_NPM-NEXT: [[A_PTR:%.*]] = alloca %struct.Foo*, align 8 -; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_NPM: loop: -; IS__TUNIT_NPM-NEXT: [[PHI:%.*]] = phi %struct.Foo* [ null, [[ENTRY:%.*]] ], [ [[A_PRIV]], [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = phi %struct.Foo* [ [[A_PRIV]], [[ENTRY]] ], [ [[TMP2]], [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: br label [[LOOP]] +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@CaptureAStruct +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_FOO:%.*]], align 8 +; NOT_CGSCC_NPM-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.Foo* [[A_PRIV]] to i32* +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[A_PRIV_CAST]], align 4 +; NOT_CGSCC_NPM-NEXT: [[A_PRIV_0_1:%.*]] = getelementptr [[STRUCT_FOO]], %struct.Foo* [[A_PRIV]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: store i64 [[TMP1]], i64* [[A_PRIV_0_1]], align 8 +; NOT_CGSCC_NPM-NEXT: [[A_PTR:%.*]] = alloca %struct.Foo*, align 8 +; NOT_CGSCC_NPM-NEXT: br label [[LOOP:%.*]] +; NOT_CGSCC_NPM: loop: +; NOT_CGSCC_NPM-NEXT: [[PHI:%.*]] = phi %struct.Foo* [ null, [[ENTRY:%.*]] ], [ [[A_PRIV]], [[LOOP]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = phi %struct.Foo* [ [[A_PRIV]], [[ENTRY]] ], [ [[TMP2]], [[LOOP]] ] +; NOT_CGSCC_NPM-NEXT: br label [[LOOP]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@CaptureAStruct -; IS__CGSCC____-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_FOO:%.*]], align 8 -; IS__CGSCC____-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.Foo* [[A_PRIV]] to i32* -; IS__CGSCC____-NEXT: [[A_PRIV_0_1:%.*]] = getelementptr [[STRUCT_FOO]], %struct.Foo* [[A_PRIV]], i32 0, i32 1 -; IS__CGSCC____-NEXT: [[A_PTR:%.*]] = alloca %struct.Foo*, align 8 -; IS__CGSCC____-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC____: loop: -; IS__CGSCC____-NEXT: [[PHI:%.*]] = phi %struct.Foo* [ null, [[ENTRY:%.*]] ], [ [[A_PRIV]], [[LOOP]] ] -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = phi %struct.Foo* [ [[A_PRIV]], [[ENTRY]] ], [ [[TMP2]], [[LOOP]] ] -; IS__CGSCC____-NEXT: br label [[LOOP]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@CaptureAStruct +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_FOO:%.*]], align 8 +; NOT_TUNIT_NPM-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.Foo* [[A_PRIV]] to i32* +; NOT_TUNIT_NPM-NEXT: [[A_PRIV_0_1:%.*]] = getelementptr [[STRUCT_FOO]], %struct.Foo* [[A_PRIV]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[A_PTR:%.*]] = alloca %struct.Foo*, align 8 +; NOT_TUNIT_NPM-NEXT: br label [[LOOP:%.*]] +; NOT_TUNIT_NPM: loop: +; NOT_TUNIT_NPM-NEXT: [[PHI:%.*]] = phi %struct.Foo* [ null, [[ENTRY:%.*]] ], [ [[A_PRIV]], [[LOOP]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = phi %struct.Foo* [ [[A_PRIV]], [[ENTRY]] ], [ [[TMP2]], [[LOOP]] ] +; NOT_TUNIT_NPM-NEXT: br label [[LOOP]] ; entry: %a_ptr = alloca %struct.Foo* @@ -156,9 +127,9 @@ br label %loop } ;. -; NOT_CGSCC_NPM: attributes #[[ATTR0:[0-9]+]] = { nofree noreturn nosync nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { nofree norecurse noreturn nosync nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree norecurse noreturn nosync nounwind readnone } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=5 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=5 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" @@ -10,27 +8,27 @@ ; Argpromote + sroa should change this to passing the two integers by value. define internal i32 @f(%struct.ss* inalloca(%struct.ss) %s) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@f -; IS__TUNIT____-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS:%.*]]) align 4 dereferenceable(8) [[S:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__TUNIT____-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT____-NEXT: [[A:%.*]] = load i32, i32* [[F0]], align 4 -; IS__TUNIT____-NEXT: [[B:%.*]] = load i32, i32* [[F1]], align 4 -; IS__TUNIT____-NEXT: [[R:%.*]] = add i32 [[A]], [[B]] -; IS__TUNIT____-NEXT: ret i32 [[R]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f +; NOT_CGSCC_NPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS:%.*]]) align 4 dereferenceable(8) [[S:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = load i32, i32* [[F0]], align 4 +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = load i32, i32* [[F1]], align 4 +; NOT_CGSCC_NPM-NEXT: [[R:%.*]] = add i32 [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[R]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@f -; IS__CGSCC____-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS:%.*]]) align 4 dereferenceable(8) [[S:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__CGSCC____-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__CGSCC____-NEXT: [[A:%.*]] = load i32, i32* [[F0]], align 4 -; IS__CGSCC____-NEXT: [[B:%.*]] = load i32, i32* [[F1]], align 4 -; IS__CGSCC____-NEXT: [[R:%.*]] = add i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: ret i32 [[R]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f +; NOT_TUNIT_NPM-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS:%.*]]) align 4 dereferenceable(8) [[S:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = load i32, i32* [[F0]], align 4 +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = load i32, i32* [[F1]], align 4 +; NOT_TUNIT_NPM-NEXT: [[R:%.*]] = add i32 [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[R]] ; entry: %f0 = getelementptr %struct.ss, %struct.ss* %s, i32 0, i32 0 @@ -42,29 +40,29 @@ } define i32 @main() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@main -; IS__TUNIT____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[S:%.*]] = alloca inalloca [[STRUCT_SS:%.*]], align 4 -; IS__TUNIT____-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__TUNIT____-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT____-NEXT: store i32 1, i32* [[F0]], align 4 -; IS__TUNIT____-NEXT: store i32 2, i32* [[F1]], align 4 -; IS__TUNIT____-NEXT: [[R:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS]]) align 4 dereferenceable(8) [[S]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 [[R]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@main +; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[S:%.*]] = alloca inalloca [[STRUCT_SS:%.*]], align 4 +; NOT_CGSCC_NPM-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[F0]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32 2, i32* [[F1]], align 4 +; NOT_CGSCC_NPM-NEXT: [[R:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS]]) align 4 dereferenceable(8) [[S]]) #[[ATTR2:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[R]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@main -; IS__CGSCC____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[S:%.*]] = alloca inalloca [[STRUCT_SS:%.*]], align 4 -; IS__CGSCC____-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 -; IS__CGSCC____-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__CGSCC____-NEXT: store i32 1, i32* [[F0]], align 4 -; IS__CGSCC____-NEXT: store i32 2, i32* [[F1]], align 4 -; IS__CGSCC____-NEXT: [[R:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS]]) align 4 dereferenceable(8) [[S]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 [[R]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@main +; NOT_TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[S:%.*]] = alloca inalloca [[STRUCT_SS:%.*]], align 4 +; NOT_TUNIT_NPM-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[F0]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32 2, i32* [[F1]], align 4 +; NOT_TUNIT_NPM-NEXT: [[R:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS]]) align 4 dereferenceable(8) [[S]]) #[[ATTR2:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[R]] ; entry: %S = alloca inalloca %struct.ss @@ -78,11 +76,11 @@ ; Argpromote can't promote %a because of the icmp use. define internal i1 @g(%struct.ss* %a, %struct.ss* inalloca(%struct.ss) %b) nounwind { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@g -; IS__CGSCC____-SAME: (%struct.ss* noalias nocapture nofree nonnull readnone align 4 dereferenceable(8) [[A:%.*]], %struct.ss* noalias nocapture nofree nonnull writeonly inalloca([[STRUCT_SS:%.*]]) align 4 dereferenceable(8) [[B:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i1 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@g +; NOT_TUNIT_NPM-SAME: (%struct.ss* noalias nocapture nofree nonnull readnone align 4 dereferenceable(8) [[A:%.*]], %struct.ss* noalias nocapture nofree nonnull writeonly inalloca([[STRUCT_SS:%.*]]) align 4 dereferenceable(8) [[B:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i1 undef ; entry: %c = icmp eq %struct.ss* %a, %b @@ -90,17 +88,17 @@ } define i32 @test() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; entry: %S = alloca inalloca %struct.ss @@ -108,11 +106,11 @@ ret i32 0 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readonly willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nounwind readonly willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead.ll @@ -1,39 +1,28 @@ ; 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-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM define internal void @dead() { -; IS__CGSCC____-LABEL: define {{[^@]+}}@dead() { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @test(i32* noalias noundef align 4294967296 null) -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@dead() { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i32 @test(i32* noalias noundef align 4294967296 null) +; NOT_TUNIT_NPM-NEXT: ret void ; call i32 @test(i32* null, i32* null) ret void } define internal i32 @test(i32* %X, i32* %Y) { -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] -; IS__CGSCC_OPM: live: -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[X]], align 4 -; IS__CGSCC_OPM-NEXT: ret i32 undef -; IS__CGSCC_OPM: dead: -; IS__CGSCC_OPM-NEXT: unreachable ; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test -; IS__CGSCC_NPM-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] -; IS__CGSCC_NPM: live: -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[X]], align 4 -; IS__CGSCC_NPM-NEXT: ret i32 undef -; IS__CGSCC_NPM: dead: -; IS__CGSCC_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test +; NOT_TUNIT_NPM-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] +; NOT_TUNIT_NPM: live: +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[X]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: dead: +; NOT_TUNIT_NPM-NEXT: unreachable ; br i1 true, label %live, label %dead live: @@ -46,19 +35,13 @@ } define internal i32 @caller(i32* %B) { -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller -; IS__CGSCC_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR3:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 undef ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller -; IS__CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller +; NOT_TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR2:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %A = alloca i32 store i32 1, i32* %A @@ -67,23 +50,17 @@ } define i32 @callercaller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@callercaller -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callercaller +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callercaller -; IS__CGSCC_OPM-SAME: () #[[ATTR2:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: ret i32 0 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callercaller -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callercaller +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; %B = alloca i32 store i32 2, i32* %B @@ -92,14 +69,9 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn writeonly } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll @@ -1,14 +1,12 @@ ; 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=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 define internal void @dead() { -; IS__CGSCC____-LABEL: define {{[^@]+}}@dead() { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @test(i32* noalias noundef align 4294967296 null) -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@dead() { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i32 @test(i32* noalias noundef align 4294967296 null) +; NOT_TUNIT_NPM-NEXT: ret void ; call i32 @test(i32* null, i32* null) ret void @@ -25,15 +23,15 @@ ; NOT_CGSCC_NPM: dead: ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test -; IS__CGSCC_NPM-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] -; IS__CGSCC_NPM: live: -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[X]], align 4 -; IS__CGSCC_NPM-NEXT: ret i32 undef -; IS__CGSCC_NPM: dead: -; IS__CGSCC_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test +; NOT_TUNIT_NPM-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] +; NOT_TUNIT_NPM: live: +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[X]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: dead: +; NOT_TUNIT_NPM-NEXT: unreachable ; br i1 true, label %live, label %dead live: @@ -53,12 +51,12 @@ ; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR2:[0-9]+]] ; NOT_CGSCC_NPM-NEXT: ret i32 undef ; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller -; IS__CGSCC_NPM-SAME: (i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller +; NOT_TUNIT_NPM-SAME: (i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR2:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %A = alloca i32 store i32 1, i32* %A @@ -67,26 +65,19 @@ } define i32 @callercaller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@callercaller -; IS__TUNIT____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callercaller +; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callercaller -; IS__CGSCC_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR3:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 0 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callercaller -; IS__CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR3:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callercaller +; NOT_TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR3:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; %B = alloca i32 store i32 2, i32* %B @@ -95,17 +86,12 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn writeonly } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn writeonly } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { nounwind willreturn writeonly } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ; PR36543 @@ -10,25 +8,25 @@ %T = type { i32, i32, i32, i32 } define internal i32 @test(%T* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test -; IS__TUNIT____-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 -; IS__TUNIT____-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 -; IS__TUNIT____-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 -; IS__TUNIT____-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 -; IS__TUNIT____-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] -; IS__TUNIT____-NEXT: ret i32 [[V]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test +; NOT_CGSCC_NPM-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 +; NOT_CGSCC_NPM-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 +; NOT_CGSCC_NPM-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[V]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test -; IS__CGSCC____-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 -; IS__CGSCC____-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 -; IS__CGSCC____-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 -; IS__CGSCC____-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 -; IS__CGSCC____-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: ret i32 [[V]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test +; NOT_TUNIT_NPM-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 +; NOT_TUNIT_NPM-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 +; NOT_TUNIT_NPM-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[V]] ; %a.gep = getelementptr %T, %T* %p, i64 0, i32 3 %b.gep = getelementptr %T, %T* %p, i64 0, i32 2 @@ -39,17 +37,17 @@ } define i32 @caller(%T* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller -; IS__TUNIT____-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[V:%.*]] = musttail call i32 @test(%T* nocapture nofree readonly [[P]]) #[[ATTR4:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 [[V]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller +; NOT_CGSCC_NPM-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[V:%.*]] = musttail call i32 @test(%T* nocapture nofree readonly [[P]]) #[[ATTR4:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[V]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller -; IS__CGSCC____-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[V:%.*]] = musttail call i32 @test(%T* nocapture nofree readonly [[P]]) #[[ATTR4:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 [[V]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller +; NOT_TUNIT_NPM-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[V:%.*]] = musttail call i32 @test(%T* nocapture nofree readonly [[P]]) #[[ATTR4:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[V]] ; %v = musttail call i32 @test(%T* %p) ret i32 %v @@ -58,24 +56,24 @@ ; Don't promote arguments of musttail caller define i32 @foo(%T* %p, i32 %v) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (%T* nocapture nofree readnone [[P:%.*]], i32 [[V:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo +; NOT_CGSCC_NPM-SAME: (%T* nocapture nofree readnone [[P:%.*]], i32 [[V:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (%T* nocapture nofree readnone [[P:%.*]], i32 [[V:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: (%T* nocapture nofree readnone [[P:%.*]], i32 [[V:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; ret i32 0 } define internal i32 @test2(%T* %p, i32 %p2) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC____-SAME: (%T* noalias nocapture nofree readnone [[P:%.*]], i32 [[P2:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_TUNIT_NPM-SAME: (%T* noalias nocapture nofree readnone [[P:%.*]], i32 [[P2:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %a.gep = getelementptr %T, %T* %p, i64 0, i32 3 %b.gep = getelementptr %T, %T* %p, i64 0, i32 2 @@ -87,15 +85,15 @@ } define i32 @caller2(%T* %g) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller2 -; IS__TUNIT____-SAME: (%T* nocapture nofree readnone [[G:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller2 +; NOT_CGSCC_NPM-SAME: (%T* nocapture nofree readnone [[G:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller2 -; IS__CGSCC____-SAME: (%T* nocapture nofree readnone [[G:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller2 +; NOT_TUNIT_NPM-SAME: (%T* nocapture nofree readnone [[G:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; %v = call i32 @test2(%T* %g, i32 0) ret i32 %v @@ -106,19 +104,19 @@ ; is kept as well. define i32 @bar(%T* %p, i32 %v) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: (%T* nocapture nofree nonnull writeonly dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: [[I32PTR:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 0 -; IS__TUNIT____-NEXT: store i32 [[V]], i32* [[I32PTR]], align 4 -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bar +; NOT_CGSCC_NPM-SAME: (%T* nocapture nofree nonnull writeonly dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[I32PTR:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 0 +; NOT_CGSCC_NPM-NEXT: store i32 [[V]], i32* [[I32PTR]], align 4 +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@bar -; IS__CGSCC____-SAME: (%T* nocapture nofree nonnull writeonly dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: [[I32PTR:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 0 -; IS__CGSCC____-NEXT: store i32 [[V]], i32* [[I32PTR]], align 4 -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bar +; NOT_TUNIT_NPM-SAME: (%T* nocapture nofree nonnull writeonly dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[I32PTR:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 0 +; NOT_TUNIT_NPM-NEXT: store i32 [[V]], i32* [[I32PTR]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; %i32ptr = getelementptr %T, %T* %p, i64 0, i32 0 store i32 %v, i32* %i32ptr @@ -126,27 +124,27 @@ } define internal i32 @test2b(%T* %p, i32 %p2) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2b -; IS__TUNIT____-SAME: (%T* nocapture nofree readonly [[P:%.*]], i32 [[P2:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 -; IS__TUNIT____-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 -; IS__TUNIT____-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 -; IS__TUNIT____-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 -; IS__TUNIT____-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] -; IS__TUNIT____-NEXT: [[CA:%.*]] = musttail call i32 @bar(%T* undef, i32 [[V]]) #[[ATTR5:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 [[CA]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2b +; NOT_CGSCC_NPM-SAME: (%T* nocapture nofree readonly [[P:%.*]], i32 [[P2:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 +; NOT_CGSCC_NPM-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 +; NOT_CGSCC_NPM-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: [[CA:%.*]] = musttail call i32 @bar(%T* undef, i32 [[V]]) #[[ATTR5:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[CA]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2b -; IS__CGSCC____-SAME: (%T* nocapture nofree readonly [[P:%.*]], i32 [[P2:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 -; IS__CGSCC____-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 -; IS__CGSCC____-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 -; IS__CGSCC____-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 -; IS__CGSCC____-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: [[CA:%.*]] = musttail call i32 @bar(%T* undef, i32 [[V]]) #[[ATTR5:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 [[CA]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test2b +; NOT_TUNIT_NPM-SAME: (%T* nocapture nofree readonly [[P:%.*]], i32 [[P2:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 +; NOT_TUNIT_NPM-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 +; NOT_TUNIT_NPM-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: [[CA:%.*]] = musttail call i32 @bar(%T* undef, i32 [[V]]) #[[ATTR5:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[CA]] ; %a.gep = getelementptr %T, %T* %p, i64 0, i32 3 %b.gep = getelementptr %T, %T* %p, i64 0, i32 2 @@ -158,35 +156,35 @@ } define i32 @caller2b(%T* %g) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller2b -; IS__TUNIT____-SAME: (%T* nocapture nofree readonly [[G:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: [[V:%.*]] = call i32 @test2b(%T* nocapture nofree readonly [[G]], i32 undef) #[[ATTR6:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller2b +; NOT_CGSCC_NPM-SAME: (%T* nocapture nofree readonly [[G:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: [[V:%.*]] = call i32 @test2b(%T* nocapture nofree readonly [[G]], i32 undef) #[[ATTR6:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller2b -; IS__CGSCC____-SAME: (%T* nocapture nofree readonly [[G:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: [[V:%.*]] = call i32 @test2b(%T* nocapture nofree readonly [[G]], i32 undef) #[[ATTR6:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller2b +; NOT_TUNIT_NPM-SAME: (%T* nocapture nofree readonly [[G:%.*]]) #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: [[V:%.*]] = call i32 @test2b(%T* nocapture nofree readonly [[G]], i32 undef) #[[ATTR6:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; %v = call i32 @test2b(%T* %g, i32 0) ret i32 %v } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR4]] = { nosync nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR5]] = { nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR6]] = { nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR5]] = { nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR6]] = { nosync nounwind willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/naked_functions.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/naked_functions.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/naked_functions.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/naked_functions.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; Don't promote paramaters of/arguments to naked functions diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/nonzero-address-spaces.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/nonzero-address-spaces.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/nonzero-address-spaces.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/nonzero-address-spaces.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; ArgumentPromotion should preserve the default function address space diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr27568.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr27568.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr27568.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr27568.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM target triple = "x86_64-pc-windows-msvc" diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr32917.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr32917.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr32917.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr32917.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ; PR 32917 @@ -13,23 +11,23 @@ ; CHECK: @[[A:[a-zA-Z0-9_$"\\.-]+]] = common local_unnamed_addr global i32 0, align 4 ;. define i32 @fn2() local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@fn2 -; IS__TUNIT____-SAME: () local_unnamed_addr #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32, i32* @b, align 4 -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = sext i32 [[TMP1]] to i64 -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = inttoptr i64 [[TMP2]] to i32* -; IS__TUNIT____-NEXT: call fastcc void @fn1(i32* nocapture nofree readonly align 4 [[TMP3]]) #[[ATTR0]] -; IS__TUNIT____-NEXT: ret i32 undef +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@fn2 +; NOT_CGSCC_NPM-SAME: () local_unnamed_addr #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* @b, align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = sext i32 [[TMP1]] to i64 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = inttoptr i64 [[TMP2]] to i32* +; NOT_CGSCC_NPM-NEXT: call fastcc void @fn1(i32* nocapture nofree readonly align 4 [[TMP3]]) #[[ATTR0]] +; NOT_CGSCC_NPM-NEXT: ret i32 undef ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@fn2 -; IS__CGSCC____-SAME: () local_unnamed_addr #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = load i32, i32* @b, align 4 -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = sext i32 [[TMP1]] to i64 -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = inttoptr i64 [[TMP2]] to i32* -; IS__CGSCC____-NEXT: call fastcc void @fn1(i32* nocapture nofree nonnull readonly align 4 [[TMP3]]) #[[ATTR1:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fn2 +; NOT_TUNIT_NPM-SAME: () local_unnamed_addr #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* @b, align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = sext i32 [[TMP1]] to i64 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = inttoptr i64 [[TMP2]] to i32* +; NOT_TUNIT_NPM-NEXT: call fastcc void @fn1(i32* nocapture nofree nonnull readonly align 4 [[TMP3]]) #[[ATTR1:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %1 = load i32, i32* @b, align 4 %2 = sext i32 %1 to i64 @@ -39,21 +37,21 @@ } define internal fastcc void @fn1(i32* nocapture readonly) unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@fn1 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly align 4 [[TMP0:%.*]]) unnamed_addr #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 -1 -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS__TUNIT____-NEXT: store i32 [[TMP3]], i32* @a, align 4 -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@fn1 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readonly align 4 [[TMP0:%.*]]) unnamed_addr #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 -1 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP3]], i32* @a, align 4 +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@fn1 -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readonly align 4 [[TMP0:%.*]]) unnamed_addr #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 -1 -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS__CGSCC____-NEXT: store i32 [[TMP3]], i32* @a, align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fn1 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readonly align 4 [[TMP0:%.*]]) unnamed_addr #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 -1 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32 [[TMP3]], i32* @a, align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; %2 = getelementptr inbounds i32, i32* %0, i64 -1 %3 = load i32, i32* %2, align 4 @@ -61,8 +59,8 @@ ret void } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nounwind willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; Fix for PR33641. ArgumentPromotion removed the argument to bar but left the call to @@ -14,17 +12,17 @@ %fun_t = type void (%p_t)* define void @foo() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP:%.*]] = alloca void (i16*)*, align 8 -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = alloca void (i16*)*, align 8 +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP:%.*]] = alloca void (i16*)*, align 8 -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = alloca void (i16*)*, align 8 +; NOT_TUNIT_NPM-NEXT: ret void ; %tmp = alloca %fun_t store %fun_t @bar, %fun_t* %tmp @@ -32,16 +30,12 @@ } define internal void @bar(%p_t %p) { -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bar -; IS__CGSCC_OPM-SAME: (i16* [[P:%.*]]) { -; IS__CGSCC_OPM-NEXT: call void @llvm.dbg.value(metadata i16* [[P]], metadata [[META3:![0-9]+]], metadata !DIExpression()), !dbg [[DBG5:![0-9]+]] -; IS__CGSCC_OPM-NEXT: ret void ; -; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bar -; IS__CGSCC_NPM-SAME: (i16* nocapture nofree readnone [[P:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: call void @llvm.dbg.value(metadata i16* [[P]], metadata [[META3:![0-9]+]], metadata !DIExpression()) #[[ATTR3:[0-9]+]], !dbg [[DBG5:![0-9]+]] -; IS__CGSCC_NPM-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bar +; NOT_TUNIT_NPM-SAME: (i16* nocapture nofree readnone [[P:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: call void @llvm.dbg.value(metadata i16* [[P]], metadata [[META3:![0-9]+]], metadata !DIExpression()) #[[ATTR3:[0-9]+]], !dbg [[DBG5:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @llvm.dbg.value(metadata %p_t %p, metadata !4, metadata !5), !dbg !6 ret void @@ -60,25 +54,22 @@ !5 = !DIExpression() !6 = !DILocation(line: 1, column: 1, scope: !3) ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } ;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { readnone willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { readnone willreturn } +; NOT_CGSCC_NPM: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug) +; NOT_CGSCC_NPM: [[META1:![0-9]+]] = !DIFile(filename: "test.c", directory: "") +; NOT_CGSCC_NPM: [[META2:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3} ;. -; IS__TUNIT____: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug) -; IS__TUNIT____: [[META1:![0-9]+]] = !DIFile(filename: "test.c", directory: "") -; IS__TUNIT____: [[META2:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3} -;. -; IS__CGSCC____: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug) -; IS__CGSCC____: [[META1:![0-9]+]] = !DIFile(filename: "test.c", directory: "") -; IS__CGSCC____: [[META2:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3} -; IS__CGSCC____: [[META3:![0-9]+]] = !DILocalVariable(name: "p", scope: !4) -; IS__CGSCC____: [[META4:![0-9]+]] = distinct !DISubprogram(name: "bar", scope: null, spFlags: DISPFlagDefinition, unit: !0) -; IS__CGSCC____: [[META5:![0-9]+]] = !DILocation(line: 1, column: 1, scope: !4) +; NOT_TUNIT_NPM: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug) +; NOT_TUNIT_NPM: [[META1:![0-9]+]] = !DIFile(filename: "test.c", directory: "") +; NOT_TUNIT_NPM: [[META2:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3} +; NOT_TUNIT_NPM: [[META3]] = !DILocalVariable(name: "p", scope: !4) +; NOT_TUNIT_NPM: [[META4:![0-9]+]] = distinct !DISubprogram(name: "bar", scope: null, spFlags: DISPFlagDefinition, unit: !0) +; NOT_TUNIT_NPM: [[DBG5]] = !DILocation(line: 1, column: 1, scope: !4) ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/profile.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/profile.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/profile.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/profile.ll @@ -1,29 +1,22 @@ ; 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-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" ; Checks if !prof metadata is corret in deadargelim. define void @caller() #0 { -; IS________OPM-LABEL: define {{[^@]+}}@caller() { -; IS________OPM-NEXT: [[X:%.*]] = alloca i32, align 4 -; IS________OPM-NEXT: store i32 42, i32* [[X]], align 4 -; IS________OPM-NEXT: call void @promote_i32_ptr(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X]]), !prof [[PROF0:![0-9]+]] -; IS________OPM-NEXT: ret void ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@caller() { -; IS__TUNIT_NPM-NEXT: [[X:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 42, i32* [[X]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[X]], align 4 -; IS__TUNIT_NPM-NEXT: call void @promote_i32_ptr(i32 [[TMP1]]), !prof [[PROF0:![0-9]+]] -; IS__TUNIT_NPM-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller() { +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 42, i32* [[X]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[X]], align 4 +; NOT_CGSCC_NPM-NEXT: call void @promote_i32_ptr(i32 [[TMP1]]), !prof [[PROF0:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller() { -; IS__CGSCC_NPM-NEXT: call void @promote_i32_ptr(i32 undef), !prof [[PROF0:![0-9]+]] -; IS__CGSCC_NPM-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller() { +; NOT_TUNIT_NPM-NEXT: call void @promote_i32_ptr(i32 undef), !prof [[PROF0:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret void ; %x = alloca i32 store i32 42, i32* %x @@ -32,26 +25,21 @@ } define internal void @promote_i32_ptr(i32* %xp) { -; IS________OPM-LABEL: define {{[^@]+}}@promote_i32_ptr -; IS________OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[XP:%.*]]) { -; IS________OPM-NEXT: [[X:%.*]] = load i32, i32* [[XP]], align 4 -; IS________OPM-NEXT: call void @use_i32(i32 [[X]]) -; IS________OPM-NEXT: ret void ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@promote_i32_ptr -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) { -; IS__TUNIT_NPM-NEXT: [[XP_PRIV:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[XP_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[X:%.*]] = load i32, i32* [[XP_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: call void @use_i32(i32 [[X]]) -; IS__TUNIT_NPM-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@promote_i32_ptr +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) { +; NOT_CGSCC_NPM-NEXT: [[XP_PRIV:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[XP_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = load i32, i32* [[XP_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: call void @use_i32(i32 [[X]]) +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@promote_i32_ptr -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) { -; IS__CGSCC_NPM-NEXT: [[XP_PRIV:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[X:%.*]] = load i32, i32* [[XP_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: call void @use_i32(i32 42) -; IS__CGSCC_NPM-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@promote_i32_ptr +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) { +; NOT_TUNIT_NPM-NEXT: [[XP_PRIV:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = load i32, i32* [[XP_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: call void @use_i32(i32 42) +; NOT_TUNIT_NPM-NEXT: ret void ; %x = load i32, i32* %xp call void @use_i32(i32 %x) diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/reserve-tbaa.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/reserve-tbaa.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/reserve-tbaa.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/reserve-tbaa.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ; PR17906 @@ -24,23 +22,23 @@ ; CHECK: @[[D:[a-zA-Z0-9_$"\\.-]+]] = global i8 0, align 1 ;. define internal fastcc void @fn(i32* nocapture readonly %p1, i64* nocapture readonly %p2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@fn -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* @g, align 4, !tbaa [[TBAA0:![0-9]+]] -; IS__TUNIT____-NEXT: [[CONV1:%.*]] = trunc i32 [[TMP0]] to i8 -; IS__TUNIT____-NEXT: store i8 [[CONV1]], i8* @d, align 1, !tbaa [[TBAA4:![0-9]+]] -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@fn +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* @g, align 4, !tbaa [[TBAA0:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[CONV1:%.*]] = trunc i32 [[TMP0]] to i8 +; NOT_CGSCC_NPM-NEXT: store i8 [[CONV1]], i8* @d, align 1, !tbaa [[TBAA4:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@fn -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* @g, align 4, !tbaa [[TBAA0:![0-9]+]] -; IS__CGSCC____-NEXT: [[CONV1:%.*]] = trunc i32 [[TMP0]] to i8 -; IS__CGSCC____-NEXT: store i8 [[CONV1]], i8* @d, align 1, !tbaa [[TBAA4:![0-9]+]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fn +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* @g, align 4, !tbaa [[TBAA0:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[CONV1:%.*]] = trunc i32 [[TMP0]] to i8 +; NOT_TUNIT_NPM-NEXT: store i8 [[CONV1]], i8* @d, align 1, !tbaa [[TBAA4:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %0 = load i64, i64* %p2, align 8, !tbaa !1 @@ -52,27 +50,27 @@ } define i32 @main() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@main -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32**, i32*** @e, align 8, !tbaa [[TBAA5:![0-9]+]] -; IS__TUNIT____-NEXT: store i32* @g, i32** [[TMP0]], align 8, !tbaa [[TBAA5]] -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32*, i32** @a, align 8, !tbaa [[TBAA5]] -; IS__TUNIT____-NEXT: store i32 1, i32* [[TMP1]], align 4, !tbaa [[TBAA0]] -; IS__TUNIT____-NEXT: call fastcc void @fn() #[[ATTR0]] -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@main +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32**, i32*** @e, align 8, !tbaa [[TBAA5:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: store i32* @g, i32** [[TMP0]], align 8, !tbaa [[TBAA5]] +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32*, i32** @a, align 8, !tbaa [[TBAA5]] +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[TMP1]], align 4, !tbaa [[TBAA0]] +; NOT_CGSCC_NPM-NEXT: call fastcc void @fn() #[[ATTR0]] +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@main -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32**, i32*** @e, align 8, !tbaa [[TBAA5:![0-9]+]] -; IS__CGSCC____-NEXT: store i32* @g, i32** [[TMP0]], align 8, !tbaa [[TBAA5]] -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = load i32*, i32** @a, align 8, !tbaa [[TBAA5]] -; IS__CGSCC____-NEXT: store i32 1, i32* [[TMP1]], align 4, !tbaa [[TBAA0]] -; IS__CGSCC____-NEXT: call fastcc void @fn() #[[ATTR1:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@main +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32**, i32*** @e, align 8, !tbaa [[TBAA5:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: store i32* @g, i32** [[TMP0]], align 8, !tbaa [[TBAA5]] +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32*, i32** @a, align 8, !tbaa [[TBAA5]] +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[TMP1]], align 4, !tbaa [[TBAA0]] +; NOT_TUNIT_NPM-NEXT: call fastcc void @fn() #[[ATTR1:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; entry: %0 = load i32**, i32*** @e, align 8, !tbaa !8 @@ -95,10 +93,10 @@ !9 = !{!"any pointer", !3, i64 0} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nounwind willreturn } ;. ; CHECK: [[META0:![0-9]+]] = !{!1, !1, i64 0} ; CHECK: [[META1:![0-9]+]] = !{!"int", !2, i64 0} diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" @@ -9,49 +7,28 @@ define internal void @add({i32, i32}* %this, i32* sret(i32) %r) { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@add -; IS__TUNIT_OPM-SAME: ({ i32, i32 }* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[THIS:%.*]], i32* nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: [[AP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 0 -; IS__TUNIT_OPM-NEXT: [[BP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 1 -; IS__TUNIT_OPM-NEXT: [[A:%.*]] = load i32, i32* [[AP]], align 8 -; IS__TUNIT_OPM-NEXT: [[B:%.*]] = load i32, i32* [[BP]], align 4 -; IS__TUNIT_OPM-NEXT: [[AB:%.*]] = add i32 [[A]], [[B]] -; IS__TUNIT_OPM-NEXT: store i32 [[AB]], i32* [[R]], align 4 -; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@add -; IS__TUNIT_NPM-SAME: ({ i32, i32 }* noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[THIS:%.*]], i32* noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[AP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 0 -; IS__TUNIT_NPM-NEXT: [[BP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[A:%.*]] = load i32, i32* [[AP]], align 8 -; IS__TUNIT_NPM-NEXT: [[B:%.*]] = load i32, i32* [[BP]], align 4 -; IS__TUNIT_NPM-NEXT: [[AB:%.*]] = add i32 [[A]], [[B]] -; IS__TUNIT_NPM-NEXT: store i32 [[AB]], i32* [[R]], align 4 -; IS__TUNIT_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@add +; NOT_CGSCC_NPM-SAME: ({ i32, i32 }* noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[THIS:%.*]], i32* noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[AP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: [[BP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = load i32, i32* [[AP]], align 8 +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = load i32, i32* [[BP]], align 4 +; NOT_CGSCC_NPM-NEXT: [[AB:%.*]] = add i32 [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: store i32 [[AB]], i32* [[R]], align 4 +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@add -; IS__CGSCC_OPM-SAME: ({ i32, i32 }* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[THIS:%.*]], i32* nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[AP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 0 -; IS__CGSCC_OPM-NEXT: [[BP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 1 -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = load i32, i32* [[AP]], align 8 -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = load i32, i32* [[BP]], align 4 -; IS__CGSCC_OPM-NEXT: [[AB:%.*]] = add i32 [[A]], [[B]] -; IS__CGSCC_OPM-NEXT: store i32 [[AB]], i32* [[R]], align 4 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@add -; IS__CGSCC_NPM-SAME: ({ i32, i32 }* noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[THIS:%.*]], i32* noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[AP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 0 -; IS__CGSCC_NPM-NEXT: [[BP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = load i32, i32* [[AP]], align 8 -; IS__CGSCC_NPM-NEXT: [[B:%.*]] = load i32, i32* [[BP]], align 4 -; IS__CGSCC_NPM-NEXT: [[AB:%.*]] = add i32 [[A]], [[B]] -; IS__CGSCC_NPM-NEXT: store i32 [[AB]], i32* [[R]], align 4 -; IS__CGSCC_NPM-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@add +; NOT_TUNIT_NPM-SAME: ({ i32, i32 }* noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[THIS:%.*]], i32* noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[AP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: [[BP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = load i32, i32* [[AP]], align 8 +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = load i32, i32* [[BP]], align 4 +; NOT_TUNIT_NPM-NEXT: [[AB:%.*]] = add i32 [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: store i32 [[AB]], i32* [[R]], align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; %ap = getelementptr {i32, i32}, {i32, i32}* %this, i32 0, i32 0 %bp = getelementptr {i32, i32}, {i32, i32}* %this, i32 0, i32 1 @@ -63,37 +40,22 @@ } define void @f() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@f -; IS__TUNIT_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: [[R:%.*]] = alloca i32, align 4 -; IS__TUNIT_OPM-NEXT: [[PAIR:%.*]] = alloca { i32, i32 }, align 8 -; IS__TUNIT_OPM-NEXT: call void @add({ i32, i32 }* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[PAIR]], i32* nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f -; IS__TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[R:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: [[PAIR:%.*]] = alloca { i32, i32 }, align 8 -; IS__TUNIT_NPM-NEXT: call void @add({ i32, i32 }* noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[PAIR]], i32* noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[R:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: [[PAIR:%.*]] = alloca { i32, i32 }, align 8 -; IS__CGSCC_OPM-NEXT: call void @add({ i32, i32 }* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[PAIR]], i32* nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f +; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[R:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: [[PAIR:%.*]] = alloca { i32, i32 }, align 8 +; NOT_CGSCC_NPM-NEXT: call void @add({ i32, i32 }* noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[PAIR]], i32* noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R]]) #[[ATTR2:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[R:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[PAIR:%.*]] = alloca { i32, i32 }, align 8 -; IS__CGSCC_NPM-NEXT: call void @add({ i32, i32 }* noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[PAIR]], i32* noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f +; NOT_TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[R:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[PAIR:%.*]] = alloca { i32, i32 }, align 8 +; NOT_TUNIT_NPM-NEXT: call void @add({ i32, i32 }* noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[PAIR]], i32* noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R]]) #[[ATTR2:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret void ; %r = alloca i32 %pair = alloca {i32, i32} @@ -102,11 +64,11 @@ ret void } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR1:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR2:[0-9]+]] = { nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nounwind willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 ; PR14710 @@ -12,68 +10,50 @@ declare i8* @foo(%pair*) define internal void @bar(%pair* byval(%pair) %Data) { -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@bar -; IS__TUNIT_OPM-SAME: (%pair* noalias nonnull byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) { -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = tail call i8* @foo(%pair* nonnull dereferenceable(8) [[DATA]]) -; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@bar -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) { -; IS__TUNIT_NPM-NEXT: [[DATA_PRIV:%.*]] = alloca [[PAIR:%.*]], align 8 -; IS__TUNIT_NPM-NEXT: [[DATA_PRIV_CAST:%.*]] = bitcast %pair* [[DATA_PRIV]] to i32* -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[DATA_PRIV_CAST]], align 4 -; IS__TUNIT_NPM-NEXT: [[DATA_PRIV_0_1:%.*]] = getelementptr [[PAIR]], %pair* [[DATA_PRIV]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP1]], i32* [[DATA_PRIV_0_1]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = call i8* @foo(%pair* nonnull dereferenceable(8) [[DATA_PRIV]]) -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bar -; IS__CGSCC_OPM-SAME: (%pair* noalias noundef nonnull byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) { -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = tail call i8* @foo(%pair* noundef nonnull dereferenceable(8) [[DATA]]) -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bar -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) { -; IS__CGSCC_NPM-NEXT: [[DATA_PRIV:%.*]] = alloca [[PAIR:%.*]], align 8 -; IS__CGSCC_NPM-NEXT: [[DATA_PRIV_CAST:%.*]] = bitcast %pair* [[DATA_PRIV]] to i32* -; IS__CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[DATA_PRIV_CAST]], align 8 -; IS__CGSCC_NPM-NEXT: [[DATA_PRIV_0_1:%.*]] = getelementptr [[PAIR]], %pair* [[DATA_PRIV]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: store i32 [[TMP1]], i32* [[DATA_PRIV_0_1]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = call i8* @foo(%pair* noundef nonnull align 8 dereferenceable(8) [[DATA_PRIV]]) -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bar +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) { +; NOT_CGSCC_NPM-NEXT: [[DATA_PRIV:%.*]] = alloca [[PAIR:%.*]], align 8 +; NOT_CGSCC_NPM-NEXT: [[DATA_PRIV_CAST:%.*]] = bitcast %pair* [[DATA_PRIV]] to i32* +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[DATA_PRIV_CAST]], align 4 +; NOT_CGSCC_NPM-NEXT: [[DATA_PRIV_0_1:%.*]] = getelementptr [[PAIR]], %pair* [[DATA_PRIV]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP1]], i32* [[DATA_PRIV_0_1]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = call i8* @foo(%pair* nonnull dereferenceable(8) [[DATA_PRIV]]) +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bar +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) { +; NOT_TUNIT_NPM-NEXT: [[DATA_PRIV:%.*]] = alloca [[PAIR:%.*]], align 8 +; NOT_TUNIT_NPM-NEXT: [[DATA_PRIV_CAST:%.*]] = bitcast %pair* [[DATA_PRIV]] to i32* +; NOT_TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[DATA_PRIV_CAST]], align 8 +; NOT_TUNIT_NPM-NEXT: [[DATA_PRIV_0_1:%.*]] = getelementptr [[PAIR]], %pair* [[DATA_PRIV]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: store i32 [[TMP1]], i32* [[DATA_PRIV_0_1]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = call i8* @foo(%pair* noundef nonnull align 8 dereferenceable(8) [[DATA_PRIV]]) +; NOT_TUNIT_NPM-NEXT: ret void ; tail call i8* @foo(%pair* %Data) ret void } define void @zed(%pair* byval(%pair) %Data) { -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@zed -; IS__TUNIT_OPM-SAME: (%pair* noalias nocapture nonnull readonly byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) { -; IS__TUNIT_OPM-NEXT: call void @bar(%pair* noalias nocapture nonnull readonly byval([[PAIR]]) dereferenceable(8) [[DATA]]) -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@zed -; IS__TUNIT_NPM-SAME: (%pair* noalias nocapture nonnull readonly byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) { -; IS__TUNIT_NPM-NEXT: [[DATA_CAST:%.*]] = bitcast %pair* [[DATA]] to i32* -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[DATA_CAST]], align 1 -; IS__TUNIT_NPM-NEXT: [[DATA_0_1:%.*]] = getelementptr [[PAIR]], %pair* [[DATA]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[DATA_0_1]], align 1 -; IS__TUNIT_NPM-NEXT: call void @bar(i32 [[TMP1]], i32 [[TMP2]]) -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@zed -; IS__CGSCC_OPM-SAME: (%pair* noalias nocapture noundef nonnull readonly byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) { -; IS__CGSCC_OPM-NEXT: call void @bar(%pair* noalias nocapture noundef nonnull readonly byval([[PAIR]]) dereferenceable(8) [[DATA]]) -; IS__CGSCC_OPM-NEXT: ret void ; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@zed -; IS__CGSCC_NPM-SAME: (%pair* noalias nocapture nofree nonnull readonly byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) { -; IS__CGSCC_NPM-NEXT: [[DATA_CAST:%.*]] = bitcast %pair* [[DATA]] to i32* -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[DATA_CAST]], align 1 -; IS__CGSCC_NPM-NEXT: [[DATA_0_1:%.*]] = getelementptr [[PAIR]], %pair* [[DATA]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[DATA_0_1]], align 1 -; IS__CGSCC_NPM-NEXT: call void @bar(i32 [[TMP1]], i32 [[TMP2]]) -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@zed +; NOT_CGSCC_NPM-SAME: (%pair* noalias nocapture nonnull readonly byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) { +; NOT_CGSCC_NPM-NEXT: [[DATA_CAST:%.*]] = bitcast %pair* [[DATA]] to i32* +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[DATA_CAST]], align 1 +; NOT_CGSCC_NPM-NEXT: [[DATA_0_1:%.*]] = getelementptr [[PAIR]], %pair* [[DATA]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[DATA_0_1]], align 1 +; NOT_CGSCC_NPM-NEXT: call void @bar(i32 [[TMP1]], i32 [[TMP2]]) +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@zed +; NOT_TUNIT_NPM-SAME: (%pair* noalias nocapture nofree nonnull readonly byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) { +; NOT_TUNIT_NPM-NEXT: [[DATA_CAST:%.*]] = bitcast %pair* [[DATA]] to i32* +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[DATA_CAST]], align 1 +; NOT_TUNIT_NPM-NEXT: [[DATA_0_1:%.*]] = getelementptr [[PAIR]], %pair* [[DATA]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[DATA_0_1]], align 1 +; NOT_TUNIT_NPM-NEXT: call void @bar(i32 [[TMP1]], i32 [[TMP2]]) +; NOT_TUNIT_NPM-NEXT: ret void ; call void @bar(%pair* byval(%pair) %Data) ret void diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/variadic.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/variadic.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/variadic.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/variadic.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; Unused arguments from variadic functions cannot be eliminated as that changes diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/2008-06-09-WeakProp.ll b/llvm/test/Transforms/Attributor/IPConstantProp/2008-06-09-WeakProp.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/2008-06-09-WeakProp.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/2008-06-09-WeakProp.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; Should not propagate the result of a weak function. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll b/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 ; Don't constant-propagate byval pointers, since they are not pointers! @@ -14,55 +12,42 @@ ; CHECK: @[[MYSTR:[a-zA-Z0-9_$"\\.-]+]] = internal global [[STRUCT_MYSTR:%.*]] zeroinitializer ;. define internal void @vfu1(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind { -; IS________OPM: Function Attrs: nounwind -; IS________OPM-LABEL: define {{[^@]+}}@vfu1 -; IS________OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) [[U:%.*]]) #[[ATTR0:[0-9]+]] { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 -; IS________OPM-NEXT: store i32 99, i32* [[TMP0]], align 4 -; IS________OPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0 -; IS________OPM-NEXT: store i8 97, i8* [[TMP1]], align 8 -; IS________OPM-NEXT: [[L:%.*]] = load i8, i8* [[TMP1]], align 8 -; IS________OPM-NEXT: call void @use(i8 [[L]]) -; IS________OPM-NEXT: br label [[RETURN:%.*]] -; IS________OPM: return: -; IS________OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: nounwind -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@vfu1 -; IS__TUNIT_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 -; IS__TUNIT_NPM-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* -; IS__TUNIT_NPM-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 1 -; IS__TUNIT_NPM-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: store i32 99, i32* [[TMP2]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 -; IS__TUNIT_NPM-NEXT: store i8 97, i8* [[TMP3]], align 8 -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i8, i8* [[TMP3]], align 8 -; IS__TUNIT_NPM-NEXT: call void @use(i8 [[L]]) -; IS__TUNIT_NPM-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT_NPM: return: -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nounwind -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@vfu1 -; IS__CGSCC_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 -; IS__CGSCC_NPM-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* -; IS__CGSCC_NPM-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 8 -; IS__CGSCC_NPM-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 -; IS__CGSCC_NPM-NEXT: store i8 97, i8* [[TMP3]], align 8 -; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i8, i8* [[TMP3]], align 8 -; IS__CGSCC_NPM-NEXT: call void @use(i8 [[L]]) -; IS__CGSCC_NPM-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC_NPM: return: -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@vfu1 +; NOT_CGSCC_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 +; NOT_CGSCC_NPM-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* +; NOT_CGSCC_NPM-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 1 +; NOT_CGSCC_NPM-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: store i32 99, i32* [[TMP2]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: store i8 97, i8* [[TMP3]], align 8 +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i8, i8* [[TMP3]], align 8 +; NOT_CGSCC_NPM-NEXT: call void @use(i8 [[L]]) +; NOT_CGSCC_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@vfu1 +; NOT_TUNIT_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 +; NOT_TUNIT_NPM-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* +; NOT_TUNIT_NPM-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 8 +; NOT_TUNIT_NPM-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: store i8 97, i8* [[TMP3]], align 8 +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = load i8, i8* [[TMP3]], align 8 +; NOT_TUNIT_NPM-NEXT: call void @use(i8 [[L]]) +; NOT_TUNIT_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %0 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 ; [#uses=1] @@ -78,63 +63,40 @@ } define internal i32 @vfu2(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind readonly { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@vfu2 -; IS__TUNIT_OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) [[U:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = load i8, i8* [[TMP2]], align 8 -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = zext i8 [[TMP3]] to i32 -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = add i32 [[TMP4]], [[TMP1]] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP5]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@vfu2 -; IS__TUNIT_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 -; IS__TUNIT_NPM-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* -; IS__TUNIT_NPM-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 1 -; IS__TUNIT_NPM-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 8 -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = zext i8 [[TMP5]] to i32 -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP3]] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP7]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@vfu2 -; IS__CGSCC_OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) [[U:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = load i8, i8* [[TMP2]], align 8 -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = zext i8 [[TMP3]] to i32 -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = add i32 [[TMP4]], [[TMP1]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP5]] ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@vfu2 -; IS__CGSCC_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 -; IS__CGSCC_NPM-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* -; IS__CGSCC_NPM-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 8 -; IS__CGSCC_NPM-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 8 -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = zext i8 [[TMP0]] to i32 -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP1]] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP7]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@vfu2 +; NOT_CGSCC_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 +; NOT_CGSCC_NPM-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* +; NOT_CGSCC_NPM-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 1 +; NOT_CGSCC_NPM-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 8 +; NOT_CGSCC_NPM-NEXT: [[TMP6:%.*]] = zext i8 [[TMP5]] to i32 +; NOT_CGSCC_NPM-NEXT: [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP3]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP7]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@vfu2 +; NOT_TUNIT_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 +; NOT_TUNIT_NPM-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* +; NOT_TUNIT_NPM-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 8 +; NOT_TUNIT_NPM-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 8 +; NOT_TUNIT_NPM-NEXT: [[TMP6:%.*]] = zext i8 [[TMP0]] to i32 +; NOT_TUNIT_NPM-NEXT: [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP1]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP7]] ; entry: %0 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 ; [#uses=1] @@ -147,49 +109,34 @@ } define i32 @unions() nounwind { -; IS__TUNIT_OPM: Function Attrs: nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@unions -; IS__TUNIT_OPM-SAME: () #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: call void @vfu1(%struct.MYstr* nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) @mystr) #[[ATTR0]] -; IS__TUNIT_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(%struct.MYstr* nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR]]) align 8 dereferenceable(8) @mystr) #[[ATTR2:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret i32 [[RESULT]] -; -; IS__TUNIT_NPM: Function Attrs: nounwind -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unions -; IS__TUNIT_NPM-SAME: () #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[MYSTR_CAST1:%.*]] = bitcast %struct.MYstr* @mystr to i8* -; 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, i32 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, i32 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]] -; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@unions -; IS__CGSCC_OPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: call void @vfu1(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) @mystr) #[[ATTR0]] -; IS__CGSCC_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR]]) align 8 dereferenceable(8) @mystr) #[[ATTR0]] -; IS__CGSCC_OPM-NEXT: ret i32 [[RESULT]] ; -; IS__CGSCC_NPM: Function Attrs: nounwind -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@unions -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i8, i8* getelementptr inbounds ([[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 0), align 8 -; IS__CGSCC_NPM-NEXT: call void @vfu1(i8 [[TMP0]], i32 undef) #[[ATTR0]] -; IS__CGSCC_NPM-NEXT: [[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, i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[MYSTR_0_12]], align 8 -; IS__CGSCC_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP1]], i32 [[TMP2]]) #[[ATTR0]] -; IS__CGSCC_NPM-NEXT: ret i32 [[RESULT]] +; NOT_CGSCC_NPM: Function Attrs: nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@unions +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[MYSTR_CAST:%.*]] = bitcast %struct.MYstr* @mystr to i8* +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i8, i8* [[MYSTR_CAST]], align 8 +; NOT_CGSCC_NPM-NEXT: [[MYSTR_0_1:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[MYSTR_0_1]], align 8 +; NOT_CGSCC_NPM-NEXT: call void @vfu1(i8 [[TMP0]], i32 [[TMP1]]) #[[ATTR0]] +; NOT_CGSCC_NPM-NEXT: [[MYSTR_CAST1:%.*]] = bitcast %struct.MYstr* @mystr to i8* +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i8, i8* [[MYSTR_CAST1]], align 8 +; NOT_CGSCC_NPM-NEXT: [[MYSTR_0_12:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[MYSTR_0_12]], align 8 +; NOT_CGSCC_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP2]], i32 [[TMP3]]) #[[ATTR2:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[RESULT]] +; +; NOT_TUNIT_NPM: Function Attrs: nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@unions +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i8, i8* getelementptr inbounds ([[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 0), align 8 +; NOT_TUNIT_NPM-NEXT: call void @vfu1(i8 [[TMP0]], i32 undef) #[[ATTR0]] +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i8, i8* getelementptr inbounds ([[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 0), align 8 +; NOT_TUNIT_NPM-NEXT: [[MYSTR_0_12:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[MYSTR_0_12]], align 8 +; NOT_TUNIT_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP1]], i32 [[TMP2]]) #[[ATTR0]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[RESULT]] ; entry: call void @vfu1(%struct.MYstr* byval(%struct.MYstr) align 4 @mystr) nounwind @@ -198,70 +145,43 @@ } define internal i32 @vfu2_v2(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind readonly { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@vfu2_v2 -; IS__TUNIT_OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) [[U:%.*]]) #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[Z:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 -; IS__TUNIT_OPM-NEXT: store i32 99, i32* [[Z]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = load i8, i8* [[TMP2]], align 8 -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = zext i8 [[TMP3]] to i32 -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = add i32 [[TMP4]], [[TMP1]] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP5]] ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@vfu2_v2 -; IS__TUNIT_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 -; IS__TUNIT_NPM-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* -; IS__TUNIT_NPM-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 1 -; IS__TUNIT_NPM-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4 -; IS__TUNIT_NPM-NEXT: [[Z:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: store i32 99, i32* [[Z]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 8 -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = zext i8 [[TMP5]] to i32 -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP3]] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP7]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@vfu2_v2 -; IS__CGSCC_OPM-SAME: (%struct.MYstr* noalias nocapture nofree noundef nonnull byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) [[U:%.*]]) #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[Z:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 -; IS__CGSCC_OPM-NEXT: store i32 99, i32* [[Z]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 1 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = load i8, i8* [[TMP2]], align 8 -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = zext i8 [[TMP3]] to i32 -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = add i32 [[TMP4]], [[TMP1]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP5]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@vfu2_v2 -; IS__CGSCC_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 -; IS__CGSCC_NPM-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* -; IS__CGSCC_NPM-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[U_PRIV_0_1]], align 4 -; IS__CGSCC_NPM-NEXT: [[Z:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: store i32 99, i32* [[Z]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 8 -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = zext i8 0 to i32 -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = add i32 0, [[TMP3]] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP7]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@vfu2_v2 +; NOT_CGSCC_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 +; NOT_CGSCC_NPM-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* +; NOT_CGSCC_NPM-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 1 +; NOT_CGSCC_NPM-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4 +; NOT_CGSCC_NPM-NEXT: [[Z:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: store i32 99, i32* [[Z]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 8 +; NOT_CGSCC_NPM-NEXT: [[TMP6:%.*]] = zext i8 [[TMP5]] to i32 +; NOT_CGSCC_NPM-NEXT: [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP3]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP7]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@vfu2_v2 +; NOT_TUNIT_NPM-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 +; NOT_TUNIT_NPM-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* +; NOT_TUNIT_NPM-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[U_PRIV_0_1]], align 4 +; NOT_TUNIT_NPM-NEXT: [[Z:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: store i32 99, i32* [[Z]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 8 +; NOT_TUNIT_NPM-NEXT: [[TMP6:%.*]] = zext i8 0 to i32 +; NOT_TUNIT_NPM-NEXT: [[TMP7:%.*]] = add i32 0, [[TMP3]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP7]] ; entry: %z = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 @@ -276,45 +196,30 @@ } define i32 @unions_v2() nounwind { -; IS__TUNIT_OPM: Function Attrs: nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@unions_v2 -; IS__TUNIT_OPM-SAME: () #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: call void @vfu1(%struct.MYstr* nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) @mystr) #[[ATTR0]] -; IS__TUNIT_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(%struct.MYstr* nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR]]) align 8 dereferenceable(8) @mystr) #[[ATTR2]] -; IS__TUNIT_OPM-NEXT: ret i32 [[RESULT]] -; -; IS__TUNIT_NPM: Function Attrs: nounwind -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unions_v2 -; 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, i32 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, i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[MYSTR_0_12]], align 8 -; IS__TUNIT_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(i8 [[TMP2]], i32 [[TMP3]]) #[[ATTR2]] -; IS__TUNIT_NPM-NEXT: ret i32 [[RESULT]] ; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@unions_v2 -; IS__CGSCC_OPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: call void @vfu1(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR:%.*]]) align 8 dereferenceable(8) @mystr) #[[ATTR0]] -; IS__CGSCC_OPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(%struct.MYstr* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_MYSTR]]) align 8 dereferenceable(8) @mystr) #[[ATTR0]] -; IS__CGSCC_OPM-NEXT: ret i32 [[RESULT]] -; -; IS__CGSCC_NPM: Function Attrs: nounwind -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@unions_v2 -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: call void @vfu1(i8 noundef 0, i32 undef) #[[ATTR0]] -; IS__CGSCC_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(i8 undef, i32 undef) #[[ATTR0]] -; IS__CGSCC_NPM-NEXT: ret i32 [[RESULT]] +; NOT_CGSCC_NPM: Function Attrs: nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@unions_v2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[MYSTR_CAST:%.*]] = bitcast %struct.MYstr* @mystr to i8* +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i8, i8* [[MYSTR_CAST]], align 8 +; NOT_CGSCC_NPM-NEXT: [[MYSTR_0_1:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[MYSTR_0_1]], align 8 +; NOT_CGSCC_NPM-NEXT: call void @vfu1(i8 [[TMP0]], i32 [[TMP1]]) #[[ATTR0]] +; NOT_CGSCC_NPM-NEXT: [[MYSTR_CAST1:%.*]] = bitcast %struct.MYstr* @mystr to i8* +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i8, i8* [[MYSTR_CAST1]], align 8 +; NOT_CGSCC_NPM-NEXT: [[MYSTR_0_12:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[MYSTR_0_12]], align 8 +; NOT_CGSCC_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(i8 [[TMP2]], i32 [[TMP3]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[RESULT]] +; +; NOT_TUNIT_NPM: Function Attrs: nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@unions_v2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: call void @vfu1(i8 noundef 0, i32 undef) #[[ATTR0]] +; NOT_TUNIT_NPM-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(i8 undef, i32 undef) #[[ATTR0]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[RESULT]] ; entry: call void @vfu1(%struct.MYstr* byval(%struct.MYstr) align 4 @mystr) nounwind @@ -322,13 +227,10 @@ ret i32 %result } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree 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 } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nounwind readonly } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll b/llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -9,19 +7,19 @@ define i64 @fn2() { ; -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@fn2 -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i64 poison +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@fn2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i64 poison ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@fn2 -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CONV:%.*]] = sext i32 undef to i64 -; IS__CGSCC____-NEXT: [[DIV:%.*]] = sdiv i64 8, 0 -; IS__CGSCC____-NEXT: ret i64 poison +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fn2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CONV:%.*]] = sext i32 undef to i64 +; NOT_TUNIT_NPM-NEXT: [[DIV:%.*]] = sdiv i64 8, 0 +; NOT_TUNIT_NPM-NEXT: ret i64 poison ; entry: %conv = sext i32 undef to i64 @@ -32,39 +30,22 @@ define i64 @fn2b(i32 %arg) { ; -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fn2b -; IS__TUNIT_OPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64 -; IS__TUNIT_OPM-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]] -; IS__TUNIT_OPM-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 [[DIV]]) #[[ATTR0]] -; IS__TUNIT_OPM-NEXT: ret i64 [[CALL2]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fn2b -; IS__TUNIT_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64 -; IS__TUNIT_NPM-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]] -; IS__TUNIT_NPM-NEXT: ret i64 [[DIV]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@fn2b +; NOT_CGSCC_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64 +; NOT_CGSCC_NPM-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]] +; NOT_CGSCC_NPM-NEXT: ret i64 [[DIV]] ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fn2b -; IS__CGSCC_OPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64 -; IS__CGSCC_OPM-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]] -; IS__CGSCC_OPM-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 [[DIV]]) #[[ATTR1:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i64 [[CALL2]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fn2b -; IS__CGSCC_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64 -; IS__CGSCC_NPM-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]] -; IS__CGSCC_NPM-NEXT: ret i64 [[DIV]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fn2b +; NOT_TUNIT_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64 +; NOT_TUNIT_NPM-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]] +; NOT_TUNIT_NPM-NEXT: ret i64 [[DIV]] ; entry: %conv = sext i32 %arg to i64 @@ -74,24 +55,18 @@ } define i64 @fn2c() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@fn2c -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i64 42 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fn2c -; IS__CGSCC_OPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: ret i64 42 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@fn2c +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i64 42 ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fn2c -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[CONV:%.*]] = sext i32 undef to i64 -; IS__CGSCC_NPM-NEXT: ret i64 42 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fn2c +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CONV:%.*]] = sext i32 undef to i64 +; NOT_TUNIT_NPM-NEXT: ret i64 42 ; entry: %conv = sext i32 undef to i64 @@ -101,23 +76,13 @@ } define internal i64 @fn1(i64 %p1) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fn1 -; IS__TUNIT_OPM-SAME: (i64 returned [[P1:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: ret i64 [[P1]] ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fn1 -; IS__CGSCC_OPM-SAME: (i64 returned [[P1:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: ret i64 [[P1]] ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fn1 -; IS__CGSCC_NPM-SAME: (i64 [[P1:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: ret i64 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fn1 +; NOT_TUNIT_NPM-SAME: (i64 [[P1:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i64 undef ; entry: %tobool = icmp ne i64 %p1, 0 @@ -125,10 +90,7 @@ ret i64 %cond } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll b/llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll @@ -1,74 +1,41 @@ ; 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=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" target triple = "x86_64-unknown-linux-gnu" define void @fn2(i32* %P, i1 %C) { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fn2 -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree [[P:%.*]], i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[IF_END:%.*]] -; IS__TUNIT_OPM: for.cond1: -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[IF_END]], label [[EXIT:%.*]] -; IS__TUNIT_OPM: if.end: -; IS__TUNIT_OPM-NEXT: [[E_2:%.*]] = phi i32* [ [[P]], [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[E_2]], align 4 -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32 @fn1(i32 [[TMP0]]) #[[ATTR3:[0-9]+]] -; IS__TUNIT_OPM-NEXT: store i32 [[CALL]], i32* [[P]], align 4 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND1]] -; IS__TUNIT_OPM: exit: -; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fn2 -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree [[P:%.*]], i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[IF_END:%.*]] -; IS__TUNIT_NPM: for.cond1: -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[IF_END]], label [[EXIT:%.*]] -; IS__TUNIT_NPM: if.end: -; IS__TUNIT_NPM-NEXT: [[E_2:%.*]] = phi i32* [ [[P]], [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[E_2]], align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[P]], align 4 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND1]] -; IS__TUNIT_NPM: exit: -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fn2 -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull align 4 dereferenceable(4) [[P:%.*]], i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[IF_END:%.*]] -; IS__CGSCC_OPM: for.cond1: -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[IF_END]], label [[EXIT:%.*]] -; IS__CGSCC_OPM: if.end: -; IS__CGSCC_OPM-NEXT: [[E_2:%.*]] = phi i32* [ [[P]], [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[E_2]], align 4 -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @fn1(i32 [[TMP0]]) -; IS__CGSCC_OPM-NEXT: store i32 [[CALL]], i32* [[P]], align 4 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND1]] -; IS__CGSCC_OPM: exit: -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fn2 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull align 4 dereferenceable(4) [[P:%.*]], i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[IF_END:%.*]] -; IS__CGSCC_NPM: for.cond1: -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[IF_END]], label [[EXIT:%.*]] -; IS__CGSCC_NPM: if.end: -; IS__CGSCC_NPM-NEXT: [[E_2:%.*]] = phi i32* [ [[P]], [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[E_2]], align 4 -; IS__CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[P]], align 4 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND1]] -; IS__CGSCC_NPM: exit: -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@fn2 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree [[P:%.*]], i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[IF_END:%.*]] +; NOT_CGSCC_NPM: for.cond1: +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[IF_END]], label [[EXIT:%.*]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: [[E_2:%.*]] = phi i32* [ [[P]], [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[E_2]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[P]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND1]] +; NOT_CGSCC_NPM: exit: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fn2 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull align 4 dereferenceable(4) [[P:%.*]], i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[IF_END:%.*]] +; NOT_TUNIT_NPM: for.cond1: +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[IF_END]], label [[EXIT:%.*]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: [[E_2:%.*]] = phi i32* [ [[P]], [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[E_2]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[P]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND1]] +; NOT_TUNIT_NPM: exit: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: br label %if.end @@ -87,23 +54,13 @@ } define internal i32 @fn1(i32 %p1) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fn1 -; IS__TUNIT_OPM-SAME: (i32 returned [[P1:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: ret i32 [[P1]] ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fn1 -; IS__CGSCC_OPM-SAME: (i32 returned [[P1:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: ret i32 [[P1]] ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fn1 -; IS__CGSCC_NPM-SAME: (i32 [[P1:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fn1 +; NOT_TUNIT_NPM-SAME: (i32 [[P1:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; entry: %tobool = icmp ne i32 %p1, 0 @@ -113,67 +70,36 @@ define void @fn_no_null_opt(i32* %P, i1 %C) null_pointer_is_valid { ; -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind null_pointer_is_valid -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fn_no_null_opt -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[IF_END:%.*]] -; IS__TUNIT_OPM: for.cond1: -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[IF_END]], label [[EXIT:%.*]] -; IS__TUNIT_OPM: if.end: -; IS__TUNIT_OPM-NEXT: [[E_2:%.*]] = phi i32* [ undef, [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* null, align 4 -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32 @fn0(i32 [[TMP0]]) #[[ATTR3]] -; IS__TUNIT_OPM-NEXT: store i32 [[CALL]], i32* [[P]], align 4 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND1]] -; IS__TUNIT_OPM: exit: -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind null_pointer_is_valid -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fn_no_null_opt -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i1 [[C:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[IF_END:%.*]] -; IS__TUNIT_NPM: for.cond1: -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[IF_END]], label [[EXIT:%.*]] -; IS__TUNIT_NPM: if.end: -; IS__TUNIT_NPM-NEXT: [[E_2:%.*]] = phi i32* [ undef, [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* null, align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[P]], align 4 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND1]] -; IS__TUNIT_NPM: exit: -; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fn_no_null_opt -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly align 4 dereferenceable_or_null(4) [[P:%.*]], i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[IF_END:%.*]] -; IS__CGSCC_OPM: for.cond1: -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[IF_END]], label [[EXIT:%.*]] -; IS__CGSCC_OPM: if.end: -; IS__CGSCC_OPM-NEXT: [[E_2:%.*]] = phi i32* [ undef, [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* null, align 4294967296 -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @fn0(i32 [[TMP0]]) -; IS__CGSCC_OPM-NEXT: store i32 [[CALL]], i32* [[P]], align 4 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND1]] -; IS__CGSCC_OPM: exit: -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fn_no_null_opt -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly align 4 dereferenceable_or_null(4) [[P:%.*]], i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[IF_END:%.*]] -; IS__CGSCC_NPM: for.cond1: -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[IF_END]], label [[EXIT:%.*]] -; IS__CGSCC_NPM: if.end: -; IS__CGSCC_NPM-NEXT: [[E_2:%.*]] = phi i32* [ undef, [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* null, align 4294967296 -; IS__CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[P]], align 4 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND1]] -; IS__CGSCC_NPM: exit: -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind null_pointer_is_valid +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@fn_no_null_opt +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i1 [[C:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[IF_END:%.*]] +; NOT_CGSCC_NPM: for.cond1: +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[IF_END]], label [[EXIT:%.*]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: [[E_2:%.*]] = phi i32* [ undef, [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* null, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[P]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND1]] +; NOT_CGSCC_NPM: exit: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fn_no_null_opt +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree writeonly align 4 dereferenceable_or_null(4) [[P:%.*]], i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[IF_END:%.*]] +; NOT_TUNIT_NPM: for.cond1: +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[IF_END]], label [[EXIT:%.*]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: [[E_2:%.*]] = phi i32* [ undef, [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* null, align 4294967296 +; NOT_TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[P]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND1]] +; NOT_TUNIT_NPM: exit: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: br label %if.end @@ -192,23 +118,13 @@ } define internal i32 @fn0(i32 %p1) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fn0 -; IS__TUNIT_OPM-SAME: (i32 returned [[P1:%.*]]) #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: ret i32 [[P1]] ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fn0 -; IS__CGSCC_OPM-SAME: (i32 returned [[P1:%.*]]) #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: ret i32 [[P1]] ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fn0 -; IS__CGSCC_NPM-SAME: (i32 [[P1:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fn0 +; NOT_TUNIT_NPM-SAME: (i32 [[P1:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; entry: %tobool = icmp ne i32 %p1, 0 @@ -216,15 +132,10 @@ ret i32 %cond } ;. -; IS__TUNIT_OPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind } -; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind null_pointer_is_valid } -; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind readnone } -;. -; IS__TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind } -; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind null_pointer_is_valid } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree 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 } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind null_pointer_is_valid } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll b/llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 %struct.wobble = type { i32 } @@ -10,36 +8,36 @@ declare dso_local fastcc float @bar(%struct.wobble* noalias, <8 x i32>) unnamed_addr define %struct.zot @widget(<8 x i32> %arg) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@widget -; IS__TUNIT____-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: bb: -; IS__TUNIT____-NEXT: ret [[STRUCT_ZOT:%.*]] undef +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@widget +; NOT_CGSCC_NPM-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: ret [[STRUCT_ZOT:%.*]] undef ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@widget -; IS__CGSCC____-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: bb: -; IS__CGSCC____-NEXT: ret [[STRUCT_ZOT:%.*]] undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@widget +; NOT_TUNIT_NPM-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: ret [[STRUCT_ZOT:%.*]] undef ; bb: ret %struct.zot undef } define void @baz(<8 x i32> %arg) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@baz -; IS__TUNIT____-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT____-NEXT: bb: -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = extractvalue [[STRUCT_ZOT:%.*]] undef, 0, 0 -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@baz +; NOT_CGSCC_NPM-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = extractvalue [[STRUCT_ZOT:%.*]] undef, 0, 0 +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@baz -; IS__CGSCC____-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC____-NEXT: bb: -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = extractvalue [[STRUCT_ZOT:%.*]] undef, 0, 0 -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@baz +; NOT_TUNIT_NPM-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = extractvalue [[STRUCT_ZOT:%.*]] undef, 0, 0 +; NOT_TUNIT_NPM-NEXT: ret void ; bb: %tmp = call %struct.zot @widget(<8 x i32> %arg) @@ -47,7 +45,7 @@ ret void } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll b/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; The original C source looked like this: @@ -41,31 +39,26 @@ ; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16)*)(i16 [[A]]) ; NOT_CGSCC_NPM-NEXT: ret i16 [[CALL]] ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@foo -; IS__CGSCC_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16)*)(i16 [[A]]) -; IS__CGSCC_NPM-NEXT: ret i16 [[CALL]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16)*)(i16 [[A]]) +; NOT_TUNIT_NPM-NEXT: ret i16 [[CALL]] ; %call = call i16 bitcast (i16 (i16, i16) * @bar to i16 (i16) *)(i16 %a) ret i16 %call } define internal i16 @bar(i16 %p1, i16 %p2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i16 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bar +; NOT_CGSCC_NPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i16 0 ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bar -; IS__CGSCC_OPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: ret i16 0 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bar -; IS__CGSCC_NPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: ret i16 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bar +; NOT_TUNIT_NPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret i16 0 ; ret i16 0 } @@ -76,34 +69,28 @@ ; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar2 to i16 (i16)*)(i16 [[A]]) ; NOT_CGSCC_NPM-NEXT: ret i16 [[CALL]] ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@foo2 -; IS__CGSCC_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar2 to i16 (i16)*)(i16 [[A]]) -; IS__CGSCC_NPM-NEXT: ret i16 [[CALL]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo2 +; NOT_TUNIT_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar2 to i16 (i16)*)(i16 [[A]]) +; NOT_TUNIT_NPM-NEXT: ret i16 [[CALL]] ; %call = call i16 bitcast (i16 (i16, i16) * @bar2 to i16 (i16) *)(i16 %a) ret i16 %call } define internal i16 @bar2(i16 %p1, i16 %p2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar2 -; IS__TUNIT____-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = add i16 [[P1]], [[P2]] -; IS__TUNIT____-NEXT: ret i16 [[A]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bar2 -; IS__CGSCC_OPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = add i16 [[P1]], [[P2]] -; IS__CGSCC_OPM-NEXT: ret i16 [[A]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bar2 -; IS__CGSCC_NPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = add i16 [[P1]], [[P2]] -; IS__CGSCC_NPM-NEXT: ret i16 [[A]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bar2 +; NOT_CGSCC_NPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = add i16 [[P1]], [[P2]] +; NOT_CGSCC_NPM-NEXT: ret i16 [[A]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bar2 +; NOT_TUNIT_NPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = add i16 [[P1]], [[P2]] +; NOT_TUNIT_NPM-NEXT: ret i16 [[A]] ; %a = add i16 %p1, %p2 ret i16 %a @@ -122,12 +109,12 @@ ; 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-LABEL: define {{[^@]+}}@vararg_tests -; IS__CGSCC_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR0]] { -; 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]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@vararg_tests +; NOT_TUNIT_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[CALL2:%.*]] = call i16 bitcast (i16 (i16, i16, ...)* @vararg_no_prop to i16 (i16)*)(i16 noundef 7) +; NOT_TUNIT_NPM-NEXT: [[ADD:%.*]] = add i16 7, [[CALL2]] +; NOT_TUNIT_NPM-NEXT: ret i16 [[ADD]] ; %call1 = call i16 (i16, ...) @vararg_prop(i16 7, i16 8, i16 %a) %call2 = call i16 bitcast (i16 (i16, i16, ...) * @vararg_no_prop to i16 (i16) *) (i16 7) @@ -136,43 +123,32 @@ } define internal i16 @vararg_prop(i16 %p1, ...) { -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@vararg_prop -; IS__CGSCC_OPM-SAME: (i16 [[P1:%.*]], ...) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: ret i16 undef ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@vararg_prop -; IS__CGSCC_NPM-SAME: (i16 [[P1:%.*]], ...) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i16 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@vararg_prop +; NOT_TUNIT_NPM-SAME: (i16 [[P1:%.*]], ...) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i16 undef ; ret i16 %p1 } define internal i16 @vararg_no_prop(i16 %p1, i16 %p2, ...) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@vararg_no_prop -; IS__TUNIT____-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i16 7 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@vararg_no_prop -; IS__CGSCC_OPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: ret i16 7 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@vararg_no_prop +; NOT_CGSCC_NPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i16 7 ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@vararg_no_prop -; IS__CGSCC_NPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i16 7 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@vararg_no_prop +; NOT_TUNIT_NPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i16 7 ; ret i16 %p1 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll b/llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; This test is just to verify that we do not crash/assert due to mismatch in @@ -13,41 +11,34 @@ ; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16, i32)*)(i16 [[A]], i32 7) ; NOT_CGSCC_NPM-NEXT: ret i16 [[CALL]] ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@foo -; IS__CGSCC_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16, i32)*)(i16 [[A]], i32 7) -; IS__CGSCC_NPM-NEXT: ret i16 [[CALL]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: (i16 [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16, i32)*)(i16 [[A]], i32 7) +; NOT_TUNIT_NPM-NEXT: ret i16 [[CALL]] ; %call = call i16 bitcast (i16 (i16, i16) * @bar to i16 (i16, i32) *)(i16 %a, i32 7) ret i16 %call } define internal i16 @bar(i16 %p1, i16 %p2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: (i16 [[P1:%.*]], i16 returned [[P2:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i16 [[P2]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bar +; NOT_CGSCC_NPM-SAME: (i16 [[P1:%.*]], i16 returned [[P2:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i16 [[P2]] ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bar -; IS__CGSCC_OPM-SAME: (i16 [[P1:%.*]], i16 returned [[P2:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: ret i16 [[P2]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bar -; IS__CGSCC_NPM-SAME: (i16 [[P1:%.*]], i16 returned [[P2:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: ret i16 [[P2]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bar +; NOT_TUNIT_NPM-SAME: (i16 [[P1:%.*]], i16 returned [[P2:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret i16 [[P2]] ; ret i16 %p2 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/comdat-ipo.ll b/llvm/test/Transforms/Attributor/IPConstantProp/comdat-ipo.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/comdat-ipo.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/comdat-ipo.ll @@ -1,21 +1,19 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; See PR26774 define i32 @baz() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@baz -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32 10 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@baz +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i32 10 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@baz -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32 10 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@baz +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret i32 10 ; ret i32 10 } @@ -42,7 +40,7 @@ ret i32 %val } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/dangling-block-address.ll b/llvm/test/Transforms/Attributor/IPConstantProp/dangling-block-address.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/dangling-block-address.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/dangling-block-address.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; PR5569 @@ -12,20 +10,20 @@ @bar.l = internal constant [2 x i8*] [i8* blockaddress(@bar, %lab0), i8* blockaddress(@bar, %end)] ; <[2 x i8*]*> [#uses=1] ;. -; IS__TUNIT____: @[[CODE:[a-zA-Z0-9_$"\\.-]+]] = global [5 x i32] [i32 0, i32 0, i32 0, i32 0, i32 1], align 4 -; IS__TUNIT____: @[[BAR_L:[a-zA-Z0-9_$"\\.-]+]] = internal constant [2 x i8*] [i8* inttoptr (i32 1 to i8*), i8* inttoptr (i32 1 to i8*)] +; NOT_CGSCC_NPM: @[[CODE:[a-zA-Z0-9_$"\\.-]+]] = global [5 x i32] [i32 0, i32 0, i32 0, i32 0, i32 1], align 4 +; NOT_CGSCC_NPM: @[[BAR_L:[a-zA-Z0-9_$"\\.-]+]] = internal constant [2 x i8*] [i8* inttoptr (i32 1 to i8*), i8* inttoptr (i32 1 to i8*)] ;. -; IS__CGSCC____: @[[CODE:[a-zA-Z0-9_$"\\.-]+]] = global [5 x i32] [i32 0, i32 0, i32 0, i32 0, i32 1], align 4 -; IS__CGSCC____: @[[BAR_L:[a-zA-Z0-9_$"\\.-]+]] = internal constant [2 x i8*] [i8* blockaddress(@bar, [[LAB0:%.*]]), i8* blockaddress(@bar, [[END:%.*]])] +; NOT_TUNIT_NPM: @[[CODE:[a-zA-Z0-9_$"\\.-]+]] = global [5 x i32] [i32 0, i32 0, i32 0, i32 0, i32 1], align 4 +; NOT_TUNIT_NPM: @[[BAR_L:[a-zA-Z0-9_$"\\.-]+]] = internal constant [2 x i8*] [i8* blockaddress(@bar, [[LAB0:%.*]]), i8* blockaddress(@bar, [[END:%.*]])] ;. define internal void @foo(i32 %x) nounwind readnone { -; IS__CGSCC____: Function Attrs: nounwind readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (i32 [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: store volatile i32 -1, i32* [[B]], align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: (i32 [[X:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: store volatile i32 -1, i32* [[B]], align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %b = alloca i32, align 4 ; [#uses=1] @@ -34,37 +32,20 @@ } define internal void @bar(i32* nocapture %pc) nounwind readonly { -; IS__CGSCC_OPM: Function Attrs: nounwind readonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bar -; IS__CGSCC_OPM-SAME: (i32* nocapture [[PC:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[INDIRECTGOTO:%.*]] -; IS__CGSCC_OPM: lab0: -; IS__CGSCC_OPM-NEXT: [[INDVAR_NEXT:%.*]] = add i32 [[INDVAR:%.*]], 1 -; IS__CGSCC_OPM-NEXT: br label [[INDIRECTGOTO]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: ret void -; IS__CGSCC_OPM: indirectgoto: -; IS__CGSCC_OPM-NEXT: [[INDVAR]] = phi i32 [ [[INDVAR_NEXT]], [[LAB0:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[PC_ADDR_0:%.*]] = getelementptr i32, i32* [[PC]], i32 [[INDVAR]] -; IS__CGSCC_OPM-NEXT: [[TMP1_PN:%.*]] = load i32, i32* [[PC_ADDR_0]], align 4 -; IS__CGSCC_OPM-NEXT: [[INDIRECT_GOTO_DEST_IN:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* @bar.l, i32 0, i32 [[TMP1_PN]] -; IS__CGSCC_OPM-NEXT: [[INDIRECT_GOTO_DEST:%.*]] = load i8*, i8** [[INDIRECT_GOTO_DEST_IN]], align 8 -; IS__CGSCC_OPM-NEXT: indirectbr i8* [[INDIRECT_GOTO_DEST]], [label [[LAB0]], label %end] ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bar -; IS__CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[INDIRECTGOTO:%.*]] -; IS__CGSCC_NPM: lab0: -; IS__CGSCC_NPM-NEXT: [[INDVAR_NEXT:%.*]] = add i32 [[INDVAR:%.*]], 1 -; IS__CGSCC_NPM-NEXT: br label [[INDIRECTGOTO]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret void -; IS__CGSCC_NPM: indirectgoto: -; IS__CGSCC_NPM-NEXT: [[INDVAR]] = phi i32 [ [[INDVAR_NEXT]], [[LAB0:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC_NPM-NEXT: indirectbr i8* undef, [label [[LAB0]], label %end] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bar +; NOT_TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[INDIRECTGOTO:%.*]] +; NOT_TUNIT_NPM: lab0: +; NOT_TUNIT_NPM-NEXT: [[INDVAR_NEXT:%.*]] = add i32 [[INDVAR:%.*]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[INDIRECTGOTO]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: ret void +; NOT_TUNIT_NPM: indirectgoto: +; NOT_TUNIT_NPM-NEXT: [[INDVAR]] = phi i32 [ [[INDVAR_NEXT]], [[LAB0:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; NOT_TUNIT_NPM-NEXT: indirectbr i8* undef, [label [[LAB0]], label %end] ; entry: br label %indirectgoto @@ -86,29 +67,25 @@ } define i32 @main() nounwind readnone { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@main -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@main +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@main -; IS__CGSCC____-SAME: () #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@main +; NOT_TUNIT_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; entry: ret i32 0 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nounwind readnone } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nounwind readonly } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } -;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nounwind readnone } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/deadarg.ll b/llvm/test/Transforms/Attributor/IPConstantProp/deadarg.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/deadarg.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/deadarg.ll @@ -1,33 +1,31 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM define internal void @foo(i32 %X) { -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (i32 [[X:%.*]]) { -; IS__CGSCC____-NEXT: call void @foo(i32 [[X]]) -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: (i32 [[X:%.*]]) { +; NOT_TUNIT_NPM-NEXT: call void @foo(i32 [[X]]) +; NOT_TUNIT_NPM-NEXT: ret void ; call void @foo( i32 %X ) ret void } define void @bar() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bar +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bar -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bar +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret void ; ret void } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll b/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll @@ -1,67 +1,65 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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-n32:64" target triple = "powerpc64le-unknown-linux" define void @test(i32 signext %n) { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@test -; IS__TUNIT____-SAME: (i32 signext [[N:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.then2: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.end4: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.then9: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.then12: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.else14: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: do.body: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.then33: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: cond.false.i28: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: _ZN5boost4math4signIgEEiRKT_.exit30: -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test +; NOT_CGSCC_NPM-SAME: (i32 signext [[N:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: if.then2: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: if.end4: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: if.then9: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: if.then12: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: if.else14: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: do.body: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: if.then33: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: cond.false.i28: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: _ZN5boost4math4signIgEEiRKT_.exit30: +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@test -; IS__CGSCC____-SAME: (i32 signext [[N:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.then2: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.end4: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.then9: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.then12: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.else14: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: do.body: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.then33: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: cond.false.i28: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: _ZN5boost4math4signIgEEiRKT_.exit30: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test +; NOT_TUNIT_NPM-SAME: (i32 signext [[N:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: if.then2: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: if.end4: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: if.then9: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: if.then12: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: if.else14: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: do.body: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: if.then33: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: cond.false.i28: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: _ZN5boost4math4signIgEEiRKT_.exit30: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: @@ -109,7 +107,7 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/global.ll b/llvm/test/Transforms/Attributor/IPConstantProp/global.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/global.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/global.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 @_ZL6test1g = internal global i32 42, align 4 @@ -10,25 +8,25 @@ ; CHECK: @[[_ZL6TEST1G:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 42, align 4 ;. define void @_Z7test1f1v() nounwind { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@_Z7test1f1v -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[IF_END:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@_Z7test1f1v +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[IF_END:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@_Z7test1f1v -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@_Z7test1f1v +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[IF_END:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %tmp = load i32, i32* @_ZL6test1g, align 4 @@ -44,24 +42,24 @@ } define i32 @_Z7test1f2v() nounwind { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@_Z7test1f2v -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 42 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@_Z7test1f2v +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32 42 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@_Z7test1f2v -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 42 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@_Z7test1f2v +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 42 ; entry: %tmp = load i32, i32* @_ZL6test1g, align 4 ret i32 %tmp } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/multiple_callbacks.ll b/llvm/test/Transforms/Attributor/IPConstantProp/multiple_callbacks.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/multiple_callbacks.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/multiple_callbacks.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 ; ; @@ -40,51 +38,51 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" define internal i32 @cb0(i32 %zero) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cb0 -; IS__TUNIT____-SAME: (i32 [[ZERO:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cb0 -; IS__CGSCC____-SAME: (i32 [[ZERO:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@cb0 +; NOT_CGSCC_NPM-SAME: (i32 [[ZERO:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32 0 +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cb0 +; NOT_TUNIT_NPM-SAME: (i32 [[ZERO:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; entry: ret i32 %zero } define internal i32 @cb1(i32 %unknown) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cb1 -; IS__TUNIT____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 [[UNKNOWN]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cb1 -; IS__CGSCC____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 [[UNKNOWN]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@cb1 +; NOT_CGSCC_NPM-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32 [[UNKNOWN]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cb1 +; NOT_TUNIT_NPM-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 [[UNKNOWN]] ; entry: ret i32 %unknown } define internal i32 @cb2(i32 %unknown) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cb2 -; IS__TUNIT____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 [[UNKNOWN]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cb2 -; IS__CGSCC____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 [[UNKNOWN]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@cb2 +; NOT_CGSCC_NPM-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32 [[UNKNOWN]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cb2 +; NOT_TUNIT_NPM-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 [[UNKNOWN]] ; entry: %call = call i32 @cb0(i32 0) @@ -92,34 +90,34 @@ } define internal i32 @cb3(i32 %unknown) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cb3 -; IS__TUNIT____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 [[UNKNOWN]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cb3 -; IS__CGSCC____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 [[UNKNOWN]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@cb3 +; NOT_CGSCC_NPM-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32 [[UNKNOWN]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cb3 +; NOT_TUNIT_NPM-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 [[UNKNOWN]] ; entry: ret i32 %unknown } define internal i32 @cb4(i32 %unknown) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cb4 -; IS__TUNIT____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 [[UNKNOWN]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cb4 -; IS__CGSCC____-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 [[UNKNOWN]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@cb4 +; NOT_CGSCC_NPM-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32 [[UNKNOWN]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cb4 +; NOT_TUNIT_NPM-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 [[UNKNOWN]] ; entry: ret i32 %unknown @@ -151,9 +149,9 @@ !2 = !{i64 2, i64 3, i1 false} !3 = !{!0, !2, !1} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. ; CHECK: [[META0:![0-9]+]] = !{!1, !2, !3} ; CHECK: [[META1:![0-9]+]] = !{i64 0, i64 3, i1 false} diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll b/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ; PR36485 ; musttail call result can't be replaced with a constant, unless the call can be removed @@ -10,69 +8,38 @@ define i8* @start(i8 %v) { ; -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@start -; IS__TUNIT_OPM-SAME: (i8 [[V:%.*]]) { -; IS__TUNIT_OPM-NEXT: [[C1:%.*]] = icmp eq i8 [[V]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[C1]], label [[TRUE:%.*]], label [[FALSE:%.*]] -; IS__TUNIT_OPM: true: -; IS__TUNIT_OPM-NEXT: [[CA:%.*]] = musttail call i8* @side_effects(i8 [[V]]) -; IS__TUNIT_OPM-NEXT: ret i8* [[CA]] -; IS__TUNIT_OPM: false: -; IS__TUNIT_OPM-NEXT: [[C2:%.*]] = icmp eq i8 [[V]], 1 -; IS__TUNIT_OPM-NEXT: br i1 [[C2]], label [[C2_TRUE:%.*]], label [[C2_FALSE:%.*]] -; IS__TUNIT_OPM: c2_true: -; IS__TUNIT_OPM-NEXT: ret i8* null -; IS__TUNIT_OPM: c2_false: -; IS__TUNIT_OPM-NEXT: [[CA2:%.*]] = musttail call i8* @dont_zap_me(i8 undef) -; IS__TUNIT_OPM-NEXT: ret i8* [[CA2]] ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@start -; IS__TUNIT_NPM-SAME: (i8 [[V:%.*]]) { -; IS__TUNIT_NPM-NEXT: [[C1:%.*]] = icmp eq i8 [[V]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[C1]], label [[TRUE:%.*]], label [[FALSE:%.*]] -; IS__TUNIT_NPM: true: -; IS__TUNIT_NPM-NEXT: [[CA:%.*]] = musttail call i8* @side_effects(i8 undef) -; IS__TUNIT_NPM-NEXT: ret i8* [[CA]] -; IS__TUNIT_NPM: false: -; IS__TUNIT_NPM-NEXT: [[C2:%.*]] = icmp eq i8 [[V]], 1 -; IS__TUNIT_NPM-NEXT: br i1 [[C2]], label [[C2_TRUE:%.*]], label [[C2_FALSE:%.*]] -; IS__TUNIT_NPM: c2_true: -; IS__TUNIT_NPM-NEXT: ret i8* null -; IS__TUNIT_NPM: c2_false: -; IS__TUNIT_NPM-NEXT: [[CA2:%.*]] = musttail call i8* @dont_zap_me(i8 undef) -; IS__TUNIT_NPM-NEXT: ret i8* [[CA2]] +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@start +; NOT_CGSCC_NPM-SAME: (i8 [[V:%.*]]) { +; NOT_CGSCC_NPM-NEXT: [[C1:%.*]] = icmp eq i8 [[V]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[C1]], label [[TRUE:%.*]], label [[FALSE:%.*]] +; NOT_CGSCC_NPM: true: +; NOT_CGSCC_NPM-NEXT: [[CA:%.*]] = musttail call i8* @side_effects(i8 undef) +; NOT_CGSCC_NPM-NEXT: ret i8* [[CA]] +; NOT_CGSCC_NPM: false: +; NOT_CGSCC_NPM-NEXT: [[C2:%.*]] = icmp eq i8 [[V]], 1 +; NOT_CGSCC_NPM-NEXT: br i1 [[C2]], label [[C2_TRUE:%.*]], label [[C2_FALSE:%.*]] +; NOT_CGSCC_NPM: c2_true: +; NOT_CGSCC_NPM-NEXT: ret i8* null +; NOT_CGSCC_NPM: c2_false: +; NOT_CGSCC_NPM-NEXT: [[CA2:%.*]] = musttail call i8* @dont_zap_me(i8 undef) +; NOT_CGSCC_NPM-NEXT: ret i8* [[CA2]] ; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@start -; IS__CGSCC_OPM-SAME: (i8 [[V:%.*]]) { -; IS__CGSCC_OPM-NEXT: [[C1:%.*]] = icmp eq i8 [[V]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[C1]], label [[TRUE:%.*]], label [[FALSE:%.*]] -; IS__CGSCC_OPM: true: -; IS__CGSCC_OPM-NEXT: [[CA:%.*]] = musttail call i8* @side_effects(i8 [[V]]) -; IS__CGSCC_OPM-NEXT: ret i8* [[CA]] -; IS__CGSCC_OPM: false: -; IS__CGSCC_OPM-NEXT: [[C2:%.*]] = icmp eq i8 [[V]], 1 -; IS__CGSCC_OPM-NEXT: br i1 [[C2]], label [[C2_TRUE:%.*]], label [[C2_FALSE:%.*]] -; IS__CGSCC_OPM: c2_true: -; IS__CGSCC_OPM-NEXT: ret i8* undef -; IS__CGSCC_OPM: c2_false: -; IS__CGSCC_OPM-NEXT: [[CA2:%.*]] = musttail call i8* @dont_zap_me(i8 undef) -; IS__CGSCC_OPM-NEXT: ret i8* [[CA2]] -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@start -; IS__CGSCC_NPM-SAME: (i8 [[V:%.*]]) { -; IS__CGSCC_NPM-NEXT: [[C1:%.*]] = icmp eq i8 [[V]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[C1]], label [[TRUE:%.*]], label [[FALSE:%.*]] -; IS__CGSCC_NPM: true: -; IS__CGSCC_NPM-NEXT: [[CA:%.*]] = musttail call i8* @side_effects(i8 undef) -; IS__CGSCC_NPM-NEXT: ret i8* [[CA]] -; IS__CGSCC_NPM: false: -; IS__CGSCC_NPM-NEXT: [[C2:%.*]] = icmp eq i8 [[V]], 1 -; IS__CGSCC_NPM-NEXT: br i1 [[C2]], label [[C2_TRUE:%.*]], label [[C2_FALSE:%.*]] -; IS__CGSCC_NPM: c2_true: -; IS__CGSCC_NPM-NEXT: ret i8* undef -; IS__CGSCC_NPM: c2_false: -; IS__CGSCC_NPM-NEXT: [[CA2:%.*]] = musttail call i8* @dont_zap_me(i8 undef) -; IS__CGSCC_NPM-NEXT: ret i8* [[CA2]] +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@start +; NOT_TUNIT_NPM-SAME: (i8 [[V:%.*]]) { +; NOT_TUNIT_NPM-NEXT: [[C1:%.*]] = icmp eq i8 [[V]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[C1]], label [[TRUE:%.*]], label [[FALSE:%.*]] +; NOT_TUNIT_NPM: true: +; NOT_TUNIT_NPM-NEXT: [[CA:%.*]] = musttail call i8* @side_effects(i8 undef) +; NOT_TUNIT_NPM-NEXT: ret i8* [[CA]] +; NOT_TUNIT_NPM: false: +; NOT_TUNIT_NPM-NEXT: [[C2:%.*]] = icmp eq i8 [[V]], 1 +; NOT_TUNIT_NPM-NEXT: br i1 [[C2]], label [[C2_TRUE:%.*]], label [[C2_FALSE:%.*]] +; NOT_TUNIT_NPM: c2_true: +; NOT_TUNIT_NPM-NEXT: ret i8* undef +; NOT_TUNIT_NPM: c2_false: +; NOT_TUNIT_NPM-NEXT: [[CA2:%.*]] = musttail call i8* @dont_zap_me(i8 undef) +; NOT_TUNIT_NPM-NEXT: ret i8* [[CA2]] ; %c1 = icmp eq i8 %v, 0 br i1 %c1, label %true, label %false @@ -92,17 +59,12 @@ } define internal i8* @side_effects(i8 %v) { -; IS________OPM-LABEL: define {{[^@]+}}@side_effects -; IS________OPM-SAME: (i8 [[V:%.*]]) { -; IS________OPM-NEXT: [[I1:%.*]] = call i32 @external() -; IS________OPM-NEXT: [[CA:%.*]] = musttail call i8* @start(i8 [[V]]) -; IS________OPM-NEXT: ret i8* [[CA]] ; -; IS________NPM-LABEL: define {{[^@]+}}@side_effects -; IS________NPM-SAME: (i8 [[V:%.*]]) { -; IS________NPM-NEXT: [[I1:%.*]] = call i32 @external() -; IS________NPM-NEXT: [[CA:%.*]] = musttail call i8* @start(i8 noundef 0) -; IS________NPM-NEXT: ret i8* [[CA]] +; CHECK-LABEL: define {{[^@]+}}@side_effects +; CHECK-SAME: (i8 [[V:%.*]]) { +; CHECK-NEXT: [[I1:%.*]] = call i32 @external() +; CHECK-NEXT: [[CA:%.*]] = musttail call i8* @start(i8 noundef 0) +; CHECK-NEXT: ret i8* [[CA]] ; %i1 = call i32 @external() @@ -117,10 +79,10 @@ } define internal i8* @no_side_effects(i8 %v) readonly nounwind { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@no_side_effects -; IS__CGSCC____-SAME: (i8 [[V:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i8* undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@no_side_effects +; NOT_TUNIT_NPM-SAME: (i8 [[V:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret i8* undef ; ret i8* null } @@ -135,5 +97,5 @@ ret i8* null } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/naked-return.ll b/llvm/test/Transforms/Attributor/IPConstantProp/naked-return.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/naked-return.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/naked-return.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll b/llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=13 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=13 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ; ; void bar(int, float, double); @@ -33,49 +31,28 @@ ; CHECK: @[[GLOB1:[0-9]+]] = private unnamed_addr global [[STRUCT_IDENT_T:%.*]] { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 0) }, align 8 ;. define dso_local void @foo(i32 %N) { -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@foo -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4 -; IS__TUNIT_OPM-NEXT: [[P:%.*]] = alloca float, align 4 -; IS__TUNIT_OPM-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4 -; IS__TUNIT_OPM-NEXT: store float 3.000000e+00, float* [[P]], align 4 -; IS__TUNIT_OPM-NEXT: store i32 7, i32* [[N_ADDR]], align 4 -; IS__TUNIT_OPM-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 3, void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, float*, i64)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N_ADDR]], float* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]], i64 undef) -; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@foo -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: [[P:%.*]] = alloca float, align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4 -; IS__TUNIT_NPM-NEXT: store float 3.000000e+00, float* [[P]], align 4 -; IS__TUNIT_NPM-NEXT: store i32 7, i32* [[N_ADDR]], align 4 -; IS__TUNIT_NPM-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 3, void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, float*, i64)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N_ADDR]], float* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]], i64 undef) -; IS__TUNIT_NPM-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo +; NOT_CGSCC_NPM-SAME: (i32 [[N:%.*]]) { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: [[P:%.*]] = alloca float, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4 +; NOT_CGSCC_NPM-NEXT: store float 3.000000e+00, float* [[P]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32 7, i32* [[N_ADDR]], align 4 +; NOT_CGSCC_NPM-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 3, void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, float*, i64)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N_ADDR]], float* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]], i64 undef) +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@foo -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: [[P:%.*]] = alloca float, align 4 -; IS__CGSCC_OPM-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4 -; IS__CGSCC_OPM-NEXT: store float 3.000000e+00, float* [[P]], align 4 -; IS__CGSCC_OPM-NEXT: store i32 7, i32* [[N_ADDR]], align 4 -; IS__CGSCC_OPM-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 3, void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, float*, i64)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N_ADDR]], float* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]], i64 noundef 4617315517961601024) -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@foo -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[P:%.*]] = alloca float, align 4 -; IS__CGSCC_NPM-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4 -; IS__CGSCC_NPM-NEXT: store float 3.000000e+00, float* [[P]], align 4 -; IS__CGSCC_NPM-NEXT: store i32 7, i32* [[N_ADDR]], align 4 -; IS__CGSCC_NPM-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 3, void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, float*, i64)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N_ADDR]], float* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]], i64 noundef 4617315517961601024) -; IS__CGSCC_NPM-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: (i32 [[N:%.*]]) { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[P:%.*]] = alloca float, align 4 +; NOT_TUNIT_NPM-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4 +; NOT_TUNIT_NPM-NEXT: store float 3.000000e+00, float* [[P]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32 7, i32* [[N_ADDR]], align 4 +; NOT_TUNIT_NPM-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 3, void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, float*, i64)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N_ADDR]], float* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]], i64 noundef 4617315517961601024) +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %N.addr = alloca i32, align 4 @@ -88,127 +65,67 @@ } define internal void @.omp_outlined.(i32* noalias %.global_tid., i32* noalias %.bound_tid., i32* dereferenceable(4) %N, float* dereferenceable(4) %p, i64 %q) { -; IS________OPM-LABEL: define {{[^@]+}}@.omp_outlined. -; IS________OPM-SAME: (i32* noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N:%.*]], float* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]], i64 [[Q:%.*]]) { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[Q_ADDR:%.*]] = alloca i64, align 8 -; IS________OPM-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4 -; IS________OPM-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4 -; IS________OPM-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4 -; IS________OPM-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4 -; IS________OPM-NEXT: store i64 4617315517961601024, i64* [[Q_ADDR]], align 8 -; IS________OPM-NEXT: [[CONV:%.*]] = bitcast i64* [[Q_ADDR]] to double* -; IS________OPM-NEXT: [[TMP:%.*]] = load i32, i32* [[N]], align 4 -; IS________OPM-NEXT: [[SUB3:%.*]] = add nsw i32 [[TMP]], -3 -; IS________OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP]], 2 -; IS________OPM-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]] -; IS________OPM: omp.precond.then: -; IS________OPM-NEXT: store i32 0, i32* [[DOTOMP_LB]], align 4 -; IS________OPM-NEXT: store i32 [[SUB3]], i32* [[DOTOMP_UB]], align 4 -; IS________OPM-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4 -; IS________OPM-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4 -; IS________OPM-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4 -; IS________OPM-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB0]], i32 [[TMP5]], i32 noundef 34, i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_IS_LAST]], i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_LB]], i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_UB]], i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_STRIDE]], i32 noundef 1, i32 noundef 1) -; IS________OPM-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4 -; IS________OPM-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[TMP6]], [[SUB3]] -; IS________OPM-NEXT: br i1 [[CMP6]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; IS________OPM: cond.true: -; IS________OPM-NEXT: br label [[COND_END:%.*]] -; IS________OPM: cond.false: -; IS________OPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4 -; IS________OPM-NEXT: br label [[COND_END]] -; IS________OPM: cond.end: -; IS________OPM-NEXT: [[COND:%.*]] = phi i32 [ [[SUB3]], [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ] -; IS________OPM-NEXT: store i32 [[COND]], i32* [[DOTOMP_UB]], align 4 -; IS________OPM-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4 -; IS________OPM-NEXT: br label [[OMP_INNER_FOR_COND:%.*]] -; IS________OPM: omp.inner.for.cond: -; IS________OPM-NEXT: [[DOTOMP_IV_0:%.*]] = phi i32 [ [[TMP8]], [[COND_END]] ], [ [[ADD11:%.*]], [[OMP_INNER_FOR_INC:%.*]] ] -; IS________OPM-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4 -; IS________OPM-NEXT: [[CMP8:%.*]] = icmp sgt i32 [[DOTOMP_IV_0]], [[TMP9]] -; IS________OPM-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]], label [[OMP_INNER_FOR_BODY:%.*]] -; IS________OPM: omp.inner.for.cond.cleanup: -; IS________OPM-NEXT: br label [[OMP_INNER_FOR_END:%.*]] -; IS________OPM: omp.inner.for.body: -; IS________OPM-NEXT: [[ADD10:%.*]] = add nsw i32 [[DOTOMP_IV_0]], 2 -; IS________OPM-NEXT: [[TMP10:%.*]] = load float, float* [[P]], align 4 -; IS________OPM-NEXT: [[TMP11:%.*]] = load double, double* [[CONV]], align 8 -; IS________OPM-NEXT: call void @bar(i32 [[ADD10]], float [[TMP10]], double [[TMP11]]) -; IS________OPM-NEXT: br label [[OMP_BODY_CONTINUE:%.*]] -; IS________OPM: omp.body.continue: -; IS________OPM-NEXT: br label [[OMP_INNER_FOR_INC]] -; IS________OPM: omp.inner.for.inc: -; IS________OPM-NEXT: [[ADD11]] = add nsw i32 [[DOTOMP_IV_0]], 1 -; IS________OPM-NEXT: br label [[OMP_INNER_FOR_COND]] -; IS________OPM: omp.inner.for.end: -; IS________OPM-NEXT: br label [[OMP_LOOP_EXIT:%.*]] -; IS________OPM: omp.loop.exit: -; IS________OPM-NEXT: [[TMP12:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4 -; IS________OPM-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB0]], i32 [[TMP12]]) -; IS________OPM-NEXT: br label [[OMP_PRECOND_END]] -; IS________OPM: omp.precond.end: -; IS________OPM-NEXT: ret void ; -; IS________NPM-LABEL: define {{[^@]+}}@.omp_outlined. -; IS________NPM-SAME: (i32* noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N:%.*]], float* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]], i64 [[Q:%.*]]) { -; IS________NPM-NEXT: entry: -; IS________NPM-NEXT: [[Q_ADDR:%.*]] = alloca i64, align 8 -; IS________NPM-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4 -; IS________NPM-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4 -; IS________NPM-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4 -; IS________NPM-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4 -; IS________NPM-NEXT: store i64 4617315517961601024, i64* [[Q_ADDR]], align 8 -; IS________NPM-NEXT: [[CONV:%.*]] = bitcast i64* [[Q_ADDR]] to double* -; IS________NPM-NEXT: [[TMP:%.*]] = load i32, i32* [[N]], align 4 -; IS________NPM-NEXT: [[SUB3:%.*]] = add nsw i32 [[TMP]], -3 -; IS________NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP]], 2 -; IS________NPM-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]] -; IS________NPM: omp.precond.then: -; IS________NPM-NEXT: store i32 0, i32* [[DOTOMP_LB]], align 4 -; IS________NPM-NEXT: store i32 [[SUB3]], i32* [[DOTOMP_UB]], align 4 -; IS________NPM-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4 -; IS________NPM-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4 -; IS________NPM-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4 -; IS________NPM-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB0]], i32 [[TMP5]], i32 noundef 34, i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_IS_LAST]], i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_LB]], i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_UB]], i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_STRIDE]], i32 noundef 1, i32 noundef 1) -; IS________NPM-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4 -; IS________NPM-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[TMP6]], [[SUB3]] -; IS________NPM-NEXT: br i1 [[CMP6]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; IS________NPM: cond.true: -; IS________NPM-NEXT: br label [[COND_END:%.*]] -; IS________NPM: cond.false: -; IS________NPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4 -; IS________NPM-NEXT: br label [[COND_END]] -; IS________NPM: cond.end: -; IS________NPM-NEXT: [[COND:%.*]] = phi i32 [ [[SUB3]], [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ] -; IS________NPM-NEXT: store i32 [[COND]], i32* [[DOTOMP_UB]], align 4 -; IS________NPM-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4 -; IS________NPM-NEXT: br label [[OMP_INNER_FOR_COND:%.*]] -; IS________NPM: omp.inner.for.cond: -; IS________NPM-NEXT: [[DOTOMP_IV_0:%.*]] = phi i32 [ [[TMP8]], [[COND_END]] ], [ [[ADD11:%.*]], [[OMP_INNER_FOR_INC:%.*]] ] -; IS________NPM-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4 -; IS________NPM-NEXT: [[CMP8:%.*]] = icmp sgt i32 [[DOTOMP_IV_0]], [[TMP9]] -; IS________NPM-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]], label [[OMP_INNER_FOR_BODY:%.*]] -; IS________NPM: omp.inner.for.cond.cleanup: -; IS________NPM-NEXT: br label [[OMP_INNER_FOR_END:%.*]] -; IS________NPM: omp.inner.for.body: -; IS________NPM-NEXT: [[ADD10:%.*]] = add nsw i32 [[DOTOMP_IV_0]], 2 -; IS________NPM-NEXT: [[TMP10:%.*]] = load float, float* [[P]], align 4 -; IS________NPM-NEXT: [[TMP11:%.*]] = load double, double* [[CONV]], align 8 -; IS________NPM-NEXT: call void @bar(i32 [[ADD10]], float [[TMP10]], double [[TMP11]]) -; IS________NPM-NEXT: br label [[OMP_BODY_CONTINUE:%.*]] -; IS________NPM: omp.body.continue: -; IS________NPM-NEXT: br label [[OMP_INNER_FOR_INC]] -; IS________NPM: omp.inner.for.inc: -; IS________NPM-NEXT: [[ADD11]] = add nsw i32 [[DOTOMP_IV_0]], 1 -; IS________NPM-NEXT: br label [[OMP_INNER_FOR_COND]] -; IS________NPM: omp.inner.for.end: -; IS________NPM-NEXT: br label [[OMP_LOOP_EXIT:%.*]] -; IS________NPM: omp.loop.exit: -; IS________NPM-NEXT: [[TMP12:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4 -; IS________NPM-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB0]], i32 [[TMP12]]) -; IS________NPM-NEXT: br label [[OMP_PRECOND_END]] -; IS________NPM: omp.precond.end: -; IS________NPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@.omp_outlined. +; CHECK-SAME: (i32* noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], i32* noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N:%.*]], float* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]], i64 [[Q:%.*]]) { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[Q_ADDR:%.*]] = alloca i64, align 8 +; CHECK-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4 +; CHECK-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4 +; CHECK-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4 +; CHECK-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4 +; CHECK-NEXT: store i64 4617315517961601024, i64* [[Q_ADDR]], align 8 +; CHECK-NEXT: [[CONV:%.*]] = bitcast i64* [[Q_ADDR]] to double* +; CHECK-NEXT: [[TMP:%.*]] = load i32, i32* [[N]], align 4 +; CHECK-NEXT: [[SUB3:%.*]] = add nsw i32 [[TMP]], -3 +; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP]], 2 +; CHECK-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]] +; CHECK: omp.precond.then: +; CHECK-NEXT: store i32 0, i32* [[DOTOMP_LB]], align 4 +; CHECK-NEXT: store i32 [[SUB3]], i32* [[DOTOMP_UB]], align 4 +; CHECK-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4 +; CHECK-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4 +; CHECK-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4 +; CHECK-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB0]], i32 [[TMP5]], i32 noundef 34, i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_IS_LAST]], i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_LB]], i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_UB]], i32* noundef nonnull align 4 dereferenceable(4) [[DOTOMP_STRIDE]], i32 noundef 1, i32 noundef 1) +; CHECK-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4 +; CHECK-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[TMP6]], [[SUB3]] +; CHECK-NEXT: br i1 [[CMP6]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; CHECK: cond.true: +; CHECK-NEXT: br label [[COND_END:%.*]] +; CHECK: cond.false: +; CHECK-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4 +; CHECK-NEXT: br label [[COND_END]] +; CHECK: cond.end: +; CHECK-NEXT: [[COND:%.*]] = phi i32 [ [[SUB3]], [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ] +; CHECK-NEXT: store i32 [[COND]], i32* [[DOTOMP_UB]], align 4 +; CHECK-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4 +; CHECK-NEXT: br label [[OMP_INNER_FOR_COND:%.*]] +; CHECK: omp.inner.for.cond: +; CHECK-NEXT: [[DOTOMP_IV_0:%.*]] = phi i32 [ [[TMP8]], [[COND_END]] ], [ [[ADD11:%.*]], [[OMP_INNER_FOR_INC:%.*]] ] +; CHECK-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4 +; CHECK-NEXT: [[CMP8:%.*]] = icmp sgt i32 [[DOTOMP_IV_0]], [[TMP9]] +; CHECK-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]], label [[OMP_INNER_FOR_BODY:%.*]] +; CHECK: omp.inner.for.cond.cleanup: +; CHECK-NEXT: br label [[OMP_INNER_FOR_END:%.*]] +; CHECK: omp.inner.for.body: +; CHECK-NEXT: [[ADD10:%.*]] = add nsw i32 [[DOTOMP_IV_0]], 2 +; CHECK-NEXT: [[TMP10:%.*]] = load float, float* [[P]], align 4 +; CHECK-NEXT: [[TMP11:%.*]] = load double, double* [[CONV]], align 8 +; CHECK-NEXT: call void @bar(i32 [[ADD10]], float [[TMP10]], double [[TMP11]]) +; CHECK-NEXT: br label [[OMP_BODY_CONTINUE:%.*]] +; CHECK: omp.body.continue: +; CHECK-NEXT: br label [[OMP_INNER_FOR_INC]] +; CHECK: omp.inner.for.inc: +; CHECK-NEXT: [[ADD11]] = add nsw i32 [[DOTOMP_IV_0]], 1 +; CHECK-NEXT: br label [[OMP_INNER_FOR_COND]] +; CHECK: omp.inner.for.end: +; CHECK-NEXT: br label [[OMP_LOOP_EXIT:%.*]] +; CHECK: omp.loop.exit: +; CHECK-NEXT: [[TMP12:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4 +; CHECK-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* noundef nonnull align 8 dereferenceable(24) @[[GLOB0]], i32 [[TMP12]]) +; CHECK-NEXT: br label [[OMP_PRECOND_END]] +; CHECK: omp.precond.end: +; CHECK-NEXT: ret void ; entry: %q.addr = alloca i64, align 8 diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll b/llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; ; #include @@ -34,27 +32,27 @@ ; CHECK: @[[GLOBALVPTR:[a-zA-Z0-9_$"\\.-]+]] = common dso_local global i8* null, align 8 ;. define dso_local i32 @main() { -; IS__TUNIT____-LABEL: define {{[^@]+}}@main() { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[ALLOC1:%.*]] = alloca i8, align 8 -; IS__TUNIT____-NEXT: [[ALLOC2:%.*]] = alloca i8, align 8 -; IS__TUNIT____-NEXT: [[THREAD:%.*]] = alloca i64, align 8 -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @foo, i8* noalias nocapture nofree readnone align 4294967296 undef) -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @bar, i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) undef) -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @baz, i8* noalias nocapture nofree noundef nonnull readnone align 8 dereferenceable(1) [[ALLOC1]]) -; IS__TUNIT____-NEXT: [[CALL3:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @buz, i8* noalias nofree noundef nonnull readnone align 8 dereferenceable(1) "no-capture-maybe-returned" [[ALLOC2]]) -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____-LABEL: define {{[^@]+}}@main() { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[ALLOC1:%.*]] = alloca i8, align 8 -; IS__CGSCC____-NEXT: [[ALLOC2:%.*]] = alloca i8, align 8 -; IS__CGSCC____-NEXT: [[THREAD:%.*]] = alloca i64, align 8 -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @foo, i8* noalias nocapture nofree noundef readnone align 4294967296 null) -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @bar, i8* noalias nocapture nofree noundef nonnull readnone align 8 dereferenceable(8) bitcast (i8** @GlobalVPtr to i8*)) -; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @baz, i8* noalias nocapture nofree noundef nonnull readnone align 8 dereferenceable(1) [[ALLOC1]]) -; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @buz, i8* noalias nofree noundef nonnull readnone align 8 dereferenceable(1) "no-capture-maybe-returned" [[ALLOC2]]) -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@main() { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[ALLOC1:%.*]] = alloca i8, align 8 +; NOT_CGSCC_NPM-NEXT: [[ALLOC2:%.*]] = alloca i8, align 8 +; NOT_CGSCC_NPM-NEXT: [[THREAD:%.*]] = alloca i64, align 8 +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @foo, i8* noalias nocapture nofree readnone align 4294967296 undef) +; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @bar, i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) undef) +; NOT_CGSCC_NPM-NEXT: [[CALL2:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @baz, i8* noalias nocapture nofree noundef nonnull readnone align 8 dereferenceable(1) [[ALLOC1]]) +; NOT_CGSCC_NPM-NEXT: [[CALL3:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @buz, i8* noalias nofree noundef nonnull readnone align 8 dereferenceable(1) "no-capture-maybe-returned" [[ALLOC2]]) +; NOT_CGSCC_NPM-NEXT: ret i32 0 +; +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@main() { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[ALLOC1:%.*]] = alloca i8, align 8 +; NOT_TUNIT_NPM-NEXT: [[ALLOC2:%.*]] = alloca i8, align 8 +; NOT_TUNIT_NPM-NEXT: [[THREAD:%.*]] = alloca i64, align 8 +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @foo, i8* noalias nocapture nofree noundef readnone align 4294967296 null) +; NOT_TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @bar, i8* noalias nocapture nofree noundef nonnull readnone align 8 dereferenceable(8) bitcast (i8** @GlobalVPtr to i8*)) +; NOT_TUNIT_NPM-NEXT: [[CALL2:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @baz, i8* noalias nocapture nofree noundef nonnull readnone align 8 dereferenceable(1) [[ALLOC1]]) +; NOT_TUNIT_NPM-NEXT: [[CALL3:%.*]] = call i32 @pthread_create(i64* noundef nonnull align 8 dereferenceable(8) [[THREAD]], %union.pthread_attr_t* noalias nocapture noundef align 4294967296 null, i8* (i8*)* noundef nonnull @buz, i8* noalias nofree noundef nonnull readnone align 8 dereferenceable(1) "no-capture-maybe-returned" [[ALLOC2]]) +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; entry: %alloc1 = alloca i8, align 8 @@ -70,68 +68,68 @@ declare !callback !0 dso_local i32 @pthread_create(i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*) define internal i8* @foo(i8* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (i8* noalias nocapture nofree readnone align 4294967296 [[ARG:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i8* null -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (i8* noalias nocapture nofree readnone align 4294967296 [[ARG:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i8* null +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo +; NOT_CGSCC_NPM-SAME: (i8* noalias nocapture nofree readnone align 4294967296 [[ARG:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i8* null +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: (i8* noalias nocapture nofree readnone align 4294967296 [[ARG:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i8* null ; entry: ret i8* %arg } define internal i8* @bar(i8* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i8* bitcast (i8** @GlobalVPtr to i8*) -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bar -; IS__CGSCC____-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i8* bitcast (i8** @GlobalVPtr to i8*) +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bar +; NOT_CGSCC_NPM-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i8* bitcast (i8** @GlobalVPtr to i8*) +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bar +; NOT_TUNIT_NPM-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i8* bitcast (i8** @GlobalVPtr to i8*) ; entry: ret i8* %arg } define internal i8* @baz(i8* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@baz -; IS__TUNIT____-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i8* [[ARG]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@baz -; IS__CGSCC____-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i8* [[ARG]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@baz +; NOT_CGSCC_NPM-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i8* [[ARG]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@baz +; NOT_TUNIT_NPM-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i8* [[ARG]] ; entry: ret i8* %arg } define internal i8* @buz(i8* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@buz -; IS__TUNIT____-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i8* [[ARG]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@buz -; IS__CGSCC____-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i8* [[ARG]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@buz +; NOT_CGSCC_NPM-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i8* [[ARG]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@buz +; NOT_TUNIT_NPM-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i8* [[ARG]] ; entry: ret i8* %arg @@ -140,9 +138,9 @@ !1 = !{i64 2, i64 3, i1 false} !0 = !{!1} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. ; CHECK: [[META0:![0-9]+]] = !{!1} ; CHECK: [[META1:![0-9]+]] = !{i64 2, i64 3, i1 false} diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/recursion.ll b/llvm/test/Transforms/Attributor/IPConstantProp/recursion.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/recursion.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/recursion.ll @@ -1,16 +1,14 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ; CHECK-NOT: %X define internal i32 @foo(i32 %X) { -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %Y = call i32 @foo( i32 %X ) ; [#uses=1] %Z = add i32 %Y, 1 ; [#uses=1] @@ -18,22 +16,22 @@ } define void @bar() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bar +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bar -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bar +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; call i32 @foo( i32 17 ) ; :1 [#uses=0] ret void } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/remove-call-inst.ll b/llvm/test/Transforms/Attributor/IPConstantProp/remove-call-inst.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/remove-call-inst.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/remove-call-inst.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; PR5596 @@ -11,17 +9,17 @@ ; FIXME: Remove obsolete calls/instructions define i32 @main() noreturn nounwind { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@main -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 123 +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@main +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32 123 ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@main -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 123 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@main +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 123 ; entry: %call2 = tail call i32 @wwrite(i64 0) nounwind @@ -29,18 +27,18 @@ } define internal i32 @wwrite(i64 %i) nounwind readnone { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@wwrite -; IS__CGSCC____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ -; IS__CGSCC____-NEXT: i64 3, label [[RETURN:%.*]] -; IS__CGSCC____-NEXT: i64 10, label [[RETURN]] -; IS__CGSCC____-NEXT: ] -; IS__CGSCC____: sw.default: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@wwrite +; NOT_TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ +; NOT_TUNIT_NPM-NEXT: i64 3, label [[RETURN:%.*]] +; NOT_TUNIT_NPM-NEXT: i64 10, label [[RETURN]] +; NOT_TUNIT_NPM-NEXT: ] +; NOT_TUNIT_NPM: sw.default: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: switch i64 %i, label %sw.default [ @@ -55,8 +53,8 @@ ret i32 0 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll b/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll @@ -1,52 +1,36 @@ ; 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=12 -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=12 -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 ;; This function returns its second argument on all return statements define internal i32* @incdec(i1 %C, i32* %V) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@incdec -; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* noalias nofree noundef nonnull returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[X:%.*]] = load i32, i32* [[V]], align 4 -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: T: -; IS__TUNIT____-NEXT: [[X1:%.*]] = add i32 [[X]], 1 -; IS__TUNIT____-NEXT: store i32 [[X1]], i32* [[V]], align 4 -; IS__TUNIT____-NEXT: ret i32* [[V]] -; IS__TUNIT____: F: -; IS__TUNIT____-NEXT: [[X2:%.*]] = sub i32 [[X]], 1 -; IS__TUNIT____-NEXT: store i32 [[X2]], i32* [[V]], align 4 -; IS__TUNIT____-NEXT: ret i32* [[V]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@incdec +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* noalias nofree noundef nonnull returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = load i32, i32* [[V]], align 4 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: T: +; NOT_CGSCC_NPM-NEXT: [[X1:%.*]] = add i32 [[X]], 1 +; NOT_CGSCC_NPM-NEXT: store i32 [[X1]], i32* [[V]], align 4 +; NOT_CGSCC_NPM-NEXT: ret i32* [[V]] +; NOT_CGSCC_NPM: F: +; NOT_CGSCC_NPM-NEXT: [[X2:%.*]] = sub i32 [[X]], 1 +; NOT_CGSCC_NPM-NEXT: store i32 [[X2]], i32* [[V]], align 4 +; NOT_CGSCC_NPM-NEXT: ret i32* [[V]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@incdec -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* noalias nofree noundef nonnull returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[X:%.*]] = load i32, i32* [[V]], align 4 -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_OPM: T: -; IS__CGSCC_OPM-NEXT: [[X1:%.*]] = add i32 [[X]], 1 -; IS__CGSCC_OPM-NEXT: store i32 [[X1]], i32* [[V]], align 4 -; IS__CGSCC_OPM-NEXT: ret i32* [[V]] -; IS__CGSCC_OPM: F: -; IS__CGSCC_OPM-NEXT: [[X2:%.*]] = sub i32 [[X]], 1 -; IS__CGSCC_OPM-NEXT: store i32 [[X2]], i32* [[V]], align 4 -; IS__CGSCC_OPM-NEXT: ret i32* [[V]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@incdec -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* noalias nofree noundef nonnull align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[X:%.*]] = load i32, i32* [[V]], align 4 -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_NPM: T: -; IS__CGSCC_NPM-NEXT: [[X1:%.*]] = add i32 [[X]], 1 -; IS__CGSCC_NPM-NEXT: store i32 [[X1]], i32* [[V]], align 4 -; IS__CGSCC_NPM-NEXT: ret i32* undef -; IS__CGSCC_NPM: F: -; IS__CGSCC_NPM-NEXT: [[X2:%.*]] = sub i32 [[X]], 1 -; IS__CGSCC_NPM-NEXT: store i32 [[X2]], i32* [[V]], align 4 -; IS__CGSCC_NPM-NEXT: ret i32* undef +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@incdec +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]], i32* noalias nofree noundef nonnull align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = load i32, i32* [[V]], align 4 +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: T: +; NOT_TUNIT_NPM-NEXT: [[X1:%.*]] = add i32 [[X]], 1 +; NOT_TUNIT_NPM-NEXT: store i32 [[X1]], i32* [[V]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32* undef +; NOT_TUNIT_NPM: F: +; NOT_TUNIT_NPM-NEXT: [[X2:%.*]] = sub i32 [[X]], 1 +; NOT_TUNIT_NPM-NEXT: store i32 [[X2]], i32* [[V]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32* undef ; %X = load i32, i32* %V br i1 %C, label %T, label %F @@ -65,21 +49,21 @@ ;; This function returns its first argument as a part of a multiple return ;; value define internal { i32, i32 } @foo(i32 %A, i32 %B) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: [[X:%.*]] = add i32 [[A]], [[B]] -; IS__TUNIT____-NEXT: [[Y:%.*]] = insertvalue { i32, i32 } undef, i32 [[A]], 0 -; IS__TUNIT____-NEXT: [[Z:%.*]] = insertvalue { i32, i32 } [[Y]], i32 [[X]], 1 -; IS__TUNIT____-NEXT: ret { i32, i32 } [[Z]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo +; NOT_CGSCC_NPM-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = add i32 [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: [[Y:%.*]] = insertvalue { i32, i32 } undef, i32 [[A]], 0 +; NOT_CGSCC_NPM-NEXT: [[Z:%.*]] = insertvalue { i32, i32 } [[Y]], i32 [[X]], 1 +; NOT_CGSCC_NPM-NEXT: ret { i32, i32 } [[Z]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: [[X:%.*]] = add i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: [[Y:%.*]] = insertvalue { i32, i32 } undef, i32 [[A]], 0 -; IS__CGSCC____-NEXT: [[Z:%.*]] = insertvalue { i32, i32 } [[Y]], i32 [[X]], 1 -; IS__CGSCC____-NEXT: ret { i32, i32 } [[Z]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = add i32 [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: [[Y:%.*]] = insertvalue { i32, i32 } undef, i32 [[A]], 0 +; NOT_TUNIT_NPM-NEXT: [[Z:%.*]] = insertvalue { i32, i32 } [[Y]], i32 [[X]], 1 +; NOT_TUNIT_NPM-NEXT: ret { i32, i32 } [[Z]] ; %X = add i32 %A, %B %Y = insertvalue { i32, i32 } undef, i32 %A, 0 @@ -88,81 +72,44 @@ } define void @caller(i1 %C) personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@caller -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT_OPM-NEXT: [[Q:%.*]] = alloca i32, align 4 -; IS__TUNIT_OPM-NEXT: [[W:%.*]] = call align 4 i32* @incdec(i1 [[C]], i32* noalias nofree noundef nonnull align 4 dereferenceable(4) "no-capture-maybe-returned" [[Q]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT_OPM-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR1]] -; IS__TUNIT_OPM-NEXT: [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0 -; IS__TUNIT_OPM-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR1]] -; IS__TUNIT_OPM-NEXT: 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 nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@caller -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT_NPM-NEXT: [[Q:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: [[W:%.*]] = call align 4 i32* @incdec(i1 [[C]], i32* noalias nofree noundef nonnull align 4 dereferenceable(4) "no-capture-maybe-returned" [[Q]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT_NPM-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR1]] -; IS__TUNIT_NPM-NEXT: [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0 -; IS__TUNIT_NPM-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR1]] -; IS__TUNIT_NPM-NEXT: br label [[OK:%.*]] -; IS__TUNIT_NPM: OK: -; IS__TUNIT_NPM-NEXT: [[X2:%.*]] = extractvalue { i32, i32 } [[S2]], 0 -; IS__TUNIT_NPM-NEXT: [[Z:%.*]] = add i32 [[X1]], [[X2]] -; IS__TUNIT_NPM-NEXT: store i32 [[Z]], i32* [[Q]], align 4 -; IS__TUNIT_NPM-NEXT: br label [[RET:%.*]] -; IS__TUNIT_NPM: LPAD: -; IS__TUNIT_NPM-NEXT: unreachable -; 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 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] personality i32 (...)* @__gxx_personality_v0 { +; NOT_CGSCC_NPM-NEXT: [[Q:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: [[W:%.*]] = call align 4 i32* @incdec(i1 [[C]], i32* noalias nofree noundef nonnull align 4 dereferenceable(4) "no-capture-maybe-returned" [[Q]]) #[[ATTR2:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR1]] +; NOT_CGSCC_NPM-NEXT: [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0 +; NOT_CGSCC_NPM-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR1]] +; NOT_CGSCC_NPM-NEXT: br label [[OK:%.*]] +; NOT_CGSCC_NPM: OK: +; NOT_CGSCC_NPM-NEXT: [[X2:%.*]] = extractvalue { i32, i32 } [[S2]], 0 +; NOT_CGSCC_NPM-NEXT: [[Z:%.*]] = add i32 [[X1]], [[X2]] +; NOT_CGSCC_NPM-NEXT: store i32 [[Z]], i32* [[Q]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[RET:%.*]] +; NOT_CGSCC_NPM: LPAD: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: RET: +; NOT_CGSCC_NPM-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 { -; IS__CGSCC_NPM-NEXT: [[Q:%.*]] = alloca i32, align 4 -; 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) #[[ATTR4:[0-9]+]] -; IS__CGSCC_NPM-NEXT: br label [[OK:%.*]] -; IS__CGSCC_NPM: OK: -; IS__CGSCC_NPM-NEXT: [[X2:%.*]] = extractvalue { i32, i32 } [[S2]], 0 -; IS__CGSCC_NPM-NEXT: [[Z:%.*]] = add i32 [[X1]], [[X2]] -; IS__CGSCC_NPM-NEXT: store i32 [[Z]], i32* [[Q]], align 4 -; IS__CGSCC_NPM-NEXT: br label [[RET:%.*]] -; IS__CGSCC_NPM: LPAD: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: RET: -; IS__CGSCC_NPM-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] personality i32 (...)* @__gxx_personality_v0 { +; NOT_TUNIT_NPM-NEXT: [[Q:%.*]] = alloca i32, align 4 +; NOT_TUNIT_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]+]] +; NOT_TUNIT_NPM-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR3:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0 +; NOT_TUNIT_NPM-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR4:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: br label [[OK:%.*]] +; NOT_TUNIT_NPM: OK: +; NOT_TUNIT_NPM-NEXT: [[X2:%.*]] = extractvalue { i32, i32 } [[S2]], 0 +; NOT_TUNIT_NPM-NEXT: [[Z:%.*]] = add i32 [[X1]], [[X2]] +; NOT_TUNIT_NPM-NEXT: store i32 [[Z]], i32* [[Q]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[RET:%.*]] +; NOT_TUNIT_NPM: LPAD: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: RET: +; NOT_TUNIT_NPM-NEXT: ret void ; %Q = alloca i32 ;; Call incdec to see if %W is properly replaced by %Q @@ -192,13 +139,13 @@ declare i32 @__gxx_personality_v0(...) ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR2:[0-9]+]] = { nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR3:[0-9]+]] = { readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR4:[0-9]+]] = { nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll b/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll @@ -1,31 +1,29 @@ ; 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-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 ; FIXME: icmp folding is missing define i1 @invokecaller(i1 %C) personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@invokecaller -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT____-NEXT: [[X:%.*]] = call i32 @foo(i1 [[C]]) #[[ATTR1:[0-9]+]] -; IS__TUNIT____-NEXT: br label [[OK:%.*]] -; IS__TUNIT____: OK: -; IS__TUNIT____-NEXT: ret i1 true -; IS__TUNIT____: FAIL: -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@invokecaller +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 { +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = call i32 @foo(i1 [[C]]) #[[ATTR1:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: br label [[OK:%.*]] +; NOT_CGSCC_NPM: OK: +; NOT_CGSCC_NPM-NEXT: ret i1 true +; NOT_CGSCC_NPM: FAIL: +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@invokecaller -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 { -; IS__CGSCC____-NEXT: [[X:%.*]] = call i32 @foo(i1 [[C]]) #[[ATTR1:[0-9]+]] -; IS__CGSCC____-NEXT: br label [[OK:%.*]] -; IS__CGSCC____: OK: -; IS__CGSCC____-NEXT: ret i1 true -; IS__CGSCC____: FAIL: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@invokecaller +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 { +; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = call i32 @foo(i1 [[C]]) #[[ATTR1:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: br label [[OK:%.*]] +; NOT_TUNIT_NPM: OK: +; NOT_TUNIT_NPM-NEXT: ret i1 true +; NOT_TUNIT_NPM: FAIL: +; NOT_TUNIT_NPM-NEXT: unreachable ; %X = invoke i32 @foo( i1 %C ) to label %OK unwind label %FAIL ; [#uses=1] OK: @@ -38,23 +36,23 @@ } define internal i32 @foo(i1 %C) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: T: -; IS__TUNIT____-NEXT: ret i32 undef -; IS__TUNIT____: F: -; IS__TUNIT____-NEXT: ret i32 undef +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: T: +; NOT_CGSCC_NPM-NEXT: ret i32 undef +; NOT_CGSCC_NPM: F: +; NOT_CGSCC_NPM-NEXT: ret i32 undef ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: T: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: F: -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: T: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: F: +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; br i1 %C, label %T, label %F @@ -66,15 +64,15 @@ } define i1 @caller(i1 %C) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i1 true +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i1 true ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 true +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i1 true ; %X = call i32 @foo( i1 %C ) ; [#uses=1] %Y = icmp ne i32 %X, 0 ; [#uses=1] @@ -83,9 +81,9 @@ declare i32 @__gxx_personality_v0(...) ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nounwind readnone } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nounwind readnone } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll b/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ;; FIXME: support for extractvalue and insertvalue missing. @@ -9,31 +7,31 @@ %0 = type { i32, i32 } define internal %0 @foo(i1 %Q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (i1 [[Q:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: T: -; IS__TUNIT____-NEXT: [[MRV:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 -; IS__TUNIT____-NEXT: [[MRV1:%.*]] = insertvalue [[TMP0]] [[MRV]], i32 22, 1 -; IS__TUNIT____-NEXT: ret [[TMP0]] [[MRV1]] -; IS__TUNIT____: F: -; IS__TUNIT____-NEXT: [[MRV2:%.*]] = insertvalue [[TMP0]] undef, i32 21, 0 -; IS__TUNIT____-NEXT: [[MRV3:%.*]] = insertvalue [[TMP0]] [[MRV2]], i32 23, 1 -; IS__TUNIT____-NEXT: ret [[TMP0]] [[MRV3]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo +; NOT_CGSCC_NPM-SAME: (i1 [[Q:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: T: +; NOT_CGSCC_NPM-NEXT: [[MRV:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 +; NOT_CGSCC_NPM-NEXT: [[MRV1:%.*]] = insertvalue [[TMP0]] [[MRV]], i32 22, 1 +; NOT_CGSCC_NPM-NEXT: ret [[TMP0]] [[MRV1]] +; NOT_CGSCC_NPM: F: +; NOT_CGSCC_NPM-NEXT: [[MRV2:%.*]] = insertvalue [[TMP0]] undef, i32 21, 0 +; NOT_CGSCC_NPM-NEXT: [[MRV3:%.*]] = insertvalue [[TMP0]] [[MRV2]], i32 23, 1 +; NOT_CGSCC_NPM-NEXT: ret [[TMP0]] [[MRV3]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (i1 [[Q:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: T: -; IS__CGSCC____-NEXT: [[MRV:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 -; IS__CGSCC____-NEXT: [[MRV1:%.*]] = insertvalue [[TMP0]] [[MRV]], i32 22, 1 -; IS__CGSCC____-NEXT: ret [[TMP0]] [[MRV1]] -; IS__CGSCC____: F: -; IS__CGSCC____-NEXT: [[MRV2:%.*]] = insertvalue [[TMP0]] undef, i32 21, 0 -; IS__CGSCC____-NEXT: [[MRV3:%.*]] = insertvalue [[TMP0]] [[MRV2]], i32 23, 1 -; IS__CGSCC____-NEXT: ret [[TMP0]] [[MRV3]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: (i1 [[Q:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: T: +; NOT_TUNIT_NPM-NEXT: [[MRV:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 +; NOT_TUNIT_NPM-NEXT: [[MRV1:%.*]] = insertvalue [[TMP0]] [[MRV]], i32 22, 1 +; NOT_TUNIT_NPM-NEXT: ret [[TMP0]] [[MRV1]] +; NOT_TUNIT_NPM: F: +; NOT_TUNIT_NPM-NEXT: [[MRV2:%.*]] = insertvalue [[TMP0]] undef, i32 21, 0 +; NOT_TUNIT_NPM-NEXT: [[MRV3:%.*]] = insertvalue [[TMP0]] [[MRV2]], i32 23, 1 +; NOT_TUNIT_NPM-NEXT: ret [[TMP0]] [[MRV3]] ; br i1 %Q, label %T, label %F @@ -49,29 +47,29 @@ } define internal %0 @bar(i1 %Q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 -; IS__TUNIT____-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: T: -; IS__TUNIT____-NEXT: [[B:%.*]] = insertvalue [[TMP0]] [[A]], i32 22, 1 -; IS__TUNIT____-NEXT: ret [[TMP0]] [[B]] -; IS__TUNIT____: F: -; IS__TUNIT____-NEXT: [[C:%.*]] = insertvalue [[TMP0]] [[A]], i32 23, 1 -; IS__TUNIT____-NEXT: ret [[TMP0]] [[C]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bar +; NOT_CGSCC_NPM-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: T: +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = insertvalue [[TMP0]] [[A]], i32 22, 1 +; NOT_CGSCC_NPM-NEXT: ret [[TMP0]] [[B]] +; NOT_CGSCC_NPM: F: +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = insertvalue [[TMP0]] [[A]], i32 23, 1 +; NOT_CGSCC_NPM-NEXT: ret [[TMP0]] [[C]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bar -; IS__CGSCC____-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 -; IS__CGSCC____-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: T: -; IS__CGSCC____-NEXT: [[B:%.*]] = insertvalue [[TMP0]] [[A]], i32 22, 1 -; IS__CGSCC____-NEXT: ret [[TMP0]] [[B]] -; IS__CGSCC____: F: -; IS__CGSCC____-NEXT: [[C:%.*]] = insertvalue [[TMP0]] [[A]], i32 23, 1 -; IS__CGSCC____-NEXT: ret [[TMP0]] [[C]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bar +; NOT_TUNIT_NPM-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: T: +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = insertvalue [[TMP0]] [[A]], i32 22, 1 +; NOT_TUNIT_NPM-NEXT: ret [[TMP0]] [[B]] +; NOT_TUNIT_NPM: F: +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = insertvalue [[TMP0]] [[A]], i32 23, 1 +; NOT_TUNIT_NPM-NEXT: ret [[TMP0]] [[C]] ; %A = insertvalue %0 undef, i32 21, 0 br i1 %Q, label %T, label %F @@ -86,17 +84,17 @@ } define %0 @caller(i1 %Q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller -; IS__TUNIT____-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR0]] -; IS__TUNIT____-NEXT: ret [[TMP0]] [[X]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller +; NOT_CGSCC_NPM-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR0]] +; NOT_CGSCC_NPM-NEXT: ret [[TMP0]] [[X]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller -; IS__CGSCC____-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR1:[0-9]+]] -; IS__CGSCC____-NEXT: ret [[TMP0]] [[X]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller +; NOT_TUNIT_NPM-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR1:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret [[TMP0]] [[X]] ; %X = call %0 @foo(i1 %Q) %A = extractvalue %0 %X, 0 @@ -111,33 +109,33 @@ ; Similar to @caller but the result of both calls are actually used. define i32 @caller2(i1 %Q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller2 -; IS__TUNIT____-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR0]] -; IS__TUNIT____-NEXT: [[A:%.*]] = extractvalue [[TMP0]] [[X]], 0 -; IS__TUNIT____-NEXT: [[B:%.*]] = extractvalue [[TMP0]] [[X]], 1 -; IS__TUNIT____-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 [[Q]]) #[[ATTR0]] -; IS__TUNIT____-NEXT: [[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]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller2 +; NOT_CGSCC_NPM-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR0]] +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = extractvalue [[TMP0]] [[X]], 0 +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = extractvalue [[TMP0]] [[X]], 1 +; NOT_CGSCC_NPM-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 [[Q]]) #[[ATTR0]] +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = extractvalue [[TMP0]] [[Y]], 0 +; NOT_CGSCC_NPM-NEXT: [[D:%.*]] = extractvalue [[TMP0]] [[Y]], 1 +; NOT_CGSCC_NPM-NEXT: [[M:%.*]] = add i32 [[A]], [[C]] +; NOT_CGSCC_NPM-NEXT: [[N:%.*]] = add i32 [[B]], [[D]] +; NOT_CGSCC_NPM-NEXT: [[R:%.*]] = add i32 [[N]], [[M]] +; NOT_CGSCC_NPM-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]]) #[[ATTR1]] -; IS__CGSCC____-NEXT: [[A:%.*]] = extractvalue [[TMP0]] [[X]], 0 -; IS__CGSCC____-NEXT: [[B:%.*]] = extractvalue [[TMP0]] [[X]], 1 -; IS__CGSCC____-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 [[Q]]) #[[ATTR1]] -; IS__CGSCC____-NEXT: [[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]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller2 +; NOT_TUNIT_NPM-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR1]] +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = extractvalue [[TMP0]] [[X]], 0 +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = extractvalue [[TMP0]] [[X]], 1 +; NOT_TUNIT_NPM-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 [[Q]]) #[[ATTR1]] +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = extractvalue [[TMP0]] [[Y]], 0 +; NOT_TUNIT_NPM-NEXT: [[D:%.*]] = extractvalue [[TMP0]] [[Y]], 1 +; NOT_TUNIT_NPM-NEXT: [[M:%.*]] = add i32 [[A]], [[C]] +; NOT_TUNIT_NPM-NEXT: [[N:%.*]] = add i32 [[B]], [[D]] +; NOT_TUNIT_NPM-NEXT: [[R:%.*]] = add i32 [[N]], [[M]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[R]] ; %X = call %0 @foo(i1 %Q) %A = extractvalue %0 %X, 0 @@ -152,8 +150,8 @@ ret i32 %R } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll b/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll @@ -1,21 +1,19 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM define internal i32 @testf(i1 %c) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@testf -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br i1 [[C]], label [[IF_COND:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.cond: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@testf +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[IF_COND:%.*]], label [[IF_END:%.*]] +; NOT_TUNIT_NPM: if.cond: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; entry: br i1 %c, label %if.cond, label %if.end @@ -31,17 +29,17 @@ } define internal i32 @test1(i1 %c) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test1 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[IF_THEN:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: br label [[RET1:%.*]] -; IS__CGSCC____: ret1: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: ret2: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test1 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[IF_THEN:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: br label [[RET1:%.*]] +; NOT_TUNIT_NPM: ret1: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: ret2: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: br label %if.then @@ -59,21 +57,21 @@ } define i32 @main(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@main -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32 99 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@main +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i32 99 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@main -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 99 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@main +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32 99 ; %res = call i32 @test1(i1 %c) ret i32 %res } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/thread_local_acs.ll b/llvm/test/Transforms/Attributor/IPConstantProp/thread_local_acs.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/thread_local_acs.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/thread_local_acs.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; ; #include @@ -28,23 +26,23 @@ ; CHECK: @[[GSH:[a-zA-Z0-9_$"\\.-]+]] = dso_local global i32 0, align 4 ;. define internal i32 @callee(i32* %thread_local_ptr, i32* %shared_ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@callee -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[THREAD_LOCAL_PTR:%.*]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[SHARED_PTR:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TMP:%.*]] = load i32, i32* [[THREAD_LOCAL_PTR]], align 4 -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32, i32* @gsh, align 4 -; IS__TUNIT____-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP]], [[TMP1]] -; IS__TUNIT____-NEXT: ret i32 [[ADD]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callee +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[THREAD_LOCAL_PTR:%.*]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[SHARED_PTR:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = load i32, i32* [[THREAD_LOCAL_PTR]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* @gsh, align 4 +; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP]], [[TMP1]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[ADD]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@callee -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[THREAD_LOCAL_PTR:%.*]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[SHARED_PTR:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP:%.*]] = load i32, i32* [[THREAD_LOCAL_PTR]], align 4 -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = load i32, i32* @gsh, align 4 -; IS__CGSCC____-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP]], [[TMP1]] -; IS__CGSCC____-NEXT: ret i32 [[ADD]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callee +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[THREAD_LOCAL_PTR:%.*]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[SHARED_PTR:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = load i32, i32* [[THREAD_LOCAL_PTR]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* @gsh, align 4 +; NOT_TUNIT_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP]], [[TMP1]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[ADD]] ; entry: %tmp = load i32, i32* %thread_local_ptr, align 4 @@ -54,15 +52,15 @@ } define dso_local void @caller() { -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller() { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: call void @broker(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) @gtl, i32 (i32*, i32*)* noundef nonnull @callee, i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) undef) -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller() { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: call void @broker(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) @gtl, i32 (i32*, i32*)* noundef nonnull @callee, i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) undef) +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller() { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: call void @broker(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) @gtl, i32 (i32*, i32*)* noundef nonnull @callee, i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) @gsh) -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller() { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: call void @broker(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) @gtl, i32 (i32*, i32*)* noundef nonnull @callee, i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) @gsh) +; NOT_TUNIT_NPM-NEXT: ret void ; entry: call void @broker(i32* nonnull @gtl, i32 (i32*, i32*)* nonnull @callee, i32* nonnull @gsh) @@ -74,9 +72,9 @@ !1 = !{i64 1, i64 0, i64 2, i1 false} !0 = !{!1} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readonly willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readonly willreturn } ;. ; CHECK: [[META0:![0-9]+]] = !{!1} ; CHECK: [[META1:![0-9]+]] = !{i64 1, i64 0, i64 2, i1 false} diff --git a/llvm/test/Transforms/Attributor/align.ll b/llvm/test/Transforms/Attributor/align.ll --- a/llvm/test/Transforms/Attributor/align.ll +++ b/llvm/test/Transforms/Attributor/align.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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" @@ -18,47 +16,47 @@ ; CHECK: @[[CND:[a-zA-Z0-9_$"\\.-]+]] = external global i1 ;. define i32* @test1(i32* align 8 %0) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test1 -; IS__TUNIT____-SAME: (i32* nofree readnone returned align 8 "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32* [[TMP0]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test1 +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone returned align 8 "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i32* [[TMP0]] ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test1 -; IS__CGSCC____-SAME: (i32* nofree readnone returned align 8 "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32* [[TMP0]] +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test1 +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone returned align 8 "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret i32* [[TMP0]] ; ret i32* %0 } ; TEST 2 define i32* @test2(i32* %0) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* [[TMP0]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32* [[TMP0]] ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* [[TMP0]] +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32* [[TMP0]] ; ret i32* %0 } ; TEST 3 define i32* @test3(i32* align 8 %0, i32* align 4 %1, i1 %2) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test3 -; IS__TUNIT____-SAME: (i32* nofree readnone align 8 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 4 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] -; IS__TUNIT____-NEXT: ret i32* [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test3 -; IS__CGSCC____-SAME: (i32* nofree readnone align 8 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 4 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] -; IS__CGSCC____-NEXT: ret i32* [[RET]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test3 +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone align 8 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 4 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test3 +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone align 8 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 4 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] +; NOT_TUNIT_NPM-NEXT: ret i32* [[RET]] ; %ret = select i1 %2, i32* %0, i32* %1 ret i32* %ret @@ -66,17 +64,17 @@ ; TEST 4 define i32* @test4(i32* align 32 %0, i32* align 32 %1, i1 %2) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test4 -; IS__TUNIT____-SAME: (i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] -; IS__TUNIT____-NEXT: ret i32* [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test4 -; IS__CGSCC____-SAME: (i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] -; IS__CGSCC____-NEXT: ret i32* [[RET]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test4 +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test4 +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] +; NOT_TUNIT_NPM-NEXT: ret i32* [[RET]] ; %ret = select i1 %2, i32* %0, i32* %1 ret i32* %ret @@ -113,10 +111,10 @@ ; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test6_1 -; IS__CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test6_1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %ret = tail call i32* @test6_2() ret i32* %ret @@ -128,10 +126,10 @@ ; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test6_2 -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test6_2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %ret = tail call i32* @test6_1() ret i32* %ret @@ -157,23 +155,15 @@ ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f1(i8* readnone %0) local_unnamed_addr #0 { -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(1) [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] { -; 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* undef -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC_NPM-SAME: () local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: br label [[TMP2:%.*]] -; IS__CGSCC_NPM: 1: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: 2: -; IS__CGSCC_NPM-NEXT: ret i8* undef +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f1 +; NOT_TUNIT_NPM-SAME: () local_unnamed_addr #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: br label [[TMP2:%.*]] +; NOT_TUNIT_NPM: 1: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: 2: +; NOT_TUNIT_NPM-NEXT: ret i8* undef ; %2 = icmp eq i8* %0, null br i1 %2, label %3, label %5 @@ -190,27 +180,17 @@ ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f2(i8* readnone %0) local_unnamed_addr #0 { -; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f2 -; IS__CGSCC_OPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR3:[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 #[[ATTR2:[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 +; +; NOT_TUNIT_NPM: Function Attrs: noinline nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f2 +; NOT_TUNIT_NPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: 2: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: 3: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: 4: +; NOT_TUNIT_NPM-NEXT: unreachable ; %2 = icmp eq i8* %0, null br i1 %2, label %5, label %3 @@ -231,23 +211,15 @@ ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f3(i8* readnone %0) local_unnamed_addr #0 { -; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f3 -; IS__CGSCC_OPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR3]] { -; 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 #[[ATTR2]] { -; 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 +; +; NOT_TUNIT_NPM: Function Attrs: noinline nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f3 +; NOT_TUNIT_NPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: br label [[TMP3:%.*]] +; NOT_TUNIT_NPM: 2: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: 3: +; NOT_TUNIT_NPM-NEXT: ret i8* @a1 ; %2 = icmp eq i8* %0, null br i1 %2, label %3, label %5 @@ -264,15 +236,15 @@ ; TEST 7 ; Better than IR information define align 4 i8* @test7() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test7 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i8* @a1 +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test7 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i8* @a1 ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test7 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i8* @a1 +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test7 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i8* @a1 ; %c = tail call i8* @f1(i8* align 8 dereferenceable(1) @a1) ret i8* %c @@ -281,23 +253,15 @@ ; TEST 7b ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f1b(i8* readnone %0) local_unnamed_addr #0 { -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f1b -; IS__CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(1) [[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* undef -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f1b -; IS__CGSCC_NPM-SAME: () local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: br label [[TMP2:%.*]] -; IS__CGSCC_NPM: 1: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: 2: -; IS__CGSCC_NPM-NEXT: ret i8* undef +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f1b +; NOT_TUNIT_NPM-SAME: () local_unnamed_addr #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: br label [[TMP2:%.*]] +; NOT_TUNIT_NPM: 1: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: 2: +; NOT_TUNIT_NPM-NEXT: ret i8* undef ; %2 = icmp eq i8* %0, null br i1 %2, label %3, label %5 @@ -316,27 +280,17 @@ ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f2b(i8* readnone %0) local_unnamed_addr #0 { ; -; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f2b -; IS__CGSCC_OPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR3]] { -; 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 #[[ATTR2]] { -; 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 +; +; NOT_TUNIT_NPM: Function Attrs: noinline nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f2b +; NOT_TUNIT_NPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: 2: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: 3: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: 4: +; NOT_TUNIT_NPM-NEXT: unreachable ; %2 = icmp eq i8* %0, null br i1 %2, label %5, label %3 @@ -358,23 +312,15 @@ ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f3b(i8* readnone %0) local_unnamed_addr #0 { ; -; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f3b -; IS__CGSCC_OPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR3]] { -; 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 #[[ATTR2]] { -; 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 +; +; NOT_TUNIT_NPM: Function Attrs: noinline nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f3b +; NOT_TUNIT_NPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: br label [[TMP3:%.*]] +; NOT_TUNIT_NPM: 2: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: 3: +; NOT_TUNIT_NPM-NEXT: ret i8* @a1 ; %2 = icmp eq i8* %0, null br i1 %2, label %3, label %5 @@ -389,15 +335,15 @@ } define align 4 i32* @test7b(i32* align 32 %p) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test7b -; IS__TUNIT____-SAME: (i32* nofree readnone returned align 32 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* [[P]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test7b +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone returned align 32 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32* [[P]] ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test7b -; IS__CGSCC____-SAME: (i32* nofree readnone returned align 32 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* [[P]] +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test7b +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone returned align 32 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32* [[P]] ; tail call i8* @f1b(i8* align 8 dereferenceable(1) @a1) ret i32* %p @@ -405,32 +351,23 @@ ; 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]]) #[[ATTR2:[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]]) #[[ATTR2]] -; 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]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test8_helper() { -; IS__CGSCC_OPM-NEXT: [[PTR0:%.*]] = tail call i32* @unknown() -; IS__CGSCC_OPM-NEXT: [[PTR1:%.*]] = tail call align 4 i32* @unknown() -; IS__CGSCC_OPM-NEXT: [[PTR2:%.*]] = tail call align 8 i32* @unknown() -; IS__CGSCC_OPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone [[PTR0]]) #[[ATTR4:[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]]) #[[ATTR4]] -; 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]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test8_helper() { -; IS__CGSCC_NPM-NEXT: [[PTR0:%.*]] = tail call i32* @unknown() -; IS__CGSCC_NPM-NEXT: [[PTR1:%.*]] = tail call align 4 i32* @unknown() -; IS__CGSCC_NPM-NEXT: [[PTR2:%.*]] = tail call align 8 i32* @unknown() -; IS__CGSCC_NPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone [[PTR0]]) #[[ATTR3:[0-9]+]] -; IS__CGSCC_NPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR3]] -; IS__CGSCC_NPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR3]] -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test8_helper() { +; NOT_CGSCC_NPM-NEXT: [[PTR0:%.*]] = tail call i32* @unknown() +; NOT_CGSCC_NPM-NEXT: [[PTR1:%.*]] = tail call align 4 i32* @unknown() +; NOT_CGSCC_NPM-NEXT: [[PTR2:%.*]] = tail call align 8 i32* @unknown() +; NOT_CGSCC_NPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone [[PTR0]]) #[[ATTR2:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test8_helper() { +; NOT_TUNIT_NPM-NEXT: [[PTR0:%.*]] = tail call i32* @unknown() +; NOT_TUNIT_NPM-NEXT: [[PTR1:%.*]] = tail call align 4 i32* @unknown() +; NOT_TUNIT_NPM-NEXT: [[PTR2:%.*]] = tail call align 8 i32* @unknown() +; NOT_TUNIT_NPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone [[PTR0]]) #[[ATTR3:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: ret void ; %ptr0 = tail call i32* @unknown() %ptr1 = tail call align 4 i32* @unknown() @@ -444,29 +381,21 @@ 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:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test8 -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture readnone align 4 [[A:%.*]], i32* noalias nocapture readnone align 4 [[B:%.*]], i32* noalias nocapture readnone [[C:%.*]]) #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nounwind -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test8 -; IS__CGSCC_NPM-SAME: (i32* noalias nocapture readnone align 4 [[A:%.*]], i32* noalias nocapture readnone align 4 [[B:%.*]], i32* noalias nocapture readnone [[C:%.*]]) #[[ATTR3]] { -; IS__CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) #[[ATTR3]] -; IS__CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) #[[ATTR3]] -; IS__CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) #[[ATTR3]] -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test8 +; NOT_CGSCC_NPM-SAME: (i32* noalias nocapture readnone align 4 [[A:%.*]], i32* noalias nocapture readnone align 4 [[B:%.*]], i32* noalias nocapture readnone [[C:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test8 +; NOT_TUNIT_NPM-SAME: (i32* noalias nocapture readnone align 4 [[A:%.*]], i32* noalias nocapture readnone align 4 [[B:%.*]], i32* noalias nocapture readnone [[C:%.*]]) #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @user_i32_ptr(i32* %a) call void @user_i32_ptr(i32* %b) @@ -494,62 +423,43 @@ ; FIXME: This will work with an upcoming patch (D66618 or similar) ; store i32 -1, i32* %g1, align 32 define i32* @test10a(i32* align 32 %p) { -; 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:%.*]]) #[[ATTR3:[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]]) #[[ATTR3]] -; 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_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:%.*]]) #[[ATTR5:[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]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[R]], align 32 -; IS__CGSCC_OPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__CGSCC_OPM-NEXT: br label [[E:%.*]] -; IS__CGSCC_OPM: f: -; IS__CGSCC_OPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__CGSCC_OPM-NEXT: store i32 -1, i32* [[G1]], align 32 -; IS__CGSCC_OPM-NEXT: br label [[E]] -; IS__CGSCC_OPM: e: -; IS__CGSCC_OPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] -; IS__CGSCC_OPM-NEXT: ret i32* [[PHI]] -; -; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test10a -; IS__CGSCC_NPM-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_NPM: t: -; IS__CGSCC_NPM-NEXT: [[R:%.*]] = call align 32 i32* @test10a(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR4]] -; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[R]], align 32 -; IS__CGSCC_NPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__CGSCC_NPM-NEXT: br label [[E:%.*]] -; IS__CGSCC_NPM: f: -; IS__CGSCC_NPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__CGSCC_NPM-NEXT: store i32 -1, i32* [[G1]], align 32 -; IS__CGSCC_NPM-NEXT: br label [[E]] -; IS__CGSCC_NPM: e: -; IS__CGSCC_NPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] -; IS__CGSCC_NPM-NEXT: ret i32* [[PHI]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test10a +; NOT_CGSCC_NPM-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: [[R:%.*]] = call align 32 i32* @test10a(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR3]] +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[R]], align 32 +; NOT_CGSCC_NPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; NOT_CGSCC_NPM-NEXT: br label [[E:%.*]] +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; NOT_CGSCC_NPM-NEXT: store i32 -1, i32* [[G1]], align 32 +; NOT_CGSCC_NPM-NEXT: br label [[E]] +; NOT_CGSCC_NPM: e: +; NOT_CGSCC_NPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] +; NOT_CGSCC_NPM-NEXT: ret i32* [[PHI]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test10a +; NOT_TUNIT_NPM-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: [[R:%.*]] = call align 32 i32* @test10a(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR4]] +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[R]], align 32 +; NOT_TUNIT_NPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; NOT_TUNIT_NPM-NEXT: br label [[E:%.*]] +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; NOT_TUNIT_NPM-NEXT: store i32 -1, i32* [[G1]], align 32 +; NOT_TUNIT_NPM-NEXT: br label [[E]] +; NOT_TUNIT_NPM: e: +; NOT_TUNIT_NPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] +; NOT_TUNIT_NPM-NEXT: ret i32* [[PHI]] ; %l = load i32, i32* %p %c = icmp eq i32 %l, 0 @@ -575,62 +485,43 @@ ; FIXME: This will work with an upcoming patch (D66618 or similar) ; store i32 -1, i32* %g1, align 32 define i32* @test10b(i32* align 32 %p) { -; 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:%.*]]) #[[ATTR3]] { -; 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]]) #[[ATTR3]] -; 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_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:%.*]]) #[[ATTR5]] { -; 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]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[R]], align 32 -; IS__CGSCC_OPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__CGSCC_OPM-NEXT: br label [[E:%.*]] -; IS__CGSCC_OPM: f: -; IS__CGSCC_OPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8 -; IS__CGSCC_OPM-NEXT: store i32 -1, i32* [[G1]], align 32 -; IS__CGSCC_OPM-NEXT: br label [[E]] -; IS__CGSCC_OPM: e: -; IS__CGSCC_OPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] -; IS__CGSCC_OPM-NEXT: ret i32* [[PHI]] -; -; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test10b -; IS__CGSCC_NPM-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4]] { -; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_NPM: t: -; IS__CGSCC_NPM-NEXT: [[R:%.*]] = call align 32 i32* @test10b(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR4]] -; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[R]], align 32 -; IS__CGSCC_NPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 -; IS__CGSCC_NPM-NEXT: br label [[E:%.*]] -; IS__CGSCC_NPM: f: -; IS__CGSCC_NPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8 -; IS__CGSCC_NPM-NEXT: store i32 -1, i32* [[G1]], align 32 -; IS__CGSCC_NPM-NEXT: br label [[E]] -; IS__CGSCC_NPM: e: -; IS__CGSCC_NPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] -; IS__CGSCC_NPM-NEXT: ret i32* [[PHI]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test10b +; NOT_CGSCC_NPM-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: [[R:%.*]] = call align 32 i32* @test10b(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR3]] +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[R]], align 32 +; NOT_CGSCC_NPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; NOT_CGSCC_NPM-NEXT: br label [[E:%.*]] +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8 +; NOT_CGSCC_NPM-NEXT: store i32 -1, i32* [[G1]], align 32 +; NOT_CGSCC_NPM-NEXT: br label [[E]] +; NOT_CGSCC_NPM: e: +; NOT_CGSCC_NPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] +; NOT_CGSCC_NPM-NEXT: ret i32* [[PHI]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test10b +; NOT_TUNIT_NPM-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: [[R:%.*]] = call align 32 i32* @test10b(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR4]] +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[R]], align 32 +; NOT_TUNIT_NPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; NOT_TUNIT_NPM-NEXT: br label [[E:%.*]] +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8 +; NOT_TUNIT_NPM-NEXT: store i32 -1, i32* [[G1]], align 32 +; NOT_TUNIT_NPM-NEXT: br label [[E]] +; NOT_TUNIT_NPM: e: +; NOT_TUNIT_NPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] +; NOT_TUNIT_NPM-NEXT: ret i32* [[PHI]] ; %l = load i32, i32* %p %c = icmp eq i32 %l, 0 @@ -651,26 +542,19 @@ define i64 @test11(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test11 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__TUNIT____-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8 -; IS__TUNIT____-NEXT: ret i64 [[RET]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test11 -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8 -; IS__CGSCC_OPM-NEXT: ret i64 [[RET]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test11 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8 -; IS__CGSCC_NPM-NEXT: ret i64 [[RET]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test11 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8 +; NOT_CGSCC_NPM-NEXT: ret i64 [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test11 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR5:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8 +; NOT_TUNIT_NPM-NEXT: ret i64 [[RET]] ; %p-cast = bitcast i32* %p to i64* %ret = load i64, i64* %p-cast, align 8 @@ -682,32 +566,23 @@ ; FXIME: %p should have nonnull define i64 @test12-1(i32* align 4 %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-1 -; IS__TUNIT____-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR4]] { -; 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_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:%.*]]) #[[ATTR6]] { -; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16 -; IS__CGSCC_OPM-NEXT: ret i64 [[RET]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-1 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR5]] { -; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16 -; IS__CGSCC_NPM-NEXT: ret i64 [[RET]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test12-1 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16 +; NOT_CGSCC_NPM-NEXT: ret i64 [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test12-1 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR5]] { +; NOT_TUNIT_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16 +; NOT_TUNIT_NPM-NEXT: ret i64 [[RET]] ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 1 @@ -717,29 +592,21 @@ } define i64 @test12-2(i32* align 4 %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-2 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly 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: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16 -; IS__TUNIT____-NEXT: ret i64 [[RET]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-2 -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[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: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16 -; IS__CGSCC_OPM-NEXT: ret i64 [[RET]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-2 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] { -; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16 -; IS__CGSCC_NPM-NEXT: ret i64 [[RET]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test12-2 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16 +; NOT_CGSCC_NPM-NEXT: ret i64 [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test12-2 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] { +; NOT_TUNIT_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16 +; NOT_TUNIT_NPM-NEXT: ret i64 [[RET]] ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 0 @@ -749,32 +616,23 @@ ; FXIME: %p should have nonnull define void @test12-3(i32* align 4 %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-3 -; IS__TUNIT____-SAME: (i32* nocapture nofree writeonly 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: store i64 0, i64* [[ARRAYIDX1]], align 16 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-3 -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[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: store i64 0, i64* [[ARRAYIDX1]], align 16 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-3 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 -; IS__CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX1]], align 16 -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test12-3 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR5:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; NOT_CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX1]], align 16 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test12-3 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR6:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; NOT_TUNIT_NPM-NEXT: store i64 0, i64* [[ARRAYIDX1]], align 16 +; NOT_TUNIT_NPM-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 1 @@ -784,29 +642,21 @@ } define void @test12-4(i32* align 4 %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-4 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] { -; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; IS__TUNIT____-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-4 -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[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: store i64 0, i64* [[ARRAYIDX0]], align 16 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-4 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR6]] { -; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; IS__CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16 -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test12-4 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] { +; NOT_CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; NOT_CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test12-4 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; NOT_TUNIT_NPM-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16 +; NOT_TUNIT_NPM-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 0 @@ -817,32 +667,23 @@ 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:%.*]]) #[[ATTR6:[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]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-5 -; IS__CGSCC_OPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR8:[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]]) #[[ATTR8]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-5 -; IS__CGSCC_NPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 -; IS__CGSCC_NPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX1]]) #[[ATTR7]] -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test12-5 +; NOT_CGSCC_NPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR6:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; NOT_CGSCC_NPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX1]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test12-5 +; NOT_TUNIT_NPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; NOT_TUNIT_NPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX1]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 1 @@ -852,29 +693,21 @@ } 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:%.*]]) #[[ATTR6]] { -; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; IS__TUNIT____-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-6 -; IS__CGSCC_OPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR8]] { -; IS__CGSCC_OPM-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]]) #[[ATTR8]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-6 -; IS__CGSCC_NPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR7]] { -; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 -; IS__CGSCC_NPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) #[[ATTR7]] -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test12-6 +; NOT_CGSCC_NPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR6]] { +; NOT_CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; NOT_CGSCC_NPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test12-6 +; NOT_TUNIT_NPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR7]] { +; NOT_TUNIT_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; NOT_TUNIT_NPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 0 @@ -883,44 +716,31 @@ } define void @test13(i1 %c, i32* align 32 %dst) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test13 -; 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]] ], [ null, [[FALSEBB]] ] -; IS__TUNIT____-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[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]] ], [ null, [[FALSEBB]] ] -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test13 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC_NPM: truebb: -; IS__CGSCC_NPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_NPM: falsebb: -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ null, [[FALSEBB]] ] -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test13 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; NOT_CGSCC_NPM: truebb: +; NOT_CGSCC_NPM-NEXT: br label [[END:%.*]] +; NOT_CGSCC_NPM: falsebb: +; NOT_CGSCC_NPM-NEXT: br label [[END]] +; NOT_CGSCC_NPM: end: +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ null, [[FALSEBB]] ] +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[PTR]], align 32 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test13 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; NOT_TUNIT_NPM: truebb: +; NOT_TUNIT_NPM-NEXT: br label [[END:%.*]] +; NOT_TUNIT_NPM: falsebb: +; NOT_TUNIT_NPM-NEXT: br label [[END]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ null, [[FALSEBB]] ] +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[PTR]], align 32 +; NOT_TUNIT_NPM-NEXT: ret void ; br i1 %c, label %truebb, label %falsebb truebb: @@ -934,44 +754,31 @@ } define void @test13-1(i1 %c, i32* align 32 %dst) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test13-1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[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_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:%.*]]) #[[ATTR10:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC_OPM: truebb: -; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_OPM: falsebb: -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 48 to i32*), [[FALSEBB]] ] -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 16 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test13-1 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC_NPM: truebb: -; IS__CGSCC_NPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_NPM: falsebb: -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 48 to i32*), [[FALSEBB]] ] -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[PTR]], align 16 -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test13-1 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; NOT_CGSCC_NPM: truebb: +; NOT_CGSCC_NPM-NEXT: br label [[END:%.*]] +; NOT_CGSCC_NPM: falsebb: +; NOT_CGSCC_NPM-NEXT: br label [[END]] +; NOT_CGSCC_NPM: end: +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 48 to i32*), [[FALSEBB]] ] +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[PTR]], align 16 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test13-1 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; NOT_TUNIT_NPM: truebb: +; NOT_TUNIT_NPM-NEXT: br label [[END:%.*]] +; NOT_TUNIT_NPM: falsebb: +; NOT_TUNIT_NPM-NEXT: br label [[END]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 48 to i32*), [[FALSEBB]] ] +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[PTR]], align 16 +; NOT_TUNIT_NPM-NEXT: ret void ; br i1 %c, label %truebb, label %falsebb truebb: @@ -985,44 +792,31 @@ } define void @test13-2(i1 %c, i32* align 32 %dst) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test13-2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { -; 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_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:%.*]]) #[[ATTR10]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC_OPM: truebb: -; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_OPM: falsebb: -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 160 to i32*), [[FALSEBB]] ] -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test13-2 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] { -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC_NPM: truebb: -; IS__CGSCC_NPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_NPM: falsebb: -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 160 to i32*), [[FALSEBB]] ] -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test13-2 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; NOT_CGSCC_NPM: truebb: +; NOT_CGSCC_NPM-NEXT: br label [[END:%.*]] +; NOT_CGSCC_NPM: falsebb: +; NOT_CGSCC_NPM-NEXT: br label [[END]] +; NOT_CGSCC_NPM: end: +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 160 to i32*), [[FALSEBB]] ] +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[PTR]], align 32 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test13-2 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; NOT_TUNIT_NPM: truebb: +; NOT_TUNIT_NPM-NEXT: br label [[END:%.*]] +; NOT_TUNIT_NPM: falsebb: +; NOT_TUNIT_NPM-NEXT: br label [[END]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 160 to i32*), [[FALSEBB]] ] +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[PTR]], align 32 +; NOT_TUNIT_NPM-NEXT: ret void ; br i1 %c, label %truebb, label %falsebb truebb: @@ -1036,44 +830,31 @@ } define void @test13-3(i1 %c, i32* align 32 %dst) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test13-3 -; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { -; 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_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:%.*]]) #[[ATTR10]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC_OPM: truebb: -; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_OPM: falsebb: -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 128 to i32*), [[FALSEBB]] ] -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test13-3 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] { -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] -; IS__CGSCC_NPM: truebb: -; IS__CGSCC_NPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_NPM: falsebb: -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 128 to i32*), [[FALSEBB]] ] -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[PTR]], align 32 -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test13-3 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; NOT_CGSCC_NPM: truebb: +; NOT_CGSCC_NPM-NEXT: br label [[END:%.*]] +; NOT_CGSCC_NPM: falsebb: +; NOT_CGSCC_NPM-NEXT: br label [[END]] +; NOT_CGSCC_NPM: end: +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 128 to i32*), [[FALSEBB]] ] +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[PTR]], align 32 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test13-3 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; NOT_TUNIT_NPM: truebb: +; NOT_TUNIT_NPM-NEXT: br label [[END:%.*]] +; NOT_TUNIT_NPM: falsebb: +; NOT_TUNIT_NPM-NEXT: br label [[END]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 128 to i32*), [[FALSEBB]] ] +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[PTR]], align 32 +; NOT_TUNIT_NPM-NEXT: ret void ; br i1 %c, label %truebb, label %falsebb truebb: @@ -1088,45 +869,33 @@ ; Don't crash on ptr2int/int2ptr uses. define i64 @ptr2int(i32* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ptr2int -; IS__TUNIT____-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__TUNIT____-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64 -; IS__TUNIT____-NEXT: ret i64 [[P2I]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ptr2int -; IS__CGSCC_OPM-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR11:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64 -; IS__CGSCC_OPM-NEXT: ret i64 [[P2I]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ptr2int -; IS__CGSCC_NPM-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR10:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64 -; IS__CGSCC_NPM-NEXT: ret i64 [[P2I]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ptr2int +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR9:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64 +; NOT_CGSCC_NPM-NEXT: ret i64 [[P2I]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ptr2int +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64 +; NOT_TUNIT_NPM-NEXT: ret i64 [[P2I]] ; %p2i = ptrtoint i32* %p to i64 ret i64 %p2i } define i64* @int2ptr(i64 %i) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@int2ptr -; IS__TUNIT____-SAME: (i64 [[I:%.*]]) #[[ATTR9]] { -; IS__TUNIT____-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64* -; IS__TUNIT____-NEXT: ret i64* [[I2P]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@int2ptr -; IS__CGSCC_OPM-SAME: (i64 [[I:%.*]]) #[[ATTR11]] { -; IS__CGSCC_OPM-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64* -; IS__CGSCC_OPM-NEXT: ret i64* [[I2P]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@int2ptr -; IS__CGSCC_NPM-SAME: (i64 [[I:%.*]]) #[[ATTR10]] { -; IS__CGSCC_NPM-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64* -; IS__CGSCC_NPM-NEXT: ret i64* [[I2P]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@int2ptr +; NOT_CGSCC_NPM-SAME: (i64 [[I:%.*]]) #[[ATTR9]] { +; NOT_CGSCC_NPM-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64* +; NOT_CGSCC_NPM-NEXT: ret i64* [[I2P]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@int2ptr +; NOT_TUNIT_NPM-SAME: (i64 [[I:%.*]]) #[[ATTR10]] { +; NOT_TUNIT_NPM-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64* +; NOT_TUNIT_NPM-NEXT: ret i64* [[I2P]] ; %i2p = inttoptr i64 %i to i64* ret i64* %i2p @@ -1134,23 +903,17 @@ ; Use the store alignment only for the pointer operand. define void @aligned_store(i8* %Value, i8** %Ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@aligned_store -; IS__TUNIT____-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR5]] { -; IS__TUNIT____-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@aligned_store -; IS__CGSCC_OPM-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR7]] { -; IS__CGSCC_OPM-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@aligned_store -; IS__CGSCC_NPM-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR6]] { -; IS__CGSCC_NPM-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32 -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@aligned_store +; NOT_CGSCC_NPM-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR5]] { +; NOT_CGSCC_NPM-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@aligned_store +; NOT_TUNIT_NPM-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32 +; NOT_TUNIT_NPM-NEXT: ret void ; store i8* %Value, i8** %Ptr, align 32 ret void @@ -1170,26 +933,19 @@ } define void @align_store_after_bc(i32* align 2048 %arg) { ; -; IS__TUNIT____: Function Attrs: argmemonly nofree 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:%.*]]) #[[ATTR5]] { -; IS__TUNIT____-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8* -; IS__TUNIT____-NEXT: store i8 0, i8* [[BC]], align 2048 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@align_store_after_bc -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR7]] { -; IS__CGSCC_OPM-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8* -; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[BC]], align 2048 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@align_store_after_bc -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR6]] { -; IS__CGSCC_NPM-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8* -; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[BC]], align 2048 -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@align_store_after_bc +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR5]] { +; NOT_CGSCC_NPM-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8* +; NOT_CGSCC_NPM-NEXT: store i8 0, i8* [[BC]], align 2048 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@align_store_after_bc +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8* +; NOT_TUNIT_NPM-NEXT: store i8 0, i8* [[BC]], align 2048 +; NOT_TUNIT_NPM-NEXT: ret void ; %bc = bitcast i32* %arg to i8* store i8 0, i8* %bc @@ -1200,60 +956,43 @@ ; we cannot also put on the caller. @cnd = external global i1 define i32 @musttail_callee_1(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@musttail_callee_1 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32 -; IS__TUNIT____-NEXT: ret i32 [[V]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@musttail_callee_1 -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR6]] { -; IS__CGSCC_OPM-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32 -; IS__CGSCC_OPM-NEXT: ret i32 [[V]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@musttail_callee_1 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR5]] { -; IS__CGSCC_NPM-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32 -; IS__CGSCC_NPM-NEXT: ret i32 [[V]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@musttail_callee_1 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32 +; NOT_CGSCC_NPM-NEXT: ret i32 [[V]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@musttail_callee_1 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR5]] { +; NOT_TUNIT_NPM-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32 +; NOT_TUNIT_NPM-NEXT: ret i32 [[V]] ; %v = load i32, i32* %p, align 32 ret i32 %v } define i32 @musttail_caller_1(i32* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@musttail_caller_1 -; 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]] -; IS__TUNIT____-NEXT: ret i32 [[V]] -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@musttail_caller_1 -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR12:[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]]) #[[ATTR13:[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:%.*]]) #[[ATTR11:[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]]) #[[ATTR12:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 [[V]] -; IS__CGSCC_NPM: exit: -; IS__CGSCC_NPM-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@musttail_caller_1 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = load i1, i1* @cnd, align 1 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]] +; NOT_CGSCC_NPM: mt: +; NOT_CGSCC_NPM-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree readonly [[P]]) #[[ATTR10]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[V]] +; NOT_CGSCC_NPM: exit: +; NOT_CGSCC_NPM-NEXT: ret i32 0 +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@musttail_caller_1 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR11:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = load i1, i1* @cnd, align 1 +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]] +; NOT_TUNIT_NPM: mt: +; NOT_TUNIT_NPM-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR12:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[V]] +; NOT_TUNIT_NPM: exit: +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; %c = load i1, i1* @cnd br i1 %c, label %mt, label %exit @@ -1265,53 +1004,37 @@ } 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:%.*]]) #[[ATTR2]] { -; 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]]) #[[ATTR2]] -; 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]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: ret i32* [[RETVAL_0]] -; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@checkAndAdvance -; IS__CGSCC_OPM-SAME: (i32* noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4]] { -; 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]]) #[[ATTR4]] -; 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]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: ret i32* [[RETVAL_0]] -; -; IS__CGSCC_NPM: Function Attrs: nounwind -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@checkAndAdvance -; IS__CGSCC_NPM-SAME: (i32* noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 16 -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] -; IS__CGSCC_NPM: if.then: -; IS__CGSCC_NPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 4 -; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call nonnull align 16 i32* @checkAndAdvance(i32* nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR3]] -; IS__CGSCC_NPM-NEXT: br label [[RETURN]] -; IS__CGSCC_NPM: return: -; IS__CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ] -; IS__CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) #[[ATTR3]] -; IS__CGSCC_NPM-NEXT: ret i32* [[RETVAL_0]] +; NOT_CGSCC_NPM: Function Attrs: nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@checkAndAdvance +; NOT_CGSCC_NPM-SAME: (i32* noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 16 +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 4 +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call nonnull align 16 i32* @checkAndAdvance(i32* nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ] +; NOT_CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[RETVAL_0]] +; +; NOT_TUNIT_NPM: Function Attrs: nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@checkAndAdvance +; NOT_TUNIT_NPM-SAME: (i32* noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 16 +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 4 +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call nonnull align 16 i32* @checkAndAdvance(i32* nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ] +; NOT_TUNIT_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: ret i32* [[RETVAL_0]] ; entry: %0 = load i32, i32* %p, align 4 @@ -1347,44 +1070,29 @@ attributes #1 = { uwtable noinline } attributes #2 = { null_pointer_is_valid } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nosync nounwind } -; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR6]] = { nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR7]] = { argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR8]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR9]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR10]] = { nofree nosync nounwind readonly willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { noinline nounwind uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR5]] = { nofree nosync nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR7]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR9]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR12]] = { nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR13]] = { readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR10]] = { nofree nosync nounwind readonly willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { noinline nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR8]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR12]] = { readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { noinline nounwind uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR7]] = { nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR8]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR12]] = { readonly willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/alwaysinline.ll b/llvm/test/Transforms/Attributor/alwaysinline.ll --- a/llvm/test/Transforms/Attributor/alwaysinline.ll +++ b/llvm/test/Transforms/Attributor/alwaysinline.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; ; When a function is marked `alwaysinline` and is able to be inlined, @@ -10,34 +8,34 @@ ; the function is not exactly defined, and marked alwaysinline and can be inlined, ; so the function can be analyzed define linkonce void @inner1() alwaysinline { -; IS__TUNIT____: Function Attrs: alwaysinline nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@inner1 -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: alwaysinline nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@inner1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: alwaysinline nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@inner1 -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: alwaysinline nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@inner1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: ret void } define void @outer1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@outer1 -; IS__TUNIT____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@outer1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[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____-LABEL: define {{[^@]+}}@outer1 -; IS__CGSCC____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@outer1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: call void @inner1() @@ -105,11 +103,11 @@ ret i32 %call } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { alwaysinline nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { alwaysinline } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { alwaysinline nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { alwaysinline } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { alwaysinline nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { alwaysinline } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { alwaysinline nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { alwaysinline } ;. diff --git a/llvm/test/Transforms/Attributor/callbacks.ll b/llvm/test/Transforms/Attributor/callbacks.ll --- a/llvm/test/Transforms/Attributor/callbacks.ll +++ b/llvm/test/Transforms/Attributor/callbacks.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" @@ -16,53 +14,30 @@ ; transfer in both directions. define void @t0_caller(i32* %a) { -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@t0_caller -; IS__TUNIT_OPM-SAME: (i32* align 256 [[A:%.*]]) { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[B:%.*]] = alloca i32, align 32 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = alloca i32*, align 64 -; IS__TUNIT_OPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* -; IS__TUNIT_OPM-NEXT: store i32 42, i32* [[B]], align 32 -; IS__TUNIT_OPM-NEXT: store i32* [[B]], i32** [[C]], align 64 -; IS__TUNIT_OPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t0_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t0_callback_callee to void (i32*, i32*, ...)*), i32* align 256 [[A]], i64 undef, i32** nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@t0_caller -; IS__TUNIT_NPM-SAME: (i32* align 256 [[A:%.*]]) { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 32 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = alloca i32*, align 64 -; IS__TUNIT_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* -; IS__TUNIT_NPM-NEXT: store i32 42, i32* [[B]], align 32 -; IS__TUNIT_NPM-NEXT: store i32* [[B]], i32** [[C]], align 64 -; IS__TUNIT_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t0_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t0_callback_callee to void (i32*, i32*, ...)*), i32* align 256 [[A]], i64 undef, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@t0_caller -; IS__CGSCC_OPM-SAME: (i32* align 256 [[A:%.*]]) { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = alloca i32, align 32 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = alloca i32*, align 64 -; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* -; IS__CGSCC_OPM-NEXT: store i32 42, i32* [[B]], align 32 -; IS__CGSCC_OPM-NEXT: store i32* [[B]], i32** [[C]], align 64 -; IS__CGSCC_OPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t0_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t0_callback_callee to void (i32*, i32*, ...)*), i32* align 256 [[A]], i64 noundef 99, i32** nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@t0_caller -; IS__CGSCC_NPM-SAME: (i32* align 256 [[A:%.*]]) { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 32 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = alloca i32*, align 64 -; IS__CGSCC_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* -; IS__CGSCC_NPM-NEXT: store i32 42, i32* [[B]], align 32 -; IS__CGSCC_NPM-NEXT: store i32* [[B]], i32** [[C]], align 64 -; IS__CGSCC_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t0_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t0_callback_callee to void (i32*, i32*, ...)*), i32* align 256 [[A]], i64 noundef 99, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@t0_caller +; NOT_CGSCC_NPM-SAME: (i32* align 256 [[A:%.*]]) { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 32 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = alloca i32*, align 64 +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* +; NOT_CGSCC_NPM-NEXT: store i32 42, i32* [[B]], align 32 +; NOT_CGSCC_NPM-NEXT: store i32* [[B]], i32** [[C]], align 64 +; NOT_CGSCC_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t0_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t0_callback_callee to void (i32*, i32*, ...)*), i32* align 256 [[A]], i64 undef, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@t0_caller +; NOT_TUNIT_NPM-SAME: (i32* align 256 [[A:%.*]]) { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 32 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = alloca i32*, align 64 +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* +; NOT_TUNIT_NPM-NEXT: store i32 42, i32* [[B]], align 32 +; NOT_TUNIT_NPM-NEXT: store i32* [[B]], i32** [[C]], align 64 +; NOT_TUNIT_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t0_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t0_callback_callee to void (i32*, i32*, ...)*), i32* align 256 [[A]], i64 noundef 99, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %b = alloca i32, align 32 @@ -79,23 +54,15 @@ ; The others are annotated with alignment information, amongst others, or even replaced by the constants passed to the call. define internal void @t0_callback_callee(i32* %is_not_null, i32* %ptr, i32* %a, i64 %b, i32** %c) { ; -; IS________OPM-LABEL: define {{[^@]+}}@t0_callback_callee -; IS________OPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], i32* nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], i32* align 256 [[A:%.*]], i64 [[B:%.*]], i32** nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[PTR_VAL:%.*]] = load i32, i32* [[PTR]], align 8 -; IS________OPM-NEXT: store i32 [[PTR_VAL]], i32* [[IS_NOT_NULL]], align 4 -; IS________OPM-NEXT: [[TMP0:%.*]] = load i32*, i32** [[C]], align 64 -; IS________OPM-NEXT: tail call void @t0_check(i32* align 256 [[A]], i64 noundef 99, i32* [[TMP0]]) -; IS________OPM-NEXT: ret void ; -; IS________NPM-LABEL: define {{[^@]+}}@t0_callback_callee -; IS________NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], i32* nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], i32* align 256 [[A:%.*]], i64 [[B:%.*]], i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { -; IS________NPM-NEXT: entry: -; IS________NPM-NEXT: [[PTR_VAL:%.*]] = load i32, i32* [[PTR]], align 8 -; IS________NPM-NEXT: store i32 [[PTR_VAL]], i32* [[IS_NOT_NULL]], align 4 -; IS________NPM-NEXT: [[TMP0:%.*]] = load i32*, i32** [[C]], align 64 -; IS________NPM-NEXT: tail call void @t0_check(i32* align 256 [[A]], i64 noundef 99, i32* [[TMP0]]) -; IS________NPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@t0_callback_callee +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], i32* nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], i32* align 256 [[A:%.*]], i64 [[B:%.*]], i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[PTR_VAL:%.*]] = load i32, i32* [[PTR]], align 8 +; CHECK-NEXT: store i32 [[PTR_VAL]], i32* [[IS_NOT_NULL]], align 4 +; CHECK-NEXT: [[TMP0:%.*]] = load i32*, i32** [[C]], align 64 +; CHECK-NEXT: tail call void @t0_check(i32* align 256 [[A]], i64 noundef 99, i32* [[TMP0]]) +; CHECK-NEXT: ret void ; entry: %ptr_val = load i32, i32* %ptr, align 8 @@ -116,53 +83,30 @@ define void @t1_caller(i32* noalias %a) { ; -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@t1_caller -; IS__TUNIT_OPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[B:%.*]] = alloca i32, align 32 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = alloca i32*, align 64 -; IS__TUNIT_OPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* -; IS__TUNIT_OPM-NEXT: store i32 42, i32* [[B]], align 32 -; IS__TUNIT_OPM-NEXT: store i32* [[B]], i32** [[C]], align 64 -; IS__TUNIT_OPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t1_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t1_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 undef, i32** nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@t1_caller -; IS__TUNIT_NPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 32 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = alloca i32*, align 64 -; IS__TUNIT_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* -; IS__TUNIT_NPM-NEXT: store i32 42, i32* [[B]], align 32 -; IS__TUNIT_NPM-NEXT: store i32* [[B]], i32** [[C]], align 64 -; IS__TUNIT_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t1_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t1_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 undef, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@t1_caller -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = alloca i32, align 32 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = alloca i32*, align 64 -; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* -; IS__CGSCC_OPM-NEXT: store i32 42, i32* [[B]], align 32 -; IS__CGSCC_OPM-NEXT: store i32* [[B]], i32** [[C]], align 64 -; IS__CGSCC_OPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t1_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t1_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 noundef 99, i32** nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__CGSCC_OPM-NEXT: ret void ; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@t1_caller -; IS__CGSCC_NPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 32 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = alloca i32*, align 64 -; IS__CGSCC_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* -; IS__CGSCC_NPM-NEXT: store i32 42, i32* [[B]], align 32 -; IS__CGSCC_NPM-NEXT: store i32* [[B]], i32** [[C]], align 64 -; IS__CGSCC_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t1_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t1_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 noundef 99, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@t1_caller +; NOT_CGSCC_NPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 32 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = alloca i32*, align 64 +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* +; NOT_CGSCC_NPM-NEXT: store i32 42, i32* [[B]], align 32 +; NOT_CGSCC_NPM-NEXT: store i32* [[B]], i32** [[C]], align 64 +; NOT_CGSCC_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t1_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t1_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 undef, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@t1_caller +; NOT_TUNIT_NPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 32 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = alloca i32*, align 64 +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* +; NOT_TUNIT_NPM-NEXT: store i32 42, i32* [[B]], align 32 +; NOT_TUNIT_NPM-NEXT: store i32* [[B]], i32** [[C]], align 64 +; NOT_TUNIT_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t1_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t1_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 noundef 99, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %b = alloca i32, align 32 @@ -179,25 +123,16 @@ ; The others are annotated with alignment information, amongst others, or even replaced by the constants passed to the call. define internal void @t1_callback_callee(i32* %is_not_null, i32* %ptr, i32* %a, i64 %b, i32** %c) { ; -; IS________OPM: Function Attrs: nosync -; IS________OPM-LABEL: define {{[^@]+}}@t1_callback_callee -; IS________OPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], i32* nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], i32* nocapture align 256 [[A:%.*]], i64 [[B:%.*]], i32** nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[PTR_VAL:%.*]] = load i32, i32* [[PTR]], align 8 -; IS________OPM-NEXT: store i32 [[PTR_VAL]], i32* [[IS_NOT_NULL]], align 4 -; IS________OPM-NEXT: [[TMP0:%.*]] = load i32*, i32** [[C]], align 64 -; IS________OPM-NEXT: tail call void @t1_check(i32* nocapture align 256 [[A]], i64 noundef 99, i32* nocapture [[TMP0]]) -; IS________OPM-NEXT: ret void ; -; IS________NPM: Function Attrs: nosync -; IS________NPM-LABEL: define {{[^@]+}}@t1_callback_callee -; IS________NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], i32* nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], i32* nocapture align 256 [[A:%.*]], i64 [[B:%.*]], i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS________NPM-NEXT: entry: -; IS________NPM-NEXT: [[PTR_VAL:%.*]] = load i32, i32* [[PTR]], align 8 -; IS________NPM-NEXT: store i32 [[PTR_VAL]], i32* [[IS_NOT_NULL]], align 4 -; IS________NPM-NEXT: [[TMP0:%.*]] = load i32*, i32** [[C]], align 64 -; IS________NPM-NEXT: tail call void @t1_check(i32* nocapture align 256 [[A]], i64 noundef 99, i32* nocapture [[TMP0]]) -; IS________NPM-NEXT: ret void +; CHECK: Function Attrs: nosync +; CHECK-LABEL: define {{[^@]+}}@t1_callback_callee +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], i32* nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], i32* nocapture align 256 [[A:%.*]], i64 [[B:%.*]], i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[PTR_VAL:%.*]] = load i32, i32* [[PTR]], align 8 +; CHECK-NEXT: store i32 [[PTR_VAL]], i32* [[IS_NOT_NULL]], align 4 +; CHECK-NEXT: [[TMP0:%.*]] = load i32*, i32** [[C]], align 64 +; CHECK-NEXT: tail call void @t1_check(i32* nocapture align 256 [[A]], i64 noundef 99, i32* nocapture [[TMP0]]) +; CHECK-NEXT: ret void ; entry: %ptr_val = load i32, i32* %ptr, align 8 @@ -216,53 +151,30 @@ ; Similar to test 1 but checking that the noalias is only placed if potential synchronization through @t2_check is preserved. define void @t2_caller(i32* noalias %a) { -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@t2_caller -; IS__TUNIT_OPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[B:%.*]] = alloca i32, align 32 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = alloca i32*, align 64 -; IS__TUNIT_OPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* -; IS__TUNIT_OPM-NEXT: store i32 42, i32* [[B]], align 32 -; IS__TUNIT_OPM-NEXT: store i32* [[B]], i32** [[C]], align 64 -; IS__TUNIT_OPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t2_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t2_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 undef, i32** nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__TUNIT_OPM-NEXT: ret void ; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@t2_caller -; IS__TUNIT_NPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 32 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = alloca i32*, align 64 -; IS__TUNIT_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* -; IS__TUNIT_NPM-NEXT: store i32 42, i32* [[B]], align 32 -; IS__TUNIT_NPM-NEXT: store i32* [[B]], i32** [[C]], align 64 -; IS__TUNIT_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t2_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t2_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 undef, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@t2_caller -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = alloca i32, align 32 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = alloca i32*, align 64 -; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* -; IS__CGSCC_OPM-NEXT: store i32 42, i32* [[B]], align 32 -; IS__CGSCC_OPM-NEXT: store i32* [[B]], i32** [[C]], align 64 -; IS__CGSCC_OPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t2_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t2_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 noundef 99, i32** nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@t2_caller -; IS__CGSCC_NPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 32 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = alloca i32*, align 64 -; IS__CGSCC_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* -; IS__CGSCC_NPM-NEXT: store i32 42, i32* [[B]], align 32 -; IS__CGSCC_NPM-NEXT: store i32* [[B]], i32** [[C]], align 64 -; IS__CGSCC_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t2_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t2_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 noundef 99, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@t2_caller +; NOT_CGSCC_NPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 32 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = alloca i32*, align 64 +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* +; NOT_CGSCC_NPM-NEXT: store i32 42, i32* [[B]], align 32 +; NOT_CGSCC_NPM-NEXT: store i32* [[B]], i32** [[C]], align 64 +; NOT_CGSCC_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t2_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t2_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 undef, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@t2_caller +; NOT_TUNIT_NPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 32 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = alloca i32*, align 64 +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* +; NOT_TUNIT_NPM-NEXT: store i32 42, i32* [[B]], align 32 +; NOT_TUNIT_NPM-NEXT: store i32* [[B]], i32** [[C]], align 64 +; NOT_TUNIT_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t2_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t2_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 noundef 99, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %b = alloca i32, align 32 @@ -281,23 +193,15 @@ ; FIXME: We should derive noalias for %a and add a "fake use" of %a in all potentially synchronizing calls. define internal void @t2_callback_callee(i32* %is_not_null, i32* %ptr, i32* %a, i64 %b, i32** %c) { ; -; IS________OPM-LABEL: define {{[^@]+}}@t2_callback_callee -; IS________OPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], i32* nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], i32* nocapture align 256 [[A:%.*]], i64 [[B:%.*]], i32** nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[PTR_VAL:%.*]] = load i32, i32* [[PTR]], align 8 -; IS________OPM-NEXT: store i32 [[PTR_VAL]], i32* [[IS_NOT_NULL]], align 4 -; IS________OPM-NEXT: [[TMP0:%.*]] = load i32*, i32** [[C]], align 64 -; IS________OPM-NEXT: tail call void @t2_check(i32* nocapture align 256 [[A]], i64 noundef 99, i32* nocapture [[TMP0]]) -; IS________OPM-NEXT: ret void ; -; IS________NPM-LABEL: define {{[^@]+}}@t2_callback_callee -; IS________NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], i32* nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], i32* nocapture align 256 [[A:%.*]], i64 [[B:%.*]], i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { -; IS________NPM-NEXT: entry: -; IS________NPM-NEXT: [[PTR_VAL:%.*]] = load i32, i32* [[PTR]], align 8 -; IS________NPM-NEXT: store i32 [[PTR_VAL]], i32* [[IS_NOT_NULL]], align 4 -; IS________NPM-NEXT: [[TMP0:%.*]] = load i32*, i32** [[C]], align 64 -; IS________NPM-NEXT: tail call void @t2_check(i32* nocapture align 256 [[A]], i64 noundef 99, i32* nocapture [[TMP0]]) -; IS________NPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@t2_callback_callee +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], i32* nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], i32* nocapture align 256 [[A:%.*]], i64 [[B:%.*]], i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[PTR_VAL:%.*]] = load i32, i32* [[PTR]], align 8 +; CHECK-NEXT: store i32 [[PTR_VAL]], i32* [[IS_NOT_NULL]], align 4 +; CHECK-NEXT: [[TMP0:%.*]] = load i32*, i32** [[C]], align 64 +; CHECK-NEXT: tail call void @t2_check(i32* nocapture align 256 [[A]], i64 noundef 99, i32* nocapture [[TMP0]]) +; CHECK-NEXT: ret void ; entry: %ptr_val = load i32, i32* %ptr, align 8 @@ -316,57 +220,32 @@ ; Basically test 2 with the casted callback callee used twice. define void @t3_caller(i32* noalias %a) { -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@t3_caller -; IS__TUNIT_OPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[B:%.*]] = alloca i32, align 32 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = alloca i32*, align 64 -; IS__TUNIT_OPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* -; IS__TUNIT_OPM-NEXT: store i32 42, i32* [[B]], align 32 -; IS__TUNIT_OPM-NEXT: store i32* [[B]], i32** [[C]], align 64 -; IS__TUNIT_OPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t3_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t3_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 undef, i32** nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__TUNIT_OPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t3_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t3_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 undef, i32** nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@t3_caller -; IS__TUNIT_NPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 32 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = alloca i32*, align 64 -; IS__TUNIT_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* -; IS__TUNIT_NPM-NEXT: store i32 42, i32* [[B]], align 32 -; IS__TUNIT_NPM-NEXT: store i32* [[B]], i32** [[C]], align 64 -; IS__TUNIT_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t3_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t3_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 undef, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__TUNIT_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t3_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t3_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 undef, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@t3_caller -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = alloca i32, align 32 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = alloca i32*, align 64 -; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* -; IS__CGSCC_OPM-NEXT: store i32 42, i32* [[B]], align 32 -; IS__CGSCC_OPM-NEXT: store i32* [[B]], i32** [[C]], align 64 -; IS__CGSCC_OPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t3_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t3_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 noundef 99, i32** nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__CGSCC_OPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t3_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t3_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 noundef 99, i32** nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__CGSCC_OPM-NEXT: ret void ; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@t3_caller -; IS__CGSCC_NPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 32 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = alloca i32*, align 64 -; IS__CGSCC_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* -; IS__CGSCC_NPM-NEXT: store i32 42, i32* [[B]], align 32 -; IS__CGSCC_NPM-NEXT: store i32* [[B]], i32** [[C]], align 64 -; IS__CGSCC_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t3_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t3_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 noundef 99, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__CGSCC_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t3_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t3_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 noundef 99, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@t3_caller +; NOT_CGSCC_NPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 32 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = alloca i32*, align 64 +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* +; NOT_CGSCC_NPM-NEXT: store i32 42, i32* [[B]], align 32 +; NOT_CGSCC_NPM-NEXT: store i32* [[B]], i32** [[C]], align 64 +; NOT_CGSCC_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t3_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t3_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 undef, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) +; NOT_CGSCC_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t3_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t3_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 undef, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@t3_caller +; NOT_TUNIT_NPM-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 32 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = alloca i32*, align 64 +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 128 +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* +; NOT_TUNIT_NPM-NEXT: store i32 42, i32* [[B]], align 32 +; NOT_TUNIT_NPM-NEXT: store i32* [[B]], i32** [[C]], align 64 +; NOT_TUNIT_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t3_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t3_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 noundef 99, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) +; NOT_TUNIT_NPM-NEXT: call void (i32*, i32*, void (i32*, i32*, ...)*, ...) @t3_callback_broker(i32* noalias nocapture noundef align 4294967296 null, i32* noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], void (i32*, i32*, ...)* nocapture noundef bitcast (void (i32*, i32*, i32*, i64, i32**)* @t3_callback_callee to void (i32*, i32*, ...)*), i32* nocapture align 256 [[A]], i64 noundef 99, i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %b = alloca i32, align 32 @@ -386,23 +265,15 @@ ; FIXME: We should derive noalias for %a and add a "fake use" of %a in all potentially synchronizing calls. define internal void @t3_callback_callee(i32* %is_not_null, i32* %ptr, i32* %a, i64 %b, i32** %c) { ; -; IS________OPM-LABEL: define {{[^@]+}}@t3_callback_callee -; IS________OPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], i32* nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], i32* nocapture align 256 [[A:%.*]], i64 [[B:%.*]], i32** nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[PTR_VAL:%.*]] = load i32, i32* [[PTR]], align 8 -; IS________OPM-NEXT: store i32 [[PTR_VAL]], i32* [[IS_NOT_NULL]], align 4 -; IS________OPM-NEXT: [[TMP0:%.*]] = load i32*, i32** [[C]], align 64 -; IS________OPM-NEXT: tail call void @t3_check(i32* nocapture align 256 [[A]], i64 noundef 99, i32* nocapture [[TMP0]]) -; IS________OPM-NEXT: ret void ; -; IS________NPM-LABEL: define {{[^@]+}}@t3_callback_callee -; IS________NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], i32* nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], i32* nocapture align 256 [[A:%.*]], i64 [[B:%.*]], i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { -; IS________NPM-NEXT: entry: -; IS________NPM-NEXT: [[PTR_VAL:%.*]] = load i32, i32* [[PTR]], align 8 -; IS________NPM-NEXT: store i32 [[PTR_VAL]], i32* [[IS_NOT_NULL]], align 4 -; IS________NPM-NEXT: [[TMP0:%.*]] = load i32*, i32** [[C]], align 64 -; IS________NPM-NEXT: tail call void @t3_check(i32* nocapture align 256 [[A]], i64 noundef 99, i32* nocapture [[TMP0]]) -; IS________NPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@t3_callback_callee +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], i32* nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], i32* nocapture align 256 [[A:%.*]], i64 [[B:%.*]], i32** noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[PTR_VAL:%.*]] = load i32, i32* [[PTR]], align 8 +; CHECK-NEXT: store i32 [[PTR_VAL]], i32* [[IS_NOT_NULL]], align 4 +; CHECK-NEXT: [[TMP0:%.*]] = load i32*, i32** [[C]], align 64 +; CHECK-NEXT: tail call void @t3_check(i32* nocapture align 256 [[A]], i64 noundef 99, i32* nocapture [[TMP0]]) +; CHECK-NEXT: ret void ; entry: %ptr_val = load i32, i32* %ptr, align 8 @@ -419,7 +290,7 @@ !0 = !{!1} !1 = !{i64 2, i64 -1, i64 -1, i1 true} ;. -; CHECK: attributes #[[ATTR0:[0-9]+]] = { nosync } +; CHECK: attributes #[[ATTR0]] = { nosync } ;. ; CHECK: [[META0:![0-9]+]] = !{!1} ; CHECK: [[META1:![0-9]+]] = !{i64 2, i64 -1, i64 -1, i1 true} diff --git a/llvm/test/Transforms/Attributor/cb_liveness_disabled.ll b/llvm/test/Transforms/Attributor/cb_liveness_disabled.ll --- a/llvm/test/Transforms/Attributor/cb_liveness_disabled.ll +++ b/llvm/test/Transforms/Attributor/cb_liveness_disabled.ll @@ -1,11 +1,9 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-globals ; call site specific analysis is disabled -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 @@ -154,11 +152,11 @@ ; IS__TUNIT_____: !0 = !{i32 0, i32 101} ; IS__TUNIT_____: !1 = !{i32 100, i32 201} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone sspstrong uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone sspstrong uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone sspstrong uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone sspstrong uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { readnone willreturn } ;. ; CHECK: [[RNG0]] = !{i32 0, i32 101} ; CHECK: [[RNG1]] = !{i32 100, i32 201} diff --git a/llvm/test/Transforms/Attributor/cb_liveness_enabled.ll b/llvm/test/Transforms/Attributor/cb_liveness_enabled.ll --- a/llvm/test/Transforms/Attributor/cb_liveness_enabled.ll +++ b/llvm/test/Transforms/Attributor/cb_liveness_enabled.ll @@ -1,11 +1,9 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-globals ; call site specific analysis is enabled -; RUN: opt -attributor -enable-new-pm=0 -attributor-enable-call-site-specific-deduction=true -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-enable-call-site-specific-deduction=true -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -attributor-enable-call-site-specific-deduction=true -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-enable-call-site-specific-deduction=true -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 @@ -157,11 +155,11 @@ ; IS__TUNIT_____: !0 = !{i32 0, i32 101} ; IS__TUNIT_____: !1 = !{i32 100, i32 201} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone sspstrong uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone sspstrong uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone sspstrong uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone sspstrong uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { readnone willreturn } ;. ; CHECK: [[RNG0]] = !{i32 0, i32 101} ; CHECK: [[RNG1]] = !{i32 100, i32 201} diff --git a/llvm/test/Transforms/Attributor/cb_range_disabled.ll b/llvm/test/Transforms/Attributor/cb_range_disabled.ll --- a/llvm/test/Transforms/Attributor/cb_range_disabled.ll +++ b/llvm/test/Transforms/Attributor/cb_range_disabled.ll @@ -1,11 +1,9 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-globals ; call site specific analysis is disabled -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 @@ -22,17 +20,17 @@ } define i32 @test1(i32 %unknown, i32 %b) { -; IS__TUNIT____-LABEL: define {{[^@]+}}@test1 -; IS__TUNIT____-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR0]], !range [[RNG0:![0-9]+]] -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] -; IS__TUNIT____-NEXT: ret i32 [[TMP2]] +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test1 +; NOT_CGSCC_NPM-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR0]], !range [[RNG0:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP2]] ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@test1 -; IS__CGSCC____-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] -; IS__CGSCC____-NEXT: ret i32 [[TMP2]] +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test1 +; NOT_TUNIT_NPM-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP2]] ; %1 = call i32 @test_range(i32 %unknown) %2 = sub nsw i32 %1, %b @@ -40,17 +38,17 @@ } define i32 @test2(i32 %unknown, i32 %b) { -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT____-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR0]], !range [[RNG0]] -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] -; IS__TUNIT____-NEXT: ret i32 [[TMP2]] +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_CGSCC_NPM-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR0]], !range [[RNG0]] +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP2]] ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC____-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1]], !range [[RNG0]] -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] -; IS__CGSCC____-NEXT: ret i32 [[TMP2]] +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_TUNIT_NPM-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1]], !range [[RNG0]] +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP2]] ; %1 = call i32 @test_range(i32 %unknown) %2 = add nsw i32 %1, %b @@ -67,12 +65,12 @@ ; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 ; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP3]] ; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test1_pcheck -; IS__CGSCC_NPM-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR1]], !range [[RNG1:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 90 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP3]] +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test1_pcheck +; NOT_TUNIT_NPM-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR1]], !range [[RNG1:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 90 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP3]] ; %1 = call i32 @test1(i32 %unknown, i32 20) %2 = icmp sle i32 %1, 90 @@ -104,12 +102,12 @@ ; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 ; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP3]] ; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test1_ncheck -; IS__CGSCC_NPM-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR1]], !range [[RNG1]] -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 10 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP3]] +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test1_ncheck +; NOT_TUNIT_NPM-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR1]], !range [[RNG1]] +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 10 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP3]] ; %1 = call i32 @test1(i32 %unknown, i32 20) %2 = icmp sle i32 %1, 10 @@ -131,13 +129,13 @@ ret i32 %3 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { readnone willreturn } ;. -; NOT_CGSCC_NPM: [[META0:![0-9]+]] = !{i32 0, i32 101} +; NOT_CGSCC_NPM: [[RNG0]] = !{i32 0, i32 101} ;. -; IS__CGSCC_NPM: [[RNG0]] = !{i32 0, i32 101} -; IS__CGSCC_NPM: [[RNG1]] = !{i32 -2147483647, i32 -2147483648} +; NOT_TUNIT_NPM: [[RNG0]] = !{i32 0, i32 101} +; NOT_TUNIT_NPM: [[RNG1]] = !{i32 -2147483647, i32 -2147483648} ;. diff --git a/llvm/test/Transforms/Attributor/cb_range_enabled.ll b/llvm/test/Transforms/Attributor/cb_range_enabled.ll --- a/llvm/test/Transforms/Attributor/cb_range_enabled.ll +++ b/llvm/test/Transforms/Attributor/cb_range_enabled.ll @@ -1,11 +1,9 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-globals ; call site specific analysis is enabled -; RUN: opt -attributor -enable-new-pm=0 -attributor-enable-call-site-specific-deduction=true -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-enable-call-site-specific-deduction=true -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -attributor-enable-call-site-specific-deduction=true -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-enable-call-site-specific-deduction=true -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 @@ -22,17 +20,17 @@ } define i32 @test1(i32 %unknown, i32 %b) { -; IS__TUNIT____-LABEL: define {{[^@]+}}@test1 -; IS__TUNIT____-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR0]], !range [[RNG0:![0-9]+]] -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] -; IS__TUNIT____-NEXT: ret i32 [[TMP2]] +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test1 +; NOT_CGSCC_NPM-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR0]], !range [[RNG0:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP2]] ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@test1 -; IS__CGSCC____-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] -; IS__CGSCC____-NEXT: ret i32 [[TMP2]] +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test1 +; NOT_TUNIT_NPM-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP2]] ; %1 = call i32 @test_range(i32 %unknown) %2 = sub nsw i32 %1, %b @@ -40,17 +38,17 @@ } define i32 @test2(i32 %unknown, i32 %b) { -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT____-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR0]], !range [[RNG0]] -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] -; IS__TUNIT____-NEXT: ret i32 [[TMP2]] +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_CGSCC_NPM-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR0]], !range [[RNG0]] +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP2]] ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC____-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1]], !range [[RNG0]] -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] -; IS__CGSCC____-NEXT: ret i32 [[TMP2]] +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_TUNIT_NPM-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1]], !range [[RNG0]] +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP2]] ; %1 = call i32 @test_range(i32 %unknown) %2 = add nsw i32 %1, %b @@ -88,19 +86,19 @@ ; Negative checks define i32 @test1_ncheck(i32 %unknown) { -; IS__TUNIT____-LABEL: define {{[^@]+}}@test1_ncheck -; IS__TUNIT____-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR0]], !range [[RNG1:![0-9]+]] -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 10 -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 -; IS__TUNIT____-NEXT: ret i32 [[TMP3]] +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test1_ncheck +; NOT_CGSCC_NPM-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR0]], !range [[RNG1:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 10 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP3]] ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@test1_ncheck -; IS__CGSCC____-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR1]], !range [[RNG1:![0-9]+]] -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 10 -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 -; IS__CGSCC____-NEXT: ret i32 [[TMP3]] +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test1_ncheck +; NOT_TUNIT_NPM-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR1]], !range [[RNG1:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 10 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP3]] ; %1 = call i32 @test1(i32 %unknown, i32 20) %2 = icmp sle i32 %1, 10 @@ -109,19 +107,19 @@ } define i32 @test2_ncheck(i32 %unknown) { -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2_ncheck -; IS__TUNIT____-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @test2(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR0]], !range [[RNG2:![0-9]+]] -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = icmp sge i32 [[TMP1]], 30 -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 -; IS__TUNIT____-NEXT: ret i32 [[TMP3]] +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2_ncheck +; NOT_CGSCC_NPM-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i32 @test2(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR0]], !range [[RNG2:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp sge i32 [[TMP1]], 30 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP3]] ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2_ncheck -; IS__CGSCC____-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @test2(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR1]], !range [[RNG2:![0-9]+]] -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = icmp sge i32 [[TMP1]], 30 -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 -; IS__CGSCC____-NEXT: ret i32 [[TMP3]] +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test2_ncheck +; NOT_TUNIT_NPM-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i32 @test2(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR1]], !range [[RNG2:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp sge i32 [[TMP1]], 30 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP3]] ; %1 = call i32 @test2(i32 %unknown, i32 20) %2 = icmp sge i32 %1, 30 @@ -129,10 +127,10 @@ ret i32 %3 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { readnone willreturn } ;. ; CHECK: [[META0:![0-9]+]] = !{i32 0, i32 101} ; CHECK: [[META1:![0-9]+]] = !{i32 -20, i32 81} diff --git a/llvm/test/Transforms/Attributor/cgscc_bugs.ll b/llvm/test/Transforms/Attributor/cgscc_bugs.ll --- a/llvm/test/Transforms/Attributor/cgscc_bugs.ll +++ b/llvm/test/Transforms/Attributor/cgscc_bugs.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=11 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=11 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" diff --git a/llvm/test/Transforms/Attributor/chain.ll b/llvm/test/Transforms/Attributor/chain.ll --- a/llvm/test/Transforms/Attributor/chain.ll +++ b/llvm/test/Transforms/Attributor/chain.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -attributor-max-initialization-chain-length=1 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK_1 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -attributor-max-initialization-chain-length=1 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK_1 -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -attributor-max-initialization-chain-length=1024 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK_5 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -attributor-max-initialization-chain-length=1024 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK_5 declare void @foo(i8* dereferenceable(8) %arg) diff --git a/llvm/test/Transforms/Attributor/dereferenceable-1.ll b/llvm/test/Transforms/Attributor/dereferenceable-1.ll --- a/llvm/test/Transforms/Attributor/dereferenceable-1.ll +++ b/llvm/test/Transforms/Attributor/dereferenceable-1.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=16 -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=16 -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 ; FIXME: Figure out why we need 16 iterations here. @@ -11,19 +9,19 @@ ; take mininimum of return values ; define i32* @test1(i32* dereferenceable(4) %0, double* dereferenceable(8) %1, i1 zeroext %2) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test1 -; IS__TUNIT____-SAME: (i32* nofree nonnull readnone dereferenceable(4) "no-capture-maybe-returned" [[TMP0:%.*]], double* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP1:%.*]], i1 zeroext [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* -; IS__TUNIT____-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] -; IS__TUNIT____-NEXT: ret i32* [[TMP5]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test1 -; IS__CGSCC____-SAME: (i32* nofree nonnull readnone dereferenceable(4) "no-capture-maybe-returned" [[TMP0:%.*]], double* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP1:%.*]], i1 zeroext [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* -; IS__CGSCC____-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] -; IS__CGSCC____-NEXT: ret i32* [[TMP5]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test1 +; NOT_CGSCC_NPM-SAME: (i32* nofree nonnull readnone dereferenceable(4) "no-capture-maybe-returned" [[TMP0:%.*]], double* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP1:%.*]], i1 zeroext [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* +; NOT_CGSCC_NPM-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[TMP5]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test1 +; NOT_TUNIT_NPM-SAME: (i32* nofree nonnull readnone dereferenceable(4) "no-capture-maybe-returned" [[TMP0:%.*]], double* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP1:%.*]], i1 zeroext [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* +; NOT_TUNIT_NPM-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] +; NOT_TUNIT_NPM-NEXT: ret i32* [[TMP5]] ; %4 = bitcast double* %1 to i32* %5 = select i1 %2, i32* %0, i32* %4 @@ -32,19 +30,19 @@ ; TEST 2 define i32* @test2(i32* dereferenceable_or_null(4) %0, double* dereferenceable(8) %1, i1 zeroext %2) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT____-SAME: (i32* nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP0:%.*]], double* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP1:%.*]], i1 zeroext [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* -; IS__TUNIT____-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] -; IS__TUNIT____-NEXT: ret i32* [[TMP5]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC____-SAME: (i32* nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP0:%.*]], double* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP1:%.*]], i1 zeroext [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* -; IS__CGSCC____-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] -; IS__CGSCC____-NEXT: ret i32* [[TMP5]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP0:%.*]], double* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP1:%.*]], i1 zeroext [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* +; NOT_CGSCC_NPM-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[TMP5]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP0:%.*]], double* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP1:%.*]], i1 zeroext [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* +; NOT_TUNIT_NPM-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] +; NOT_TUNIT_NPM-NEXT: ret i32* [[TMP5]] ; %4 = bitcast double* %1 to i32* %5 = select i1 %2, i32* %0, i32* %4 @@ -54,55 +52,55 @@ ; TEST 3 ; GEP inbounds define i32* @test3_1(i32* dereferenceable(8) %0) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test3_1 -; IS__TUNIT____-SAME: (i32* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 -; IS__TUNIT____-NEXT: ret i32* [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test3_1 -; IS__CGSCC____-SAME: (i32* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 -; IS__CGSCC____-NEXT: ret i32* [[RET]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test3_1 +; NOT_CGSCC_NPM-SAME: (i32* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 +; NOT_CGSCC_NPM-NEXT: ret i32* [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test3_1 +; NOT_TUNIT_NPM-SAME: (i32* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 +; NOT_TUNIT_NPM-NEXT: ret i32* [[RET]] ; %ret = getelementptr inbounds i32, i32* %0, i64 1 ret i32* %ret } define i32* @test3_2(i32* dereferenceable_or_null(32) %0) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test3_2 -; IS__TUNIT____-SAME: (i32* nofree readnone dereferenceable_or_null(32) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 4 -; IS__TUNIT____-NEXT: ret i32* [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test3_2 -; IS__CGSCC____-SAME: (i32* nofree readnone dereferenceable_or_null(32) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 4 -; IS__CGSCC____-NEXT: ret i32* [[RET]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test3_2 +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone dereferenceable_or_null(32) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 4 +; NOT_CGSCC_NPM-NEXT: ret i32* [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test3_2 +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone dereferenceable_or_null(32) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 4 +; NOT_TUNIT_NPM-NEXT: ret i32* [[RET]] ; %ret = getelementptr inbounds i32, i32* %0, i64 4 ret i32* %ret } define i32* @test3_3(i32* dereferenceable(8) %0, i32* dereferenceable(16) %1, i1 %2) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test3_3 -; IS__TUNIT____-SAME: (i32* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree nonnull readnone dereferenceable(16) "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET1:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 -; IS__TUNIT____-NEXT: [[RET2:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 2 -; IS__TUNIT____-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[RET1]], i32* [[RET2]] -; IS__TUNIT____-NEXT: ret i32* [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test3_3 -; IS__CGSCC____-SAME: (i32* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree nonnull readnone dereferenceable(16) "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[RET1:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 -; IS__CGSCC____-NEXT: [[RET2:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 2 -; IS__CGSCC____-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[RET1]], i32* [[RET2]] -; IS__CGSCC____-NEXT: ret i32* [[RET]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test3_3 +; NOT_CGSCC_NPM-SAME: (i32* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree nonnull readnone dereferenceable(16) "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[RET1:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 +; NOT_CGSCC_NPM-NEXT: [[RET2:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 2 +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[RET1]], i32* [[RET2]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test3_3 +; NOT_TUNIT_NPM-SAME: (i32* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree nonnull readnone dereferenceable(16) "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) local_unnamed_addr #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[RET1:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 +; NOT_TUNIT_NPM-NEXT: [[RET2:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 2 +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[RET1]], i32* [[RET2]] +; NOT_TUNIT_NPM-NEXT: ret i32* [[RET]] ; %ret1 = getelementptr inbounds i32, i32* %0, i64 1 %ret2 = getelementptr inbounds i32, i32* %1, i64 2 @@ -114,15 +112,15 @@ ; Better than known in IR. define dereferenceable(4) i32* @test4(i32* dereferenceable(8) %0) local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test4 -; IS__TUNIT____-SAME: (i32* nofree nonnull readnone returned dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* [[TMP0]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test4 +; NOT_CGSCC_NPM-SAME: (i32* nofree nonnull readnone returned dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32* [[TMP0]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test4 -; IS__CGSCC____-SAME: (i32* nofree nonnull readnone returned dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* [[TMP0]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test4 +; NOT_TUNIT_NPM-SAME: (i32* nofree nonnull readnone returned dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32* [[TMP0]] ; ret i32* %0 } @@ -321,19 +319,19 @@ ; FIXME: This should have a return dereferenceable(8) but we need to make sure it will work in loops as well. define i32* @test_for_minus_index(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_for_minus_index -; IS__TUNIT____-SAME: (i32* nofree nonnull writeonly align 4 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 -2 -; IS__TUNIT____-NEXT: store i32 1, i32* [[Q]], align 4 -; IS__TUNIT____-NEXT: ret i32* [[Q]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_for_minus_index -; IS__CGSCC____-SAME: (i32* nofree nonnull writeonly align 4 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 -2 -; IS__CGSCC____-NEXT: store i32 1, i32* [[Q]], align 4 -; IS__CGSCC____-NEXT: ret i32* [[Q]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_for_minus_index +; NOT_CGSCC_NPM-SAME: (i32* nofree nonnull writeonly align 4 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 -2 +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[Q]], align 4 +; NOT_CGSCC_NPM-NEXT: ret i32* [[Q]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_for_minus_index +; NOT_TUNIT_NPM-SAME: (i32* nofree nonnull writeonly align 4 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 -2 +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[Q]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32* [[Q]] ; %q = getelementptr inbounds i32, i32* %p, i32 -2 store i32 1, i32* %q @@ -341,17 +339,17 @@ } define void @deref_or_null_and_nonnull(i32* dereferenceable_or_null(100) %0) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@deref_or_null_and_nonnull -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(100) [[TMP0:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: store i32 1, i32* [[TMP0]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@deref_or_null_and_nonnull -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(100) [[TMP0:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: store i32 1, i32* [[TMP0]], align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@deref_or_null_and_nonnull +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(100) [[TMP0:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[TMP0]], align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@deref_or_null_and_nonnull +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(100) [[TMP0:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[TMP0]], align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32 1, i32* %0 ret void @@ -366,73 +364,40 @@ ; FIXME: %ptr should be dereferenceable(31) define void @test8(i8* %ptr) #0 { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test8 -; IS__TUNIT_OPM-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: br label [[TMP1:%.*]] -; IS__TUNIT_OPM: 1: -; IS__TUNIT_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] -; IS__TUNIT_OPM-NEXT: store i8 32, i8* [[TMP3]], align 1 -; IS__TUNIT_OPM-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 -; IS__TUNIT_OPM-NEXT: br label [[TMP5]] -; IS__TUNIT_OPM: 5: -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] -; IS__TUNIT_OPM: 7: -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test8 -; IS__TUNIT_NPM-SAME: (i8* nocapture nofree nonnull writeonly dereferenceable(21) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: br label [[TMP1:%.*]] -; IS__TUNIT_NPM: 1: -; IS__TUNIT_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] -; IS__TUNIT_NPM-NEXT: store i8 32, i8* [[TMP3]], align 1 -; IS__TUNIT_NPM-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 -; IS__TUNIT_NPM-NEXT: br label [[TMP5]] -; IS__TUNIT_NPM: 5: -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] -; IS__TUNIT_NPM: 7: -; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test8 -; IS__CGSCC_OPM-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br label [[TMP1:%.*]] -; IS__CGSCC_OPM: 1: -; IS__CGSCC_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] -; IS__CGSCC_OPM-NEXT: store i8 32, i8* [[TMP3]], align 1 -; IS__CGSCC_OPM-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 -; IS__CGSCC_OPM-NEXT: br label [[TMP5]] -; IS__CGSCC_OPM: 5: -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] -; IS__CGSCC_OPM: 7: -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test8 -; IS__CGSCC_NPM-SAME: (i8* nocapture nofree nonnull writeonly dereferenceable(21) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC_NPM-NEXT: br label [[TMP1:%.*]] -; IS__CGSCC_NPM: 1: -; IS__CGSCC_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] -; IS__CGSCC_NPM-NEXT: store i8 32, i8* [[TMP3]], align 1 -; IS__CGSCC_NPM-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 -; IS__CGSCC_NPM-NEXT: br label [[TMP5]] -; IS__CGSCC_NPM: 5: -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] -; IS__CGSCC_NPM: 7: -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test8 +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree nonnull writeonly dereferenceable(21) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: br label [[TMP1:%.*]] +; NOT_CGSCC_NPM: 1: +; NOT_CGSCC_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] +; NOT_CGSCC_NPM-NEXT: store i8 32, i8* [[TMP3]], align 1 +; NOT_CGSCC_NPM-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[TMP5]] +; NOT_CGSCC_NPM: 5: +; NOT_CGSCC_NPM-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] +; NOT_CGSCC_NPM: 7: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test8 +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree nonnull writeonly dereferenceable(21) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: br label [[TMP1:%.*]] +; NOT_TUNIT_NPM: 1: +; NOT_TUNIT_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] +; NOT_TUNIT_NPM-NEXT: store i8 32, i8* [[TMP3]], align 1 +; NOT_TUNIT_NPM-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[TMP5]] +; NOT_TUNIT_NPM: 5: +; NOT_TUNIT_NPM-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] +; NOT_TUNIT_NPM: 7: +; NOT_TUNIT_NPM-NEXT: ret void ; br label %1 1: ; preds = %5, %0 @@ -452,21 +417,21 @@ ; 8.2 (negative case) define void @test8_neg(i32 %i, i8* %ptr) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test8_neg -; IS__TUNIT____-SAME: (i32 [[I:%.*]], i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = sext i32 [[I]] to i64 -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP1]] -; IS__TUNIT____-NEXT: store i8 65, i8* [[TMP2]], align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test8_neg -; IS__CGSCC____-SAME: (i32 [[I:%.*]], i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = sext i32 [[I]] to i64 -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP1]] -; IS__CGSCC____-NEXT: store i8 65, i8* [[TMP2]], align 1 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test8_neg +; NOT_CGSCC_NPM-SAME: (i32 [[I:%.*]], i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = sext i32 [[I]] to i64 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP1]] +; NOT_CGSCC_NPM-NEXT: store i8 65, i8* [[TMP2]], align 1 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test8_neg +; NOT_TUNIT_NPM-SAME: (i32 [[I:%.*]], i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = sext i32 [[I]] to i64 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP1]] +; NOT_TUNIT_NPM-NEXT: store i8 65, i8* [[TMP2]], align 1 +; NOT_TUNIT_NPM-NEXT: ret void ; %1 = sext i32 %i to i64 %2 = getelementptr inbounds i8, i8* %ptr, i64 %1 @@ -483,73 +448,40 @@ ; NOTE: %p should not be dereferenceable define internal void @fill_range_not_inbounds(i32* %p, i64 %start){ -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__TUNIT_OPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: ret void -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__TUNIT_OPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] -; IS__TUNIT_OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__TUNIT_OPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__TUNIT_NPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: ret void -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__TUNIT_NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] -; IS__TUNIT_NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__TUNIT_NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR3]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__CGSCC_OPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: ret void -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__CGSCC_OPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] -; IS__CGSCC_OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__CGSCC_OPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__CGSCC_NPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: ret void -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__CGSCC_NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] -; IS__CGSCC_NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__CGSCC_NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_BODY:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup: +; NOT_CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: for.body: +; NOT_CGSCC_NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] +; NOT_CGSCC_NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] +; NOT_CGSCC_NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 +; NOT_CGSCC_NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_BODY:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup: +; NOT_TUNIT_NPM-NEXT: ret void +; NOT_TUNIT_NPM: for.body: +; NOT_TUNIT_NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] +; NOT_TUNIT_NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] +; NOT_TUNIT_NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 +; NOT_TUNIT_NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; entry: %0 = add nsw i64 %start, 9 @@ -570,73 +502,40 @@ ; FIXME: %p should be dereferenceable(40) define internal void @fill_range_inbounds(i32* %p, i64 %start){ -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fill_range_inbounds -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__TUNIT_OPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: ret void -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__TUNIT_OPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] -; IS__TUNIT_OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__TUNIT_OPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fill_range_inbounds -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__TUNIT_NPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: ret void -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__TUNIT_NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] -; IS__TUNIT_NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__TUNIT_NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fill_range_inbounds -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR3]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__CGSCC_OPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: ret void -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__CGSCC_OPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] -; IS__CGSCC_OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__CGSCC_OPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fill_range_inbounds -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__CGSCC_NPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: ret void -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__CGSCC_NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] -; IS__CGSCC_NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__CGSCC_NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@fill_range_inbounds +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_BODY:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup: +; NOT_CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: for.body: +; NOT_CGSCC_NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] +; NOT_CGSCC_NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] +; NOT_CGSCC_NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 +; NOT_CGSCC_NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fill_range_inbounds +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_BODY:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup: +; NOT_TUNIT_NPM-NEXT: ret void +; NOT_TUNIT_NPM: for.body: +; NOT_TUNIT_NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] +; NOT_TUNIT_NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] +; NOT_TUNIT_NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 +; NOT_TUNIT_NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; entry: %0 = add nsw i64 %start, 9 @@ -656,41 +555,24 @@ } define void @call_fill_range(i32* nocapture %p, i64* nocapture readonly %range) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@call_fill_range -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] -; IS__TUNIT_OPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6:[0-9]+]] -; IS__TUNIT_OPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@call_fill_range -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] -; IS__TUNIT_NPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6:[0-9]+]] -; IS__TUNIT_NPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@call_fill_range -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] -; IS__CGSCC_OPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR7:[0-9]+]] -; IS__CGSCC_OPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: ret void ; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@call_fill_range -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] -; IS__CGSCC_NPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6:[0-9]+]] -; IS__CGSCC_NPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6]] -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@call_fill_range +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@call_fill_range +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6]] +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %0 = load i64, i64* %range, align 8, !range !0 @@ -792,59 +674,59 @@ ; ; FIXME: %ptr should be dereferenceable(4) define dso_local void @rec-branch-1(i32 %a, i32 %b, i32 %c, i32* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@rec-branch-1 -; IS__TUNIT____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 -; IS__TUNIT____-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[B]], 0 -; IS__TUNIT____-NEXT: br i1 [[TOBOOL1]], label [[IF_ELSE:%.*]], label [[IF_THEN2:%.*]] -; IS__TUNIT____: if.then2: -; IS__TUNIT____-NEXT: store i32 1, i32* [[PTR]], align 4 -; IS__TUNIT____-NEXT: br label [[IF_END8:%.*]] -; IS__TUNIT____: if.else: -; IS__TUNIT____-NEXT: store i32 2, i32* [[PTR]], align 4 -; IS__TUNIT____-NEXT: br label [[IF_END8]] -; IS__TUNIT____: if.else3: -; IS__TUNIT____-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 0 -; IS__TUNIT____-NEXT: br i1 [[TOBOOL4]], label [[IF_ELSE6:%.*]], label [[IF_THEN5:%.*]] -; IS__TUNIT____: if.then5: -; IS__TUNIT____-NEXT: store i32 3, i32* [[PTR]], align 4 -; IS__TUNIT____-NEXT: br label [[IF_END8]] -; IS__TUNIT____: if.else6: -; IS__TUNIT____-NEXT: store i32 4, i32* [[PTR]], align 4 -; IS__TUNIT____-NEXT: br label [[IF_END8]] -; IS__TUNIT____: if.end8: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@rec-branch-1 -; IS__CGSCC____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 -; IS__CGSCC____-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[B]], 0 -; IS__CGSCC____-NEXT: br i1 [[TOBOOL1]], label [[IF_ELSE:%.*]], label [[IF_THEN2:%.*]] -; IS__CGSCC____: if.then2: -; IS__CGSCC____-NEXT: store i32 1, i32* [[PTR]], align 4 -; IS__CGSCC____-NEXT: br label [[IF_END8:%.*]] -; IS__CGSCC____: if.else: -; IS__CGSCC____-NEXT: store i32 2, i32* [[PTR]], align 4 -; IS__CGSCC____-NEXT: br label [[IF_END8]] -; IS__CGSCC____: if.else3: -; IS__CGSCC____-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 0 -; IS__CGSCC____-NEXT: br i1 [[TOBOOL4]], label [[IF_ELSE6:%.*]], label [[IF_THEN5:%.*]] -; IS__CGSCC____: if.then5: -; IS__CGSCC____-NEXT: store i32 3, i32* [[PTR]], align 4 -; IS__CGSCC____-NEXT: br label [[IF_END8]] -; IS__CGSCC____: if.else6: -; IS__CGSCC____-NEXT: store i32 4, i32* [[PTR]], align 4 -; IS__CGSCC____-NEXT: br label [[IF_END8]] -; IS__CGSCC____: if.end8: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@rec-branch-1 +; NOT_CGSCC_NPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[B]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL1]], label [[IF_ELSE:%.*]], label [[IF_THEN2:%.*]] +; NOT_CGSCC_NPM: if.then2: +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[PTR]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[IF_END8:%.*]] +; NOT_CGSCC_NPM: if.else: +; NOT_CGSCC_NPM-NEXT: store i32 2, i32* [[PTR]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[IF_END8]] +; NOT_CGSCC_NPM: if.else3: +; NOT_CGSCC_NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL4]], label [[IF_ELSE6:%.*]], label [[IF_THEN5:%.*]] +; NOT_CGSCC_NPM: if.then5: +; NOT_CGSCC_NPM-NEXT: store i32 3, i32* [[PTR]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[IF_END8]] +; NOT_CGSCC_NPM: if.else6: +; NOT_CGSCC_NPM-NEXT: store i32 4, i32* [[PTR]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[IF_END8]] +; NOT_CGSCC_NPM: if.end8: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@rec-branch-1 +; NOT_TUNIT_NPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[B]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL1]], label [[IF_ELSE:%.*]], label [[IF_THEN2:%.*]] +; NOT_TUNIT_NPM: if.then2: +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[PTR]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[IF_END8:%.*]] +; NOT_TUNIT_NPM: if.else: +; NOT_TUNIT_NPM-NEXT: store i32 2, i32* [[PTR]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[IF_END8]] +; NOT_TUNIT_NPM: if.else3: +; NOT_TUNIT_NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL4]], label [[IF_ELSE6:%.*]], label [[IF_THEN5:%.*]] +; NOT_TUNIT_NPM: if.then5: +; NOT_TUNIT_NPM-NEXT: store i32 3, i32* [[PTR]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[IF_END8]] +; NOT_TUNIT_NPM: if.else6: +; NOT_TUNIT_NPM-NEXT: store i32 4, i32* [[PTR]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[IF_END8]] +; NOT_TUNIT_NPM: if.end8: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %tobool = icmp eq i32 %a, 0 @@ -893,86 +775,33 @@ ; } ; FIXME: %ptr should be dereferenceable(4) define dso_local void @rec-branch-2(i32 %a, i32 %b, i32 %c, i32* %ptr) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@rec-branch-2 -; IS__TUNIT_OPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] -; IS__TUNIT_OPM: if.then: -; IS__TUNIT_OPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[B]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL1]], label [[IF_ELSE:%.*]], label [[IF_THEN2:%.*]] -; IS__TUNIT_OPM: if.then2: -; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[PTR]], align 4 -; IS__TUNIT_OPM-NEXT: br label [[IF_END8:%.*]] -; IS__TUNIT_OPM: if.else: -; IS__TUNIT_OPM-NEXT: store i32 2, i32* [[PTR]], align 4 -; IS__TUNIT_OPM-NEXT: br label [[IF_END8]] -; IS__TUNIT_OPM: if.else3: -; IS__TUNIT_OPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL4]], label [[IF_ELSE6:%.*]], label [[IF_THEN5:%.*]] -; IS__TUNIT_OPM: if.then5: -; IS__TUNIT_OPM-NEXT: store i32 3, i32* [[PTR]], align 4 -; IS__TUNIT_OPM-NEXT: br label [[IF_END8]] -; IS__TUNIT_OPM: if.else6: -; IS__TUNIT_OPM-NEXT: tail call void @rec-branch-2(i32 noundef 1, i32 noundef 1, i32 noundef 1, i32* nocapture nofree writeonly [[PTR]]) #[[ATTR6]] -; IS__TUNIT_OPM-NEXT: br label [[IF_END8]] -; IS__TUNIT_OPM: if.end8: -; IS__TUNIT_OPM-NEXT: ret void -; -; IS________NPM: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS________NPM-LABEL: define {{[^@]+}}@rec-branch-2 -; IS________NPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR4:[0-9]+]] { -; IS________NPM-NEXT: entry: -; IS________NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 -; IS________NPM-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] -; IS________NPM: if.then: -; IS________NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[B]], 0 -; IS________NPM-NEXT: br i1 [[TOBOOL1]], label [[IF_ELSE:%.*]], label [[IF_THEN2:%.*]] -; IS________NPM: if.then2: -; IS________NPM-NEXT: store i32 1, i32* [[PTR]], align 4 -; IS________NPM-NEXT: br label [[IF_END8:%.*]] -; IS________NPM: if.else: -; IS________NPM-NEXT: store i32 2, i32* [[PTR]], align 4 -; IS________NPM-NEXT: br label [[IF_END8]] -; IS________NPM: if.else3: -; IS________NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 0 -; IS________NPM-NEXT: br i1 [[TOBOOL4]], label [[IF_ELSE6:%.*]], label [[IF_THEN5:%.*]] -; IS________NPM: if.then5: -; IS________NPM-NEXT: store i32 3, i32* [[PTR]], align 4 -; IS________NPM-NEXT: br label [[IF_END8]] -; IS________NPM: if.else6: -; IS________NPM-NEXT: tail call void @rec-branch-2(i32 noundef 1, i32 noundef 1, i32 noundef 1, i32* nocapture nofree writeonly [[PTR]]) #[[ATTR7:[0-9]+]] -; IS________NPM-NEXT: br label [[IF_END8]] -; IS________NPM: if.end8: -; IS________NPM-NEXT: ret void ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@rec-branch-2 -; IS__CGSCC_OPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] -; IS__CGSCC_OPM: if.then: -; IS__CGSCC_OPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[B]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL1]], label [[IF_ELSE:%.*]], label [[IF_THEN2:%.*]] -; IS__CGSCC_OPM: if.then2: -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[PTR]], align 4 -; IS__CGSCC_OPM-NEXT: br label [[IF_END8:%.*]] -; IS__CGSCC_OPM: if.else: -; IS__CGSCC_OPM-NEXT: store i32 2, i32* [[PTR]], align 4 -; IS__CGSCC_OPM-NEXT: br label [[IF_END8]] -; IS__CGSCC_OPM: if.else3: -; IS__CGSCC_OPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL4]], label [[IF_ELSE6:%.*]], label [[IF_THEN5:%.*]] -; IS__CGSCC_OPM: if.then5: -; IS__CGSCC_OPM-NEXT: store i32 3, i32* [[PTR]], align 4 -; IS__CGSCC_OPM-NEXT: br label [[IF_END8]] -; IS__CGSCC_OPM: if.else6: -; IS__CGSCC_OPM-NEXT: tail call void @rec-branch-2(i32 noundef 1, i32 noundef 1, i32 noundef 1, i32* nocapture nofree writeonly [[PTR]]) #[[ATTR8:[0-9]+]] -; IS__CGSCC_OPM-NEXT: br label [[IF_END8]] -; IS__CGSCC_OPM: if.end8: -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: argmemonly nofree nosync nounwind writeonly +; CHECK-LABEL: define {{[^@]+}}@rec-branch-2 +; CHECK-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR4:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 +; CHECK-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] +; CHECK: if.then: +; CHECK-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[B]], 0 +; CHECK-NEXT: br i1 [[TOBOOL1]], label [[IF_ELSE:%.*]], label [[IF_THEN2:%.*]] +; CHECK: if.then2: +; CHECK-NEXT: store i32 1, i32* [[PTR]], align 4 +; CHECK-NEXT: br label [[IF_END8:%.*]] +; CHECK: if.else: +; CHECK-NEXT: store i32 2, i32* [[PTR]], align 4 +; CHECK-NEXT: br label [[IF_END8]] +; CHECK: if.else3: +; CHECK-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 0 +; CHECK-NEXT: br i1 [[TOBOOL4]], label [[IF_ELSE6:%.*]], label [[IF_THEN5:%.*]] +; CHECK: if.then5: +; CHECK-NEXT: store i32 3, i32* [[PTR]], align 4 +; CHECK-NEXT: br label [[IF_END8]] +; CHECK: if.else6: +; CHECK-NEXT: tail call void @rec-branch-2(i32 noundef 1, i32 noundef 1, i32 noundef 1, i32* nocapture nofree writeonly [[PTR]]) #[[ATTR7:[0-9]+]] +; CHECK-NEXT: br label [[IF_END8]] +; CHECK: if.end8: +; CHECK-NEXT: ret void ; entry: %tobool = icmp eq i32 %a, 0 @@ -1014,23 +843,12 @@ ; ATTRIBUTOR-NEXT: call void @unknown() ; ATTRIBUTOR-NEXT: ret void ; -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@nonnull_assume_pos -; IS__TUNIT_OPM-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(101) [[ARG1:%.*]], i8* nocapture nofree readnone dereferenceable_or_null(31) [[ARG2:%.*]], i8* nocapture nofree nonnull readnone [[ARG3:%.*]], i8* nocapture nofree readnone dereferenceable_or_null(42) [[ARG4:%.*]]) { -; IS__TUNIT_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR7:[0-9]+]] [ "nonnull"(i8* [[ARG3]]), "dereferenceable"(i8* [[ARG1]], i64 1), "dereferenceable"(i8* [[ARG1]], i64 2), "dereferenceable"(i8* [[ARG1]], i64 101), "dereferenceable_or_null"(i8* [[ARG2]], i64 31), "dereferenceable_or_null"(i8* [[ARG4]], i64 42) ] -; IS__TUNIT_OPM-NEXT: call void @unknown() -; IS__TUNIT_OPM-NEXT: ret void ; -; IS________NPM-LABEL: define {{[^@]+}}@nonnull_assume_pos -; IS________NPM-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(101) [[ARG1:%.*]], i8* nocapture nofree readnone dereferenceable_or_null(31) [[ARG2:%.*]], i8* nocapture nofree nonnull readnone [[ARG3:%.*]], i8* nocapture nofree readnone dereferenceable_or_null(42) [[ARG4:%.*]]) { -; IS________NPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR8:[0-9]+]] [ "nonnull"(i8* [[ARG3]]), "dereferenceable"(i8* [[ARG1]], i64 1), "dereferenceable"(i8* [[ARG1]], i64 2), "dereferenceable"(i8* [[ARG1]], i64 101), "dereferenceable_or_null"(i8* [[ARG2]], i64 31), "dereferenceable_or_null"(i8* [[ARG4]], i64 42) ] -; IS________NPM-NEXT: call void @unknown() -; IS________NPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_pos -; IS__CGSCC_OPM-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(101) [[ARG1:%.*]], i8* nocapture nofree readnone dereferenceable_or_null(31) [[ARG2:%.*]], i8* nocapture nofree nonnull readnone [[ARG3:%.*]], i8* nocapture nofree readnone dereferenceable_or_null(42) [[ARG4:%.*]]) { -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR9:[0-9]+]] [ "nonnull"(i8* [[ARG3]]), "dereferenceable"(i8* [[ARG1]], i64 1), "dereferenceable"(i8* [[ARG1]], i64 2), "dereferenceable"(i8* [[ARG1]], i64 101), "dereferenceable_or_null"(i8* [[ARG2]], i64 31), "dereferenceable_or_null"(i8* [[ARG4]], i64 42) ] -; IS__CGSCC_OPM-NEXT: call void @unknown() -; IS__CGSCC_OPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_pos +; CHECK-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(101) [[ARG1:%.*]], i8* nocapture nofree readnone dereferenceable_or_null(31) [[ARG2:%.*]], i8* nocapture nofree nonnull readnone [[ARG3:%.*]], i8* nocapture nofree readnone dereferenceable_or_null(42) [[ARG4:%.*]]) { +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR8:[0-9]+]] [ "nonnull"(i8* [[ARG3]]), "dereferenceable"(i8* [[ARG1]], i64 1), "dereferenceable"(i8* [[ARG1]], i64 2), "dereferenceable"(i8* [[ARG1]], i64 101), "dereferenceable_or_null"(i8* [[ARG2]], i64 31), "dereferenceable_or_null"(i8* [[ARG4]], i64 42) ] +; CHECK-NEXT: call void @unknown() +; CHECK-NEXT: ret void ; call void @llvm.assume(i1 true) [ "nonnull"(i8* %arg3), "dereferenceable"(i8* %arg1, i64 1), "dereferenceable"(i8* %arg1, i64 2), "dereferenceable"(i8* %arg1, i64 101), "dereferenceable_or_null"(i8* %arg2, i64 31), "dereferenceable_or_null"(i8* %arg4, i64 42)] call void @unknown() @@ -1072,59 +890,24 @@ ; ATTRIBUTOR-NEXT: call void @unknown() ; ATTRIBUTOR-NEXT: ret void ; -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@nonnull_assume_call -; IS__TUNIT_OPM-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) { -; IS__TUNIT_OPM-NEXT: call void @unknown() -; IS__TUNIT_OPM-NEXT: [[P:%.*]] = call nonnull dereferenceable(101) i32* @unkown_ptr() #[[ATTR8:[0-9]+]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG3]]), "dereferenceable"(i8* [[ARG1]], i64 1), "dereferenceable"(i8* [[ARG1]], i64 2), "dereferenceable"(i32* [[P]], i64 101), "dereferenceable_or_null"(i8* [[ARG2]], i64 31), "dereferenceable_or_null"(i8* [[ARG4]], i64 42) ] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) #[[ATTR8]] -; IS__TUNIT_OPM-NEXT: call void @unknown() -; IS__TUNIT_OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@nonnull_assume_call -; IS________NPM-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) { -; IS________NPM-NEXT: call void @unknown() -; IS________NPM-NEXT: [[P:%.*]] = call nonnull dereferenceable(101) i32* @unkown_ptr() #[[ATTR9:[0-9]+]] -; IS________NPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG3]]), "dereferenceable"(i8* [[ARG1]], i64 1), "dereferenceable"(i8* [[ARG1]], i64 2), "dereferenceable"(i32* [[P]], i64 101), "dereferenceable_or_null"(i8* [[ARG2]], i64 31), "dereferenceable_or_null"(i8* [[ARG4]], i64 42) ] -; IS________NPM-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) #[[ATTR9]] -; IS________NPM-NEXT: call void @unknown() -; IS________NPM-NEXT: ret void ; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_call -; IS__CGSCC_OPM-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) { -; IS__CGSCC_OPM-NEXT: call void @unknown() -; IS__CGSCC_OPM-NEXT: [[P:%.*]] = call nonnull dereferenceable(101) i32* @unkown_ptr() #[[ATTR10:[0-9]+]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) #[[ATTR10]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) #[[ATTR10]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) #[[ATTR10]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) #[[ATTR10]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) #[[ATTR10]] -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG3]]), "dereferenceable"(i8* [[ARG1]], i64 1), "dereferenceable"(i8* [[ARG1]], i64 2), "dereferenceable"(i32* [[P]], i64 101), "dereferenceable_or_null"(i8* [[ARG2]], i64 31), "dereferenceable_or_null"(i8* [[ARG4]], i64 42) ] -; IS__CGSCC_OPM-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) #[[ATTR10]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) #[[ATTR10]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) #[[ATTR10]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) #[[ATTR10]] -; IS__CGSCC_OPM-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) #[[ATTR10]] -; IS__CGSCC_OPM-NEXT: call void @unknown() -; IS__CGSCC_OPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_call +; CHECK-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) { +; CHECK-NEXT: call void @unknown() +; CHECK-NEXT: [[P:%.*]] = call nonnull dereferenceable(101) i32* @unkown_ptr() #[[ATTR9:[0-9]+]] +; CHECK-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) #[[ATTR9]] +; CHECK-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) #[[ATTR9]] +; CHECK-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) #[[ATTR9]] +; CHECK-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) #[[ATTR9]] +; CHECK-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) #[[ATTR9]] +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG3]]), "dereferenceable"(i8* [[ARG1]], i64 1), "dereferenceable"(i8* [[ARG1]], i64 2), "dereferenceable"(i32* [[P]], i64 101), "dereferenceable_or_null"(i8* [[ARG2]], i64 31), "dereferenceable_or_null"(i8* [[ARG4]], i64 42) ] +; CHECK-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) #[[ATTR9]] +; CHECK-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(31) [[ARG2]]) #[[ATTR9]] +; CHECK-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) #[[ATTR9]] +; CHECK-NEXT: call void @unknown_use8(i8* dereferenceable_or_null(42) [[ARG4]]) #[[ATTR9]] +; CHECK-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) #[[ATTR9]] +; CHECK-NEXT: call void @unknown() +; CHECK-NEXT: ret void ; call void @unknown() %p = call i32* @unkown_ptr() @@ -1149,49 +932,27 @@ !0 = !{i64 10, i64 100} ;. -; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nounwind willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind } -; IS__TUNIT_OPM: attributes #[[ATTR5:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR6]] = { nofree nosync nounwind writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR7]] = { willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR8]] = { nounwind } -;. -; IS__TUNIT_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nounwind willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind writeonly } -; IS__TUNIT_NPM: attributes #[[ATTR5:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly } -; IS__TUNIT_NPM: attributes #[[ATTR8]] = { willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR9]] = { nounwind } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR6:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nosync nounwind writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree nosync nounwind writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR9]] = { willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR10]] = { nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR5:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { nounwind } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR5:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR6]] = { nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR8]] = { willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR9]] = { nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR5:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR6]] = { nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR8]] = { willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR9]] = { nounwind } ;. ; CHECK: [[META0:![0-9]+]] = !{i64 10, i64 100} ;. diff --git a/llvm/test/Transforms/Attributor/dereferenceable-2-inseltpoison.ll b/llvm/test/Transforms/Attributor/dereferenceable-2-inseltpoison.ll --- a/llvm/test/Transforms/Attributor/dereferenceable-2-inseltpoison.ll +++ b/llvm/test/Transforms/Attributor/dereferenceable-2-inseltpoison.ll @@ -1,46 +1,44 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; Determine dereference-ability before unused loads get deleted: ; https://bugs.llvm.org/show_bug.cgi?id=21780 define <4 x double> @PR21780(double* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@PR21780 -; IS__TUNIT____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 -; IS__TUNIT____-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 -; IS__TUNIT____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 -; IS__TUNIT____-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 -; IS__TUNIT____-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 -; IS__TUNIT____-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 -; IS__TUNIT____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__TUNIT____-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> poison, double [[T0]], i32 0 -; IS__TUNIT____-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 -; IS__TUNIT____-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 -; IS__TUNIT____-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 -; IS__TUNIT____-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> -; IS__TUNIT____-NEXT: ret <4 x double> [[SHUFFLE]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@PR21780 -; IS__CGSCC____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 -; IS__CGSCC____-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 -; IS__CGSCC____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 -; IS__CGSCC____-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 -; IS__CGSCC____-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 -; IS__CGSCC____-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 -; IS__CGSCC____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__CGSCC____-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> poison, double [[T0]], i32 0 -; IS__CGSCC____-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 -; IS__CGSCC____-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 -; IS__CGSCC____-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 -; IS__CGSCC____-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> -; IS__CGSCC____-NEXT: ret <4 x double> [[SHUFFLE]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@PR21780 +; NOT_CGSCC_NPM-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; NOT_CGSCC_NPM-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 +; NOT_CGSCC_NPM-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 +; NOT_CGSCC_NPM-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 +; NOT_CGSCC_NPM-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; NOT_CGSCC_NPM-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> poison, double [[T0]], i32 0 +; NOT_CGSCC_NPM-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 +; NOT_CGSCC_NPM-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 +; NOT_CGSCC_NPM-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 +; NOT_CGSCC_NPM-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> +; NOT_CGSCC_NPM-NEXT: ret <4 x double> [[SHUFFLE]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@PR21780 +; NOT_TUNIT_NPM-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; NOT_TUNIT_NPM-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 +; NOT_TUNIT_NPM-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 +; NOT_TUNIT_NPM-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 +; NOT_TUNIT_NPM-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; NOT_TUNIT_NPM-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> poison, double [[T0]], i32 0 +; NOT_TUNIT_NPM-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 +; NOT_TUNIT_NPM-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 +; NOT_TUNIT_NPM-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 +; NOT_TUNIT_NPM-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> +; NOT_TUNIT_NPM-NEXT: ret <4 x double> [[SHUFFLE]] ; ; GEP of index 0 is simplified away. @@ -63,19 +61,19 @@ define double @PR21780_only_access3_with_inbounds(double* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds -; IS__TUNIT____-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 -; IS__TUNIT____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__TUNIT____-NEXT: ret double [[T3]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds +; NOT_CGSCC_NPM-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; NOT_CGSCC_NPM-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; NOT_CGSCC_NPM-NEXT: ret double [[T3]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds -; IS__CGSCC____-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 -; IS__CGSCC____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__CGSCC____-NEXT: ret double [[T3]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds +; NOT_TUNIT_NPM-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; NOT_TUNIT_NPM-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; NOT_TUNIT_NPM-NEXT: ret double [[T3]] ; %arrayidx3 = getelementptr inbounds double, double* %ptr, i64 3 @@ -84,19 +82,19 @@ } define double @PR21780_only_access3_without_inbounds(double* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds -; IS__TUNIT____-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 -; IS__TUNIT____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__TUNIT____-NEXT: ret double [[T3]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds -; IS__CGSCC____-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 -; IS__CGSCC____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__CGSCC____-NEXT: ret double [[T3]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds +; NOT_CGSCC_NPM-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; NOT_CGSCC_NPM-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; NOT_CGSCC_NPM-NEXT: ret double [[T3]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds +; NOT_TUNIT_NPM-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; NOT_TUNIT_NPM-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; NOT_TUNIT_NPM-NEXT: ret double [[T3]] ; %arrayidx3 = getelementptr double, double* %ptr, i64 3 %t3 = load double, double* %arrayidx3, align 8 @@ -104,19 +102,19 @@ } define double @PR21780_without_inbounds(double* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@PR21780_without_inbounds -; IS__TUNIT____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 -; IS__TUNIT____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__TUNIT____-NEXT: ret double [[T3]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@PR21780_without_inbounds +; NOT_CGSCC_NPM-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; NOT_CGSCC_NPM-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; NOT_CGSCC_NPM-NEXT: ret double [[T3]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@PR21780_without_inbounds -; IS__CGSCC____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 -; IS__CGSCC____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__CGSCC____-NEXT: ret double [[T3]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@PR21780_without_inbounds +; NOT_TUNIT_NPM-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; NOT_TUNIT_NPM-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; NOT_TUNIT_NPM-NEXT: ret double [[T3]] ; %arrayidx1 = getelementptr double, double* %ptr, i64 1 @@ -134,21 +132,21 @@ ; Unsimplified, but still valid. Also, throw in some bogus arguments. define void @gep0(i8* %unused, i8* %other, i8* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@gep0 -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[OTHER:%.*]], i8* nocapture nofree nonnull readonly dereferenceable(3) [[PTR:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 -; IS__TUNIT____-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 -; IS__TUNIT____-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@gep0 -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[OTHER:%.*]], i8* nocapture nofree nonnull readonly dereferenceable(3) [[PTR:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 -; IS__CGSCC____-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 -; IS__CGSCC____-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@gep0 +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[OTHER:%.*]], i8* nocapture nofree nonnull readonly dereferenceable(3) [[PTR:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 +; NOT_CGSCC_NPM-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 +; NOT_CGSCC_NPM-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@gep0 +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[OTHER:%.*]], i8* nocapture nofree nonnull readonly dereferenceable(3) [[PTR:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 +; NOT_TUNIT_NPM-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 +; NOT_TUNIT_NPM-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx0 = getelementptr i8, i8* %ptr, i64 0 %arrayidx1 = getelementptr i8, i8* %ptr, i64 1 @@ -164,15 +162,15 @@ ; Multiple arguments may be dereferenceable. define void @ordering(i8* %ptr1, i32* %ptr2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ordering -; IS__TUNIT____-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ordering +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ordering -; IS__CGSCC____-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ordering +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %a20 = getelementptr i32, i32* %ptr2, i64 0 %a12 = getelementptr i8, i8* %ptr1, i64 2 @@ -190,21 +188,21 @@ ; Not in entry block. define void @not_entry_but_guaranteed_to_execute(i8* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute -; IS__TUNIT____-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[EXIT:%.*]] -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute -; IS__CGSCC____-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[EXIT:%.*]] -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[EXIT:%.*]] +; NOT_CGSCC_NPM: exit: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[EXIT:%.*]] +; NOT_TUNIT_NPM: exit: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: br label %exit @@ -221,25 +219,25 @@ ; Not in entry block and not guaranteed to execute. define void @not_entry_not_guaranteed_to_execute(i8* %ptr, i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] -; IS__TUNIT____: loads: -; IS__TUNIT____-NEXT: ret void -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] -; IS__CGSCC____: loads: -; IS__CGSCC____-NEXT: ret void -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; NOT_CGSCC_NPM: loads: +; NOT_CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: exit: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; NOT_TUNIT_NPM: loads: +; NOT_TUNIT_NPM-NEXT: ret void +; NOT_TUNIT_NPM: exit: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: br i1 %cond, label %loads, label %exit @@ -258,25 +256,25 @@ ; The last load may not execute, so derefenceable bytes only covers the 1st two loads. define void @partial_in_entry(i16* %ptr, i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@partial_in_entry -; IS__TUNIT____-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] -; IS__TUNIT____: loads: -; IS__TUNIT____-NEXT: ret void -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@partial_in_entry -; IS__CGSCC____-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] -; IS__CGSCC____: loads: -; IS__CGSCC____-NEXT: ret void -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@partial_in_entry +; NOT_CGSCC_NPM-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; NOT_CGSCC_NPM: loads: +; NOT_CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: exit: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@partial_in_entry +; NOT_TUNIT_NPM-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; NOT_TUNIT_NPM: loads: +; NOT_TUNIT_NPM-NEXT: ret void +; NOT_TUNIT_NPM: exit: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 @@ -296,17 +294,17 @@ ; The 2nd and 3rd loads may never execute. define void @volatile_is_not_dereferenceable(i16* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable -; IS__TUNIT____-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable -; IS__CGSCC____-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable +; NOT_CGSCC_NPM-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable +; NOT_TUNIT_NPM-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 @@ -320,15 +318,15 @@ ; TODO: We should allow inference for atomic (but not volatile) ops. define void @atomic_is_alright(i16* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomic_is_alright -; IS__TUNIT____-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@atomic_is_alright +; NOT_CGSCC_NPM-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomic_is_alright -; IS__CGSCC____-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@atomic_is_alright +; NOT_TUNIT_NPM-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 @@ -360,15 +358,15 @@ ; We must have consecutive accesses. define void @variable_gep_index(i8* %unused, i8* %ptr, i64 %variable_index) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@variable_gep_index -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@variable_gep_index +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@variable_gep_index -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@variable_gep_index +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx1 = getelementptr i8, i8* %ptr, i64 %variable_index %arrayidx2 = getelementptr i8, i8* %ptr, i64 2 @@ -382,15 +380,15 @@ define void @multi_index_gep(<4 x i8>* %ptr) { ; FIXME: %ptr should be dereferenceable(4) -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@multi_index_gep -; IS__TUNIT____-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@multi_index_gep +; NOT_CGSCC_NPM-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@multi_index_gep -; IS__CGSCC____-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@multi_index_gep +; NOT_TUNIT_NPM-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx00 = getelementptr <4 x i8>, <4 x i8>* %ptr, i64 0, i64 0 %t0 = load i8, i8* %arrayidx00 @@ -400,15 +398,15 @@ ; Could round weird bitwidths down? define void @not_byte_multiple(i9* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@not_byte_multiple -; IS__TUNIT____-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@not_byte_multiple +; NOT_CGSCC_NPM-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@not_byte_multiple -; IS__CGSCC____-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@not_byte_multiple +; NOT_TUNIT_NPM-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx0 = getelementptr i9, i9* %ptr, i64 0 %t0 = load i9, i9* %arrayidx0 @@ -418,15 +416,15 @@ ; Missing direct access from the pointer. define void @no_pointer_deref(i16* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@no_pointer_deref -; IS__TUNIT____-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@no_pointer_deref +; NOT_CGSCC_NPM-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@no_pointer_deref -; IS__CGSCC____-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@no_pointer_deref +; NOT_TUNIT_NPM-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 %arrayidx2 = getelementptr i16, i16* %ptr, i64 2 @@ -438,15 +436,15 @@ ; Out-of-order is ok, but missing access concludes dereferenceable range. define void @non_consecutive(i32* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@non_consecutive -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_consecutive +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_consecutive -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_consecutive +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 %arrayidx0 = getelementptr i32, i32* %ptr, i64 0 @@ -460,15 +458,15 @@ ; Improve on existing dereferenceable attribute. define void @more_bytes(i32* dereferenceable(8) %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@more_bytes -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@more_bytes +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@more_bytes -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@more_bytes +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -484,15 +482,15 @@ ; Improve on existing dereferenceable_or_null attribute. define void @more_bytes_and_not_null(i32* dereferenceable_or_null(8) %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@more_bytes_and_not_null -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@more_bytes_and_not_null +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@more_bytes_and_not_null -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@more_bytes_and_not_null +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -508,15 +506,15 @@ ; But don't pessimize existing dereferenceable attribute. define void @better_bytes(i32* dereferenceable(100) %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@better_bytes -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@better_bytes +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@better_bytes -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@better_bytes +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -530,15 +528,15 @@ } define void @bitcast(i32* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bitcast -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bitcast +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bitcast -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bitcast +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -549,15 +547,15 @@ } define void @bitcast_different_sizes(double* %arg1, i8* %arg2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bitcast_different_sizes -; IS__TUNIT____-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bitcast_different_sizes +; NOT_CGSCC_NPM-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bitcast_different_sizes -; IS__CGSCC____-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bitcast_different_sizes +; NOT_TUNIT_NPM-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %ptr1 = bitcast double* %arg1 to float* %a10 = getelementptr float, float* %ptr1, i64 0 @@ -576,15 +574,15 @@ } define void @negative_offset(i32* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@negative_offset -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@negative_offset +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@negative_offset -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@negative_offset +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -595,25 +593,25 @@ } define void @stores(i32* %arg) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@stores -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT____-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* -; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 -; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 -; IS__TUNIT____-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 -; IS__TUNIT____-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@stores -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC____-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* -; IS__CGSCC____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 -; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 -; IS__CGSCC____-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 -; IS__CGSCC____-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@stores +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; NOT_CGSCC_NPM-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 +; NOT_CGSCC_NPM-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@stores +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; NOT_TUNIT_NPM-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 +; NOT_TUNIT_NPM-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -624,21 +622,21 @@ } define void @load_store(i32* %arg) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@load_store -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* -; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 -; IS__TUNIT____-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@load_store -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* -; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 -; IS__CGSCC____-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@load_store +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; NOT_CGSCC_NPM-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@load_store +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; NOT_TUNIT_NPM-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -649,21 +647,21 @@ } define void @different_size1(i32* %arg) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@different_size1 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* -; IS__TUNIT____-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 -; IS__TUNIT____-NEXT: store i32 0, i32* [[ARG]], align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@different_size1 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* -; IS__CGSCC____-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 -; IS__CGSCC____-NEXT: store i32 0, i32* [[ARG]], align 8 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@different_size1 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; NOT_CGSCC_NPM-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[ARG]], align 8 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@different_size1 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; NOT_TUNIT_NPM-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[ARG]], align 8 +; NOT_TUNIT_NPM-NEXT: ret void ; %arg-cast = bitcast i32* %arg to double* store double 0.000000e+00, double* %arg-cast @@ -672,21 +670,21 @@ } define void @different_size2(i32* %arg) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@different_size2 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: store i32 0, i32* [[ARG]], align 8 -; IS__TUNIT____-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* -; IS__TUNIT____-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@different_size2 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: store i32 0, i32* [[ARG]], align 8 -; IS__CGSCC____-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* -; IS__CGSCC____-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@different_size2 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[ARG]], align 8 +; NOT_CGSCC_NPM-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; NOT_CGSCC_NPM-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@different_size2 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[ARG]], align 8 +; NOT_TUNIT_NPM-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; NOT_TUNIT_NPM-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32 0, i32* %arg %arg-cast = bitcast i32* %arg to double* @@ -713,111 +711,58 @@ ; ; ATTRIBUTOR_CGSCC_NPM-LABEL: define i32 @require_cfg_analysis(i32 %c, i32* {{.*}} dereferenceable(4) %p) define i32 @require_cfg_analysis(i32 %c, i32* %p) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@require_cfg_analysis -; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR4]] { -; IS__TUNIT_OPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] -; IS__TUNIT_OPM: l1: -; IS__TUNIT_OPM-NEXT: [[TOBOOL2:%.*]] = icmp eq i32 [[C]], 1 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL2]], label [[L3:%.*]], label [[L4:%.*]] -; IS__TUNIT_OPM: l2: -; IS__TUNIT_OPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL3]], label [[L3]], label [[L4]] -; IS__TUNIT_OPM: l3: -; IS__TUNIT_OPM-NEXT: br label [[L5:%.*]] -; IS__TUNIT_OPM: l4: -; IS__TUNIT_OPM-NEXT: br label [[L5]] -; IS__TUNIT_OPM: l5: -; IS__TUNIT_OPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] -; IS__TUNIT_OPM: l6: -; IS__TUNIT_OPM-NEXT: store i32 0, i32* [[P]], align 4 -; IS__TUNIT_OPM-NEXT: br label [[END:%.*]] -; IS__TUNIT_OPM: l7: -; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[P]], align 4 -; IS__TUNIT_OPM-NEXT: br label [[END]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: ret i32 1 -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@require_cfg_analysis -; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] -; IS__TUNIT_NPM: l1: -; IS__TUNIT_NPM-NEXT: br label [[L4:%.*]] -; IS__TUNIT_NPM: l2: -; IS__TUNIT_NPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] -; IS__TUNIT_NPM: l3: -; IS__TUNIT_NPM-NEXT: br label [[L5:%.*]] -; IS__TUNIT_NPM: l4: -; IS__TUNIT_NPM-NEXT: br label [[L5]] -; IS__TUNIT_NPM: l5: -; IS__TUNIT_NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] -; IS__TUNIT_NPM: l6: -; IS__TUNIT_NPM-NEXT: store i32 0, i32* [[P]], align 4 -; IS__TUNIT_NPM-NEXT: br label [[END:%.*]] -; IS__TUNIT_NPM: l7: -; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[P]], align 4 -; IS__TUNIT_NPM-NEXT: br label [[END]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: ret i32 1 -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@require_cfg_analysis -; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] -; IS__CGSCC_OPM: l1: -; IS__CGSCC_OPM-NEXT: [[TOBOOL2:%.*]] = icmp eq i32 [[C]], 1 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL2]], label [[L3:%.*]], label [[L4:%.*]] -; IS__CGSCC_OPM: l2: -; IS__CGSCC_OPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL3]], label [[L3]], label [[L4]] -; IS__CGSCC_OPM: l3: -; IS__CGSCC_OPM-NEXT: br label [[L5:%.*]] -; IS__CGSCC_OPM: l4: -; IS__CGSCC_OPM-NEXT: br label [[L5]] -; IS__CGSCC_OPM: l5: -; IS__CGSCC_OPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] -; IS__CGSCC_OPM: l6: -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[P]], align 4 -; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_OPM: l7: -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[P]], align 4 -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: ret i32 1 -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@require_cfg_analysis -; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { -; IS__CGSCC_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] -; IS__CGSCC_NPM: l1: -; IS__CGSCC_NPM-NEXT: br label [[L4:%.*]] -; IS__CGSCC_NPM: l2: -; IS__CGSCC_NPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] -; IS__CGSCC_NPM: l3: -; IS__CGSCC_NPM-NEXT: br label [[L5:%.*]] -; IS__CGSCC_NPM: l4: -; IS__CGSCC_NPM-NEXT: br label [[L5]] -; IS__CGSCC_NPM: l5: -; IS__CGSCC_NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] -; IS__CGSCC_NPM: l6: -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[P]], align 4 -; IS__CGSCC_NPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_NPM: l7: -; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[P]], align 4 -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret i32 1 +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@require_cfg_analysis +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] +; NOT_CGSCC_NPM: l1: +; NOT_CGSCC_NPM-NEXT: br label [[L4:%.*]] +; NOT_CGSCC_NPM: l2: +; NOT_CGSCC_NPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] +; NOT_CGSCC_NPM: l3: +; NOT_CGSCC_NPM-NEXT: br label [[L5:%.*]] +; NOT_CGSCC_NPM: l4: +; NOT_CGSCC_NPM-NEXT: br label [[L5]] +; NOT_CGSCC_NPM: l5: +; NOT_CGSCC_NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] +; NOT_CGSCC_NPM: l6: +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[P]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[END:%.*]] +; NOT_CGSCC_NPM: l7: +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[P]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[END]] +; NOT_CGSCC_NPM: end: +; NOT_CGSCC_NPM-NEXT: ret i32 1 +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@require_cfg_analysis +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] +; NOT_TUNIT_NPM: l1: +; NOT_TUNIT_NPM-NEXT: br label [[L4:%.*]] +; NOT_TUNIT_NPM: l2: +; NOT_TUNIT_NPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] +; NOT_TUNIT_NPM: l3: +; NOT_TUNIT_NPM-NEXT: br label [[L5:%.*]] +; NOT_TUNIT_NPM: l4: +; NOT_TUNIT_NPM-NEXT: br label [[L5]] +; NOT_TUNIT_NPM: l5: +; NOT_TUNIT_NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] +; NOT_TUNIT_NPM: l6: +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[P]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[END:%.*]] +; NOT_TUNIT_NPM: l7: +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[P]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[END]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: ret i32 1 ; %tobool1 = icmp eq i32 %c, 0 br i1 %tobool1, label %l1, label %l2 @@ -844,15 +789,15 @@ ret i32 1 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { argmemonly nofree nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn writeonly } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR3]] = { argmemonly nofree norecurse nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } ;. diff --git a/llvm/test/Transforms/Attributor/dereferenceable-2.ll b/llvm/test/Transforms/Attributor/dereferenceable-2.ll --- a/llvm/test/Transforms/Attributor/dereferenceable-2.ll +++ b/llvm/test/Transforms/Attributor/dereferenceable-2.ll @@ -1,46 +1,44 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; Determine dereference-ability before unused loads get deleted: ; https://bugs.llvm.org/show_bug.cgi?id=21780 define <4 x double> @PR21780(double* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@PR21780 -; IS__TUNIT____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 -; IS__TUNIT____-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 -; IS__TUNIT____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 -; IS__TUNIT____-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 -; IS__TUNIT____-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 -; IS__TUNIT____-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 -; IS__TUNIT____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__TUNIT____-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> undef, double [[T0]], i32 0 -; IS__TUNIT____-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 -; IS__TUNIT____-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 -; IS__TUNIT____-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 -; IS__TUNIT____-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> -; IS__TUNIT____-NEXT: ret <4 x double> [[SHUFFLE]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@PR21780 -; IS__CGSCC____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 -; IS__CGSCC____-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 -; IS__CGSCC____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 -; IS__CGSCC____-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 -; IS__CGSCC____-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 -; IS__CGSCC____-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 -; IS__CGSCC____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__CGSCC____-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> undef, double [[T0]], i32 0 -; IS__CGSCC____-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 -; IS__CGSCC____-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 -; IS__CGSCC____-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 -; IS__CGSCC____-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> -; IS__CGSCC____-NEXT: ret <4 x double> [[SHUFFLE]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@PR21780 +; NOT_CGSCC_NPM-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; NOT_CGSCC_NPM-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 +; NOT_CGSCC_NPM-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 +; NOT_CGSCC_NPM-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 +; NOT_CGSCC_NPM-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; NOT_CGSCC_NPM-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> undef, double [[T0]], i32 0 +; NOT_CGSCC_NPM-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 +; NOT_CGSCC_NPM-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 +; NOT_CGSCC_NPM-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 +; NOT_CGSCC_NPM-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> +; NOT_CGSCC_NPM-NEXT: ret <4 x double> [[SHUFFLE]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@PR21780 +; NOT_TUNIT_NPM-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; NOT_TUNIT_NPM-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 +; NOT_TUNIT_NPM-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 +; NOT_TUNIT_NPM-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 +; NOT_TUNIT_NPM-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; NOT_TUNIT_NPM-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> undef, double [[T0]], i32 0 +; NOT_TUNIT_NPM-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 +; NOT_TUNIT_NPM-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 +; NOT_TUNIT_NPM-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 +; NOT_TUNIT_NPM-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> +; NOT_TUNIT_NPM-NEXT: ret <4 x double> [[SHUFFLE]] ; ; GEP of index 0 is simplified away. @@ -63,19 +61,19 @@ define double @PR21780_only_access3_with_inbounds(double* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds -; IS__TUNIT____-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 -; IS__TUNIT____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__TUNIT____-NEXT: ret double [[T3]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds +; NOT_CGSCC_NPM-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; NOT_CGSCC_NPM-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; NOT_CGSCC_NPM-NEXT: ret double [[T3]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds -; IS__CGSCC____-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 -; IS__CGSCC____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__CGSCC____-NEXT: ret double [[T3]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds +; NOT_TUNIT_NPM-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; NOT_TUNIT_NPM-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; NOT_TUNIT_NPM-NEXT: ret double [[T3]] ; %arrayidx3 = getelementptr inbounds double, double* %ptr, i64 3 @@ -84,19 +82,19 @@ } define double @PR21780_only_access3_without_inbounds(double* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds -; IS__TUNIT____-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 -; IS__TUNIT____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__TUNIT____-NEXT: ret double [[T3]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds -; IS__CGSCC____-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 -; IS__CGSCC____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__CGSCC____-NEXT: ret double [[T3]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds +; NOT_CGSCC_NPM-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; NOT_CGSCC_NPM-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; NOT_CGSCC_NPM-NEXT: ret double [[T3]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds +; NOT_TUNIT_NPM-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; NOT_TUNIT_NPM-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; NOT_TUNIT_NPM-NEXT: ret double [[T3]] ; %arrayidx3 = getelementptr double, double* %ptr, i64 3 %t3 = load double, double* %arrayidx3, align 8 @@ -104,19 +102,19 @@ } define double @PR21780_without_inbounds(double* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@PR21780_without_inbounds -; IS__TUNIT____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 -; IS__TUNIT____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__TUNIT____-NEXT: ret double [[T3]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@PR21780_without_inbounds +; NOT_CGSCC_NPM-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; NOT_CGSCC_NPM-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; NOT_CGSCC_NPM-NEXT: ret double [[T3]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@PR21780_without_inbounds -; IS__CGSCC____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 -; IS__CGSCC____-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 -; IS__CGSCC____-NEXT: ret double [[T3]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@PR21780_without_inbounds +; NOT_TUNIT_NPM-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; NOT_TUNIT_NPM-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; NOT_TUNIT_NPM-NEXT: ret double [[T3]] ; %arrayidx1 = getelementptr double, double* %ptr, i64 1 @@ -134,21 +132,21 @@ ; Unsimplified, but still valid. Also, throw in some bogus arguments. define void @gep0(i8* %unused, i8* %other, i8* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@gep0 -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[OTHER:%.*]], i8* nocapture nofree nonnull readonly dereferenceable(3) [[PTR:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 -; IS__TUNIT____-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 -; IS__TUNIT____-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@gep0 -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[OTHER:%.*]], i8* nocapture nofree nonnull readonly dereferenceable(3) [[PTR:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 -; IS__CGSCC____-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 -; IS__CGSCC____-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@gep0 +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[OTHER:%.*]], i8* nocapture nofree nonnull readonly dereferenceable(3) [[PTR:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 +; NOT_CGSCC_NPM-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 +; NOT_CGSCC_NPM-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@gep0 +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[OTHER:%.*]], i8* nocapture nofree nonnull readonly dereferenceable(3) [[PTR:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 +; NOT_TUNIT_NPM-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 +; NOT_TUNIT_NPM-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx0 = getelementptr i8, i8* %ptr, i64 0 %arrayidx1 = getelementptr i8, i8* %ptr, i64 1 @@ -164,15 +162,15 @@ ; Multiple arguments may be dereferenceable. define void @ordering(i8* %ptr1, i32* %ptr2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ordering -; IS__TUNIT____-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ordering +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ordering -; IS__CGSCC____-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ordering +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %a20 = getelementptr i32, i32* %ptr2, i64 0 %a12 = getelementptr i8, i8* %ptr1, i64 2 @@ -190,21 +188,21 @@ ; Not in entry block. define void @not_entry_but_guaranteed_to_execute(i8* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute -; IS__TUNIT____-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[EXIT:%.*]] -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute -; IS__CGSCC____-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[EXIT:%.*]] -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[EXIT:%.*]] +; NOT_CGSCC_NPM: exit: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[EXIT:%.*]] +; NOT_TUNIT_NPM: exit: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: br label %exit @@ -221,25 +219,25 @@ ; Not in entry block and not guaranteed to execute. define void @not_entry_not_guaranteed_to_execute(i8* %ptr, i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] -; IS__TUNIT____: loads: -; IS__TUNIT____-NEXT: ret void -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] -; IS__CGSCC____: loads: -; IS__CGSCC____-NEXT: ret void -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; NOT_CGSCC_NPM: loads: +; NOT_CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: exit: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; NOT_TUNIT_NPM: loads: +; NOT_TUNIT_NPM-NEXT: ret void +; NOT_TUNIT_NPM: exit: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: br i1 %cond, label %loads, label %exit @@ -258,25 +256,25 @@ ; The last load may not execute, so derefenceable bytes only covers the 1st two loads. define void @partial_in_entry(i16* %ptr, i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@partial_in_entry -; IS__TUNIT____-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] -; IS__TUNIT____: loads: -; IS__TUNIT____-NEXT: ret void -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@partial_in_entry -; IS__CGSCC____-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] -; IS__CGSCC____: loads: -; IS__CGSCC____-NEXT: ret void -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@partial_in_entry +; NOT_CGSCC_NPM-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; NOT_CGSCC_NPM: loads: +; NOT_CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: exit: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@partial_in_entry +; NOT_TUNIT_NPM-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; NOT_TUNIT_NPM: loads: +; NOT_TUNIT_NPM-NEXT: ret void +; NOT_TUNIT_NPM: exit: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 @@ -296,17 +294,17 @@ ; The 2nd and 3rd loads may never execute. define void @volatile_is_not_dereferenceable(i16* %ptr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable -; IS__TUNIT____-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable -; IS__CGSCC____-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable +; NOT_CGSCC_NPM-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable +; NOT_TUNIT_NPM-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 @@ -320,15 +318,15 @@ ; TODO: We should allow inference for atomic (but not volatile) ops. define void @atomic_is_alright(i16* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomic_is_alright -; IS__TUNIT____-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@atomic_is_alright +; NOT_CGSCC_NPM-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomic_is_alright -; IS__CGSCC____-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@atomic_is_alright +; NOT_TUNIT_NPM-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 @@ -360,15 +358,15 @@ ; We must have consecutive accesses. define void @variable_gep_index(i8* %unused, i8* %ptr, i64 %variable_index) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@variable_gep_index -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@variable_gep_index +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@variable_gep_index -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@variable_gep_index +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx1 = getelementptr i8, i8* %ptr, i64 %variable_index %arrayidx2 = getelementptr i8, i8* %ptr, i64 2 @@ -382,15 +380,15 @@ define void @multi_index_gep(<4 x i8>* %ptr) { ; FIXME: %ptr should be dereferenceable(4) -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@multi_index_gep -; IS__TUNIT____-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@multi_index_gep +; NOT_CGSCC_NPM-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@multi_index_gep -; IS__CGSCC____-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@multi_index_gep +; NOT_TUNIT_NPM-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx00 = getelementptr <4 x i8>, <4 x i8>* %ptr, i64 0, i64 0 %t0 = load i8, i8* %arrayidx00 @@ -400,15 +398,15 @@ ; Could round weird bitwidths down? define void @not_byte_multiple(i9* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@not_byte_multiple -; IS__TUNIT____-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@not_byte_multiple +; NOT_CGSCC_NPM-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@not_byte_multiple -; IS__CGSCC____-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@not_byte_multiple +; NOT_TUNIT_NPM-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx0 = getelementptr i9, i9* %ptr, i64 0 %t0 = load i9, i9* %arrayidx0 @@ -418,15 +416,15 @@ ; Missing direct access from the pointer. define void @no_pointer_deref(i16* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@no_pointer_deref -; IS__TUNIT____-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@no_pointer_deref +; NOT_CGSCC_NPM-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@no_pointer_deref -; IS__CGSCC____-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@no_pointer_deref +; NOT_TUNIT_NPM-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 %arrayidx2 = getelementptr i16, i16* %ptr, i64 2 @@ -438,15 +436,15 @@ ; Out-of-order is ok, but missing access concludes dereferenceable range. define void @non_consecutive(i32* %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@non_consecutive -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_consecutive +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_consecutive -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_consecutive +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 %arrayidx0 = getelementptr i32, i32* %ptr, i64 0 @@ -460,15 +458,15 @@ ; Improve on existing dereferenceable attribute. define void @more_bytes(i32* dereferenceable(8) %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@more_bytes -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@more_bytes +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@more_bytes -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@more_bytes +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -484,15 +482,15 @@ ; Improve on existing dereferenceable_or_null attribute. define void @more_bytes_and_not_null(i32* dereferenceable_or_null(8) %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@more_bytes_and_not_null -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@more_bytes_and_not_null +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@more_bytes_and_not_null -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@more_bytes_and_not_null +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -508,15 +506,15 @@ ; But don't pessimize existing dereferenceable attribute. define void @better_bytes(i32* dereferenceable(100) %ptr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@better_bytes -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@better_bytes +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@better_bytes -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@better_bytes +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -530,15 +528,15 @@ } define void @bitcast(i32* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bitcast -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bitcast +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bitcast -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bitcast +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -549,15 +547,15 @@ } define void @bitcast_different_sizes(double* %arg1, i8* %arg2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bitcast_different_sizes -; IS__TUNIT____-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bitcast_different_sizes +; NOT_CGSCC_NPM-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bitcast_different_sizes -; IS__CGSCC____-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bitcast_different_sizes +; NOT_TUNIT_NPM-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %ptr1 = bitcast double* %arg1 to float* %a10 = getelementptr float, float* %ptr1, i64 0 @@ -576,15 +574,15 @@ } define void @negative_offset(i32* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@negative_offset -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@negative_offset +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@negative_offset -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@negative_offset +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -595,25 +593,25 @@ } define void @stores(i32* %arg) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@stores -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT____-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* -; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 -; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 -; IS__TUNIT____-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 -; IS__TUNIT____-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@stores -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC____-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* -; IS__CGSCC____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 -; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 -; IS__CGSCC____-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 -; IS__CGSCC____-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@stores +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; NOT_CGSCC_NPM-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 +; NOT_CGSCC_NPM-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@stores +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; NOT_TUNIT_NPM-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 +; NOT_TUNIT_NPM-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -624,21 +622,21 @@ } define void @load_store(i32* %arg) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@load_store -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* -; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 -; IS__TUNIT____-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@load_store -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* -; IS__CGSCC____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 -; IS__CGSCC____-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@load_store +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; NOT_CGSCC_NPM-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@load_store +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; NOT_TUNIT_NPM-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -649,21 +647,21 @@ } define void @different_size1(i32* %arg) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@different_size1 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* -; IS__TUNIT____-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 -; IS__TUNIT____-NEXT: store i32 0, i32* [[ARG]], align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@different_size1 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* -; IS__CGSCC____-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 -; IS__CGSCC____-NEXT: store i32 0, i32* [[ARG]], align 8 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@different_size1 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; NOT_CGSCC_NPM-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[ARG]], align 8 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@different_size1 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; NOT_TUNIT_NPM-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[ARG]], align 8 +; NOT_TUNIT_NPM-NEXT: ret void ; %arg-cast = bitcast i32* %arg to double* store double 0.000000e+00, double* %arg-cast @@ -672,21 +670,21 @@ } define void @different_size2(i32* %arg) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@different_size2 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: store i32 0, i32* [[ARG]], align 8 -; IS__TUNIT____-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* -; IS__TUNIT____-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@different_size2 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: store i32 0, i32* [[ARG]], align 8 -; IS__CGSCC____-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* -; IS__CGSCC____-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@different_size2 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[ARG]], align 8 +; NOT_CGSCC_NPM-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; NOT_CGSCC_NPM-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@different_size2 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[ARG]], align 8 +; NOT_TUNIT_NPM-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; NOT_TUNIT_NPM-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32 0, i32* %arg %arg-cast = bitcast i32* %arg to double* @@ -713,111 +711,58 @@ ; ; ATTRIBUTOR_CGSCC_NPM-LABEL: define i32 @require_cfg_analysis(i32 %c, i32* {{.*}} dereferenceable(4) %p) define i32 @require_cfg_analysis(i32 %c, i32* %p) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@require_cfg_analysis -; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR4]] { -; IS__TUNIT_OPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] -; IS__TUNIT_OPM: l1: -; IS__TUNIT_OPM-NEXT: [[TOBOOL2:%.*]] = icmp eq i32 [[C]], 1 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL2]], label [[L3:%.*]], label [[L4:%.*]] -; IS__TUNIT_OPM: l2: -; IS__TUNIT_OPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL3]], label [[L3]], label [[L4]] -; IS__TUNIT_OPM: l3: -; IS__TUNIT_OPM-NEXT: br label [[L5:%.*]] -; IS__TUNIT_OPM: l4: -; IS__TUNIT_OPM-NEXT: br label [[L5]] -; IS__TUNIT_OPM: l5: -; IS__TUNIT_OPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] -; IS__TUNIT_OPM: l6: -; IS__TUNIT_OPM-NEXT: store i32 0, i32* [[P]], align 4 -; IS__TUNIT_OPM-NEXT: br label [[END:%.*]] -; IS__TUNIT_OPM: l7: -; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[P]], align 4 -; IS__TUNIT_OPM-NEXT: br label [[END]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: ret i32 1 -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@require_cfg_analysis -; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] -; IS__TUNIT_NPM: l1: -; IS__TUNIT_NPM-NEXT: br label [[L4:%.*]] -; IS__TUNIT_NPM: l2: -; IS__TUNIT_NPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] -; IS__TUNIT_NPM: l3: -; IS__TUNIT_NPM-NEXT: br label [[L5:%.*]] -; IS__TUNIT_NPM: l4: -; IS__TUNIT_NPM-NEXT: br label [[L5]] -; IS__TUNIT_NPM: l5: -; IS__TUNIT_NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] -; IS__TUNIT_NPM: l6: -; IS__TUNIT_NPM-NEXT: store i32 0, i32* [[P]], align 4 -; IS__TUNIT_NPM-NEXT: br label [[END:%.*]] -; IS__TUNIT_NPM: l7: -; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[P]], align 4 -; IS__TUNIT_NPM-NEXT: br label [[END]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: ret i32 1 -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@require_cfg_analysis -; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] -; IS__CGSCC_OPM: l1: -; IS__CGSCC_OPM-NEXT: [[TOBOOL2:%.*]] = icmp eq i32 [[C]], 1 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL2]], label [[L3:%.*]], label [[L4:%.*]] -; IS__CGSCC_OPM: l2: -; IS__CGSCC_OPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL3]], label [[L3]], label [[L4]] -; IS__CGSCC_OPM: l3: -; IS__CGSCC_OPM-NEXT: br label [[L5:%.*]] -; IS__CGSCC_OPM: l4: -; IS__CGSCC_OPM-NEXT: br label [[L5]] -; IS__CGSCC_OPM: l5: -; IS__CGSCC_OPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] -; IS__CGSCC_OPM: l6: -; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[P]], align 4 -; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_OPM: l7: -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[P]], align 4 -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: ret i32 1 -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@require_cfg_analysis -; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { -; IS__CGSCC_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] -; IS__CGSCC_NPM: l1: -; IS__CGSCC_NPM-NEXT: br label [[L4:%.*]] -; IS__CGSCC_NPM: l2: -; IS__CGSCC_NPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] -; IS__CGSCC_NPM: l3: -; IS__CGSCC_NPM-NEXT: br label [[L5:%.*]] -; IS__CGSCC_NPM: l4: -; IS__CGSCC_NPM-NEXT: br label [[L5]] -; IS__CGSCC_NPM: l5: -; IS__CGSCC_NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] -; IS__CGSCC_NPM: l6: -; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[P]], align 4 -; IS__CGSCC_NPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_NPM: l7: -; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[P]], align 4 -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret i32 1 +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@require_cfg_analysis +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] +; NOT_CGSCC_NPM: l1: +; NOT_CGSCC_NPM-NEXT: br label [[L4:%.*]] +; NOT_CGSCC_NPM: l2: +; NOT_CGSCC_NPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] +; NOT_CGSCC_NPM: l3: +; NOT_CGSCC_NPM-NEXT: br label [[L5:%.*]] +; NOT_CGSCC_NPM: l4: +; NOT_CGSCC_NPM-NEXT: br label [[L5]] +; NOT_CGSCC_NPM: l5: +; NOT_CGSCC_NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] +; NOT_CGSCC_NPM: l6: +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[P]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[END:%.*]] +; NOT_CGSCC_NPM: l7: +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[P]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[END]] +; NOT_CGSCC_NPM: end: +; NOT_CGSCC_NPM-NEXT: ret i32 1 +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@require_cfg_analysis +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] +; NOT_TUNIT_NPM: l1: +; NOT_TUNIT_NPM-NEXT: br label [[L4:%.*]] +; NOT_TUNIT_NPM: l2: +; NOT_TUNIT_NPM-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] +; NOT_TUNIT_NPM: l3: +; NOT_TUNIT_NPM-NEXT: br label [[L5:%.*]] +; NOT_TUNIT_NPM: l4: +; NOT_TUNIT_NPM-NEXT: br label [[L5]] +; NOT_TUNIT_NPM: l5: +; NOT_TUNIT_NPM-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] +; NOT_TUNIT_NPM: l6: +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[P]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[END:%.*]] +; NOT_TUNIT_NPM: l7: +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[P]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[END]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: ret i32 1 ; %tobool1 = icmp eq i32 %c, 0 br i1 %tobool1, label %l1, label %l2 @@ -844,15 +789,15 @@ ret i32 1 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { argmemonly nofree nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn writeonly } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR3]] = { argmemonly nofree norecurse nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } ;. diff --git a/llvm/test/Transforms/Attributor/heap_to_stack.ll b/llvm/test/Transforms/Attributor/heap_to_stack.ll --- a/llvm/test/Transforms/Attributor/heap_to_stack.ll +++ b/llvm/test/Transforms/Attributor/heap_to_stack.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM declare noalias i8* @malloc(i64) @@ -31,49 +29,27 @@ declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) nounwind define void @h2s_value_simplify_interaction(i1 %c, i8* %A) { -; IS________OPM-LABEL: define {{[^@]+}}@h2s_value_simplify_interaction -; IS________OPM-SAME: (i1 [[C:%.*]], i8* nocapture nofree readnone [[A:%.*]]) { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[M:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS________OPM: t: -; IS________OPM-NEXT: br i1 false, label [[DEAD:%.*]], label [[F2:%.*]] -; IS________OPM: f: -; IS________OPM-NEXT: br label [[J:%.*]] -; IS________OPM: f2: -; IS________OPM-NEXT: [[C1:%.*]] = bitcast i8* [[M]] to i32* -; IS________OPM-NEXT: [[C2:%.*]] = bitcast i32* [[C1]] to i8* -; IS________OPM-NEXT: [[L:%.*]] = load i8, i8* [[C2]], align 1 -; IS________OPM-NEXT: call void @usei8(i8 [[L]]) -; IS________OPM-NEXT: call void @no_sync_func(i8* nocapture nofree noundef [[C2]]) #[[ATTR5:[0-9]+]] -; IS________OPM-NEXT: br label [[J]] -; IS________OPM: dead: -; IS________OPM-NEXT: unreachable -; IS________OPM: j: -; IS________OPM-NEXT: [[PHI:%.*]] = phi i8* [ [[M]], [[F]] ], [ null, [[F2]] ] -; IS________OPM-NEXT: tail call void @no_sync_func(i8* nocapture nofree noundef [[PHI]]) #[[ATTR5]] -; IS________OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@h2s_value_simplify_interaction -; IS________NPM-SAME: (i1 [[C:%.*]], i8* nocapture nofree readnone [[A:%.*]]) { -; IS________NPM-NEXT: entry: -; IS________NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 -; IS________NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS________NPM: t: -; IS________NPM-NEXT: br i1 false, label [[DEAD:%.*]], label [[F2:%.*]] -; IS________NPM: f: -; IS________NPM-NEXT: br label [[J:%.*]] -; IS________NPM: f2: -; IS________NPM-NEXT: [[L:%.*]] = load i8, i8* [[TMP0]], align 1 -; IS________NPM-NEXT: call void @usei8(i8 [[L]]) -; IS________NPM-NEXT: call void @no_sync_func(i8* nocapture nofree noundef [[TMP0]]) #[[ATTR6:[0-9]+]] -; IS________NPM-NEXT: br label [[J]] -; IS________NPM: dead: -; IS________NPM-NEXT: unreachable -; IS________NPM: j: -; IS________NPM-NEXT: [[PHI:%.*]] = phi i8* [ [[TMP0]], [[F]] ], [ null, [[F2]] ] -; IS________NPM-NEXT: tail call void @no_sync_func(i8* nocapture nofree noundef [[PHI]]) #[[ATTR6]] -; IS________NPM-NEXT: ret void +; +; CHECK-LABEL: define {{[^@]+}}@h2s_value_simplify_interaction +; CHECK-SAME: (i1 [[C:%.*]], i8* nocapture nofree readnone [[A:%.*]]) { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[TMP0:%.*]] = alloca i8, i64 4, align 1 +; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CHECK: t: +; CHECK-NEXT: br i1 false, label [[DEAD:%.*]], label [[F2:%.*]] +; CHECK: f: +; CHECK-NEXT: br label [[J:%.*]] +; CHECK: f2: +; CHECK-NEXT: [[L:%.*]] = load i8, i8* [[TMP0]], align 1 +; CHECK-NEXT: call void @usei8(i8 [[L]]) +; CHECK-NEXT: call void @no_sync_func(i8* nocapture nofree noundef [[TMP0]]) #[[ATTR6:[0-9]+]] +; CHECK-NEXT: br label [[J]] +; CHECK: dead: +; CHECK-NEXT: unreachable +; CHECK: j: +; CHECK-NEXT: [[PHI:%.*]] = phi i8* [ [[TMP0]], [[F]] ], [ null, [[F2]] ] +; CHECK-NEXT: tail call void @no_sync_func(i8* nocapture nofree noundef [[PHI]]) #[[ATTR6]] +; CHECK-NEXT: ret void ; entry: %add = add i64 2, 2 @@ -146,16 +122,11 @@ ; TEST 3 - 1 malloc, 1 free define void @test3() { -; IS________OPM-LABEL: define {{[^@]+}}@test3() { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) -; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]]) -; IS________OPM-NEXT: ret void ; -; IS________NPM-LABEL: define {{[^@]+}}@test3() { -; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 -; IS________NPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) -; IS________NPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@test3() { +; CHECK-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 +; CHECK-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) +; CHECK-NEXT: ret void ; %1 = tail call noalias i8* @malloc(i64 4) tail call void @no_sync_func(i8* %1) @@ -164,18 +135,12 @@ } define void @test3a(i8* %p) { -; IS________OPM-LABEL: define {{[^@]+}}@test3a -; IS________OPM-SAME: (i8* nocapture [[P:%.*]]) { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: tail call void @nofree_arg_only(i8* nocapture nofree [[TMP1]], i8* nocapture [[P]]) -; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]]) -; IS________OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@test3a -; IS________NPM-SAME: (i8* nocapture [[P:%.*]]) { -; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 -; IS________NPM-NEXT: tail call void @nofree_arg_only(i8* noalias nocapture nofree [[TMP1]], i8* nocapture [[P]]) -; IS________NPM-NEXT: ret void +; +; CHECK-LABEL: define {{[^@]+}}@test3a +; CHECK-SAME: (i8* nocapture [[P:%.*]]) { +; CHECK-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 +; CHECK-NEXT: tail call void @nofree_arg_only(i8* noalias nocapture nofree [[TMP1]], i8* nocapture [[P]]) +; CHECK-NEXT: ret void ; %1 = tail call noalias i8* @malloc(i64 4) tail call void @nofree_arg_only(i8* %1, i8* %p) @@ -186,18 +151,12 @@ declare noalias i8* @aligned_alloc(i64, i64) define void @test3b(i8* %p) { -; IS________OPM-LABEL: define {{[^@]+}}@test3b -; IS________OPM-SAME: (i8* nocapture [[P:%.*]]) { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @aligned_alloc(i64 noundef 32, i64 noundef 128) -; IS________OPM-NEXT: tail call void @nofree_arg_only(i8* nocapture nofree [[TMP1]], i8* nocapture [[P]]) -; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]]) -; IS________OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@test3b -; IS________NPM-SAME: (i8* nocapture [[P:%.*]]) { -; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 128, align 32 -; IS________NPM-NEXT: tail call void @nofree_arg_only(i8* noalias nocapture nofree [[TMP1]], i8* nocapture [[P]]) -; IS________NPM-NEXT: ret void +; +; CHECK-LABEL: define {{[^@]+}}@test3b +; CHECK-SAME: (i8* nocapture [[P:%.*]]) { +; CHECK-NEXT: [[TMP1:%.*]] = alloca i8, i64 128, align 32 +; CHECK-NEXT: tail call void @nofree_arg_only(i8* noalias nocapture nofree [[TMP1]], i8* nocapture [[P]]) +; CHECK-NEXT: ret void ; %1 = tail call noalias i8* @aligned_alloc(i64 32, i64 128) tail call void @nofree_arg_only(i8* %1, i8* %p) @@ -221,18 +180,13 @@ declare noalias i8* @calloc(i64, i64) define void @test0() { -; IS________OPM-LABEL: define {{[^@]+}}@test0() { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @calloc(i64 noundef 2, i64 noundef 4) -; IS________OPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) -; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]]) -; IS________OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@test0() { -; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 8, align 1 -; IS________NPM-NEXT: [[CALLOC_BC:%.*]] = bitcast i8* [[TMP1]] to i8* -; IS________NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* [[CALLOC_BC]], i8 0, i64 8, i1 false) -; IS________NPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) -; IS________NPM-NEXT: ret void +; +; CHECK-LABEL: define {{[^@]+}}@test0() { +; CHECK-NEXT: [[TMP1:%.*]] = alloca i8, i64 8, align 1 +; CHECK-NEXT: [[CALLOC_BC:%.*]] = bitcast i8* [[TMP1]] to i8* +; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[CALLOC_BC]], i8 0, i64 8, i1 false) +; CHECK-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) +; CHECK-NEXT: ret void ; %1 = tail call noalias i8* @calloc(i64 2, i64 4) tail call void @no_sync_func(i8* %1) @@ -242,15 +196,11 @@ ; TEST 4 define void @test4() { -; IS________OPM-LABEL: define {{[^@]+}}@test4() { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP1]]) -; IS________OPM-NEXT: ret void ; -; IS________NPM-LABEL: define {{[^@]+}}@test4() { -; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 -; IS________NPM-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP1]]) -; IS________NPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@test4() { +; CHECK-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 +; CHECK-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP1]]) +; CHECK-NEXT: ret void ; %1 = tail call noalias i8* @malloc(i64 4) tail call void @nofree_func(i8* %1) @@ -261,34 +211,20 @@ ; are in nofree functions and are not captured define void @test5(i32, i8* %p) { -; IS________OPM-LABEL: define {{[^@]+}}@test5 -; IS________OPM-SAME: (i32 [[TMP0:%.*]], i8* nocapture [[P:%.*]]) { -; IS________OPM-NEXT: [[TMP2:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS________OPM-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] -; IS________OPM: 4: -; IS________OPM-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP2]]) -; IS________OPM-NEXT: br label [[TMP6:%.*]] -; IS________OPM: 5: -; IS________OPM-NEXT: tail call void @nofree_arg_only(i8* nocapture nofree [[TMP2]], i8* nocapture [[P]]) -; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP2]]) -; IS________OPM-NEXT: br label [[TMP6]] -; IS________OPM: 6: -; IS________OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@test5 -; IS________NPM-SAME: (i32 [[TMP0:%.*]], i8* nocapture [[P:%.*]]) { -; IS________NPM-NEXT: [[TMP2:%.*]] = alloca i8, i64 4, align 1 -; IS________NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS________NPM-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] -; IS________NPM: 4: -; IS________NPM-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP2]]) -; IS________NPM-NEXT: br label [[TMP6:%.*]] -; IS________NPM: 5: -; IS________NPM-NEXT: tail call void @nofree_arg_only(i8* noalias nocapture nofree [[TMP2]], i8* nocapture [[P]]) -; IS________NPM-NEXT: br label [[TMP6]] -; IS________NPM: 6: -; IS________NPM-NEXT: ret void +; +; CHECK-LABEL: define {{[^@]+}}@test5 +; CHECK-SAME: (i32 [[TMP0:%.*]], i8* nocapture [[P:%.*]]) { +; CHECK-NEXT: [[TMP2:%.*]] = alloca i8, i64 4, align 1 +; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 +; CHECK-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] +; CHECK: 4: +; CHECK-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP2]]) +; CHECK-NEXT: br label [[TMP6:%.*]] +; CHECK: 5: +; CHECK-NEXT: tail call void @nofree_arg_only(i8* noalias nocapture nofree [[TMP2]], i8* nocapture [[P]]) +; CHECK-NEXT: br label [[TMP6]] +; CHECK: 6: +; CHECK-NEXT: ret void ; %2 = tail call noalias i8* @malloc(i64 4) %3 = icmp eq i32 %0, 0 @@ -310,33 +246,19 @@ ; TEST 6 - all exit paths have a call to free define void @test6(i32) { -; IS________OPM-LABEL: define {{[^@]+}}@test6 -; IS________OPM-SAME: (i32 [[TMP0:%.*]]) { -; IS________OPM-NEXT: [[TMP2:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS________OPM-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] -; IS________OPM: 4: -; IS________OPM-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP2]]) -; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP2]]) -; IS________OPM-NEXT: br label [[TMP6:%.*]] -; IS________OPM: 5: -; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP2]]) -; IS________OPM-NEXT: br label [[TMP6]] -; IS________OPM: 6: -; IS________OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@test6 -; IS________NPM-SAME: (i32 [[TMP0:%.*]]) { -; IS________NPM-NEXT: [[TMP2:%.*]] = alloca i8, i64 4, align 1 -; IS________NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS________NPM-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] -; IS________NPM: 4: -; IS________NPM-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP2]]) -; IS________NPM-NEXT: br label [[TMP6:%.*]] -; IS________NPM: 5: -; IS________NPM-NEXT: br label [[TMP6]] -; IS________NPM: 6: -; IS________NPM-NEXT: ret void +; +; CHECK-LABEL: define {{[^@]+}}@test6 +; CHECK-SAME: (i32 [[TMP0:%.*]]) { +; CHECK-NEXT: [[TMP2:%.*]] = alloca i8, i64 4, align 1 +; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 +; CHECK-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] +; CHECK: 4: +; CHECK-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP2]]) +; CHECK-NEXT: br label [[TMP6:%.*]] +; CHECK: 5: +; CHECK-NEXT: br label [[TMP6]] +; CHECK: 6: +; CHECK-NEXT: ret void ; %2 = tail call noalias i8* @malloc(i64 4) %3 = icmp eq i32 %0, 0 @@ -358,19 +280,13 @@ ; TEST 7 - free is dead. define void @test7() { -; IS________OPM: Function Attrs: noreturn -; IS________OPM-LABEL: define {{[^@]+}}@test7 -; IS________OPM-SAME: () #[[ATTR3:[0-9]+]] { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: [[TMP2:%.*]] = tail call i32 @no_return_call() #[[ATTR3]] -; IS________OPM-NEXT: unreachable -; -; IS________NPM: Function Attrs: noreturn -; IS________NPM-LABEL: define {{[^@]+}}@test7 -; IS________NPM-SAME: () #[[ATTR3:[0-9]+]] { -; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 -; IS________NPM-NEXT: [[TMP2:%.*]] = tail call i32 @no_return_call() #[[ATTR3]] -; IS________NPM-NEXT: unreachable +; +; CHECK: Function Attrs: noreturn +; CHECK-LABEL: define {{[^@]+}}@test7 +; CHECK-SAME: () #[[ATTR3:[0-9]+]] { +; CHECK-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 +; CHECK-NEXT: [[TMP2:%.*]] = tail call i32 @no_return_call() #[[ATTR3]] +; CHECK-NEXT: unreachable ; %1 = tail call noalias i8* @malloc(i64 4) tail call i32 @no_return_call() @@ -402,23 +318,15 @@ ; TEST 9 - FIXME: malloc should be converted. define void @test9() { -; IS________OPM-LABEL: define {{[^@]+}}@test9() { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) -; IS________OPM-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32* -; IS________OPM-NEXT: store i32 10, i32* [[TMP2]], align 4 -; IS________OPM-NEXT: tail call void @foo_nounw(i32* nofree noundef align 4 [[TMP2]]) #[[ATTR5]] -; IS________OPM-NEXT: tail call void @free(i8* nocapture noundef nonnull align 4 dereferenceable(4) [[TMP1]]) -; IS________OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@test9() { -; IS________NPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________NPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) -; IS________NPM-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32* -; IS________NPM-NEXT: store i32 10, i32* [[TMP2]], align 4 -; IS________NPM-NEXT: tail call void @foo_nounw(i32* nofree noundef align 4 [[TMP2]]) #[[ATTR6]] -; IS________NPM-NEXT: tail call void @free(i8* nocapture noundef nonnull align 4 dereferenceable(4) [[TMP1]]) -; IS________NPM-NEXT: ret void +; +; CHECK-LABEL: define {{[^@]+}}@test9() { +; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) +; CHECK-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) +; CHECK-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32* +; CHECK-NEXT: store i32 10, i32* [[TMP2]], align 4 +; CHECK-NEXT: tail call void @foo_nounw(i32* nofree noundef align 4 [[TMP2]]) #[[ATTR6]] +; CHECK-NEXT: tail call void @free(i8* nocapture noundef nonnull align 4 dereferenceable(4) [[TMP1]]) +; CHECK-NEXT: ret void ; %1 = tail call noalias i8* @malloc(i64 4) tail call void @no_sync_func(i8* %1) @@ -433,22 +341,14 @@ ; TEST 10 - 1 malloc, 1 free define i32 @test10() { -; IS________OPM-LABEL: define {{[^@]+}}@test10() { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) -; IS________OPM-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32* -; IS________OPM-NEXT: store i32 10, i32* [[TMP2]], align 4 -; IS________OPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture noundef nonnull align 4 dereferenceable(4) [[TMP1]]) -; IS________OPM-NEXT: ret i32 [[TMP3]] -; -; IS________NPM-LABEL: define {{[^@]+}}@test10() { -; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 -; IS________NPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) -; IS________NPM-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32* -; IS________NPM-NEXT: store i32 10, i32* [[TMP2]], align 4 -; IS________NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS________NPM-NEXT: ret i32 [[TMP3]] +; +; CHECK-LABEL: define {{[^@]+}}@test10() { +; CHECK-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 +; CHECK-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) +; CHECK-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32* +; CHECK-NEXT: store i32 10, i32* [[TMP2]], align 4 +; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 +; CHECK-NEXT: ret i32 [[TMP3]] ; %1 = tail call noalias i8* @malloc(i64 4) tail call void @no_sync_func(i8* %1) @@ -460,24 +360,15 @@ } define i32 @test_lifetime() { -; IS________OPM-LABEL: define {{[^@]+}}@test_lifetime() { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) -; IS________OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP1]]) -; IS________OPM-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32* -; IS________OPM-NEXT: store i32 10, i32* [[TMP2]], align 4 -; IS________OPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture noundef nonnull align 4 dereferenceable(4) [[TMP1]]) -; IS________OPM-NEXT: ret i32 [[TMP3]] -; -; IS________NPM-LABEL: define {{[^@]+}}@test_lifetime() { -; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 -; IS________NPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) -; IS________NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP1]]) -; IS________NPM-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32* -; IS________NPM-NEXT: store i32 10, i32* [[TMP2]], align 4 -; IS________NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS________NPM-NEXT: ret i32 [[TMP3]] +; +; CHECK-LABEL: define {{[^@]+}}@test_lifetime() { +; CHECK-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 +; CHECK-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) +; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP1]]) +; CHECK-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32* +; CHECK-NEXT: store i32 10, i32* [[TMP2]], align 4 +; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 +; CHECK-NEXT: ret i32 [[TMP3]] ; %1 = tail call noalias i8* @malloc(i64 4) tail call void @no_sync_func(i8* %1) @@ -492,16 +383,11 @@ ; TEST 11 define void @test11() { -; IS________OPM-LABEL: define {{[^@]+}}@test11() { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: tail call void @sync_will_return(i8* [[TMP1]]) #[[ATTR5]] -; IS________OPM-NEXT: tail call void @free(i8* nocapture [[TMP1]]) -; IS________OPM-NEXT: ret void ; -; IS________NPM-LABEL: define {{[^@]+}}@test11() { -; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 -; IS________NPM-NEXT: tail call void @sync_will_return(i8* [[TMP1]]) #[[ATTR6]] -; IS________NPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@test11() { +; CHECK-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 +; CHECK-NEXT: tail call void @sync_will_return(i8* [[TMP1]]) #[[ATTR6]] +; CHECK-NEXT: ret void ; %1 = tail call noalias i8* @malloc(i64 4) tail call void @sync_will_return(i8* %1) @@ -511,66 +397,35 @@ ; TEST 12 define i32 @irreducible_cfg(i32 %0) { -; IS________OPM-LABEL: define {{[^@]+}}@irreducible_cfg -; IS________OPM-SAME: (i32 [[TMP0:%.*]]) { -; IS________OPM-NEXT: [[TMP2:%.*]] = call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to i32* -; IS________OPM-NEXT: store i32 10, i32* [[TMP3]], align 4 -; IS________OPM-NEXT: [[TMP4:%.*]] = icmp eq i32 [[TMP0]], 1 -; IS________OPM-NEXT: br i1 [[TMP4]], label [[TMP5:%.*]], label [[TMP7:%.*]] -; IS________OPM: 5: -; IS________OPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], 5 -; IS________OPM-NEXT: br label [[TMP13:%.*]] -; IS________OPM: 7: -; IS________OPM-NEXT: br label [[TMP8:%.*]] -; IS________OPM: 8: -; IS________OPM-NEXT: [[DOT0:%.*]] = phi i32 [ [[TMP14:%.*]], [[TMP13]] ], [ 1, [[TMP7]] ] -; IS________OPM-NEXT: [[TMP9:%.*]] = load i32, i32* [[TMP3]], align 4 -; IS________OPM-NEXT: [[TMP10:%.*]] = add nsw i32 [[TMP9]], -1 -; IS________OPM-NEXT: store i32 [[TMP10]], i32* [[TMP3]], align 4 -; IS________OPM-NEXT: [[TMP11:%.*]] = icmp ne i32 [[TMP9]], 0 -; IS________OPM-NEXT: br i1 [[TMP11]], label [[TMP12:%.*]], label [[TMP15:%.*]] -; IS________OPM: 12: -; IS________OPM-NEXT: br label [[TMP13]] -; IS________OPM: 13: -; IS________OPM-NEXT: [[DOT1:%.*]] = phi i32 [ [[TMP6]], [[TMP5]] ], [ [[DOT0]], [[TMP12]] ] -; IS________OPM-NEXT: [[TMP14]] = add nsw i32 [[DOT1]], 1 -; IS________OPM-NEXT: br label [[TMP8]] -; IS________OPM: 15: -; IS________OPM-NEXT: [[TMP16:%.*]] = load i32, i32* [[TMP3]], align 4 -; IS________OPM-NEXT: [[TMP17:%.*]] = bitcast i32* [[TMP3]] to i8* -; IS________OPM-NEXT: call void @free(i8* nocapture noundef [[TMP17]]) -; IS________OPM-NEXT: [[TMP18:%.*]] = load i32, i32* [[TMP3]], align 4 -; IS________OPM-NEXT: ret i32 [[TMP18]] -; -; IS________NPM-LABEL: define {{[^@]+}}@irreducible_cfg -; IS________NPM-SAME: (i32 [[TMP0:%.*]]) { -; IS________NPM-NEXT: [[TMP2:%.*]] = alloca i8, i64 4, align 1 -; IS________NPM-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to i32* -; IS________NPM-NEXT: store i32 10, i32* [[TMP3]], align 4 -; IS________NPM-NEXT: [[TMP4:%.*]] = icmp eq i32 [[TMP0]], 1 -; IS________NPM-NEXT: br i1 [[TMP4]], label [[TMP5:%.*]], label [[TMP7:%.*]] -; IS________NPM: 5: -; IS________NPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], 5 -; IS________NPM-NEXT: br label [[TMP13:%.*]] -; IS________NPM: 7: -; IS________NPM-NEXT: br label [[TMP8:%.*]] -; IS________NPM: 8: -; IS________NPM-NEXT: [[DOT0:%.*]] = phi i32 [ [[TMP14:%.*]], [[TMP13]] ], [ 1, [[TMP7]] ] -; IS________NPM-NEXT: [[TMP9:%.*]] = load i32, i32* [[TMP3]], align 4 -; IS________NPM-NEXT: [[TMP10:%.*]] = add nsw i32 [[TMP9]], -1 -; IS________NPM-NEXT: store i32 [[TMP10]], i32* [[TMP3]], align 4 -; IS________NPM-NEXT: [[TMP11:%.*]] = icmp ne i32 [[TMP9]], 0 -; IS________NPM-NEXT: br i1 [[TMP11]], label [[TMP12:%.*]], label [[TMP15:%.*]] -; IS________NPM: 12: -; IS________NPM-NEXT: br label [[TMP13]] -; IS________NPM: 13: -; IS________NPM-NEXT: [[DOT1:%.*]] = phi i32 [ [[TMP6]], [[TMP5]] ], [ [[DOT0]], [[TMP12]] ] -; IS________NPM-NEXT: [[TMP14]] = add nsw i32 [[DOT1]], 1 -; IS________NPM-NEXT: br label [[TMP8]] -; IS________NPM: 15: -; IS________NPM-NEXT: [[TMP16:%.*]] = load i32, i32* [[TMP3]], align 4 -; IS________NPM-NEXT: ret i32 [[TMP16]] +; +; CHECK-LABEL: define {{[^@]+}}@irreducible_cfg +; CHECK-SAME: (i32 [[TMP0:%.*]]) { +; CHECK-NEXT: [[TMP2:%.*]] = alloca i8, i64 4, align 1 +; CHECK-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to i32* +; CHECK-NEXT: store i32 10, i32* [[TMP3]], align 4 +; CHECK-NEXT: [[TMP4:%.*]] = icmp eq i32 [[TMP0]], 1 +; CHECK-NEXT: br i1 [[TMP4]], label [[TMP5:%.*]], label [[TMP7:%.*]] +; CHECK: 5: +; CHECK-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], 5 +; CHECK-NEXT: br label [[TMP13:%.*]] +; CHECK: 7: +; CHECK-NEXT: br label [[TMP8:%.*]] +; CHECK: 8: +; CHECK-NEXT: [[DOT0:%.*]] = phi i32 [ [[TMP14:%.*]], [[TMP13]] ], [ 1, [[TMP7]] ] +; CHECK-NEXT: [[TMP9:%.*]] = load i32, i32* [[TMP3]], align 4 +; CHECK-NEXT: [[TMP10:%.*]] = add nsw i32 [[TMP9]], -1 +; CHECK-NEXT: store i32 [[TMP10]], i32* [[TMP3]], align 4 +; CHECK-NEXT: [[TMP11:%.*]] = icmp ne i32 [[TMP9]], 0 +; CHECK-NEXT: br i1 [[TMP11]], label [[TMP12:%.*]], label [[TMP15:%.*]] +; CHECK: 12: +; CHECK-NEXT: br label [[TMP13]] +; CHECK: 13: +; CHECK-NEXT: [[DOT1:%.*]] = phi i32 [ [[TMP6]], [[TMP5]] ], [ [[DOT0]], [[TMP12]] ] +; CHECK-NEXT: [[TMP14]] = add nsw i32 [[DOT1]], 1 +; CHECK-NEXT: br label [[TMP8]] +; CHECK: 15: +; CHECK-NEXT: [[TMP16:%.*]] = load i32, i32* [[TMP3]], align 4 +; CHECK-NEXT: ret i32 [[TMP16]] ; %2 = call noalias i8* @malloc(i64 4) %3 = bitcast i8* %2 to i32* @@ -611,45 +466,26 @@ define i32 @malloc_in_loop(i32 %0) { -; IS________OPM-LABEL: define {{[^@]+}}@malloc_in_loop -; IS________OPM-SAME: (i32 [[TMP0:%.*]]) { -; IS________OPM-NEXT: [[TMP2:%.*]] = alloca i32, align 4 -; IS________OPM-NEXT: [[TMP3:%.*]] = alloca i32*, align 8 -; IS________OPM-NEXT: store i32 [[TMP0]], i32* [[TMP2]], align 4 -; IS________OPM-NEXT: br label [[TMP4:%.*]] -; IS________OPM: 4: -; IS________OPM-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS________OPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP5]], -1 -; IS________OPM-NEXT: store i32 [[TMP6]], i32* [[TMP2]], align 4 -; IS________OPM-NEXT: [[TMP7:%.*]] = icmp sgt i32 [[TMP6]], 0 -; IS________OPM-NEXT: br i1 [[TMP7]], label [[TMP8:%.*]], label [[TMP11:%.*]] -; IS________OPM: 8: -; IS________OPM-NEXT: [[TMP9:%.*]] = call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* -; IS________OPM-NEXT: store i32 1, i32* [[TMP10]], align 8 -; IS________OPM-NEXT: br label [[TMP4]] -; IS________OPM: 11: -; IS________OPM-NEXT: ret i32 5 -; -; IS________NPM-LABEL: define {{[^@]+}}@malloc_in_loop -; IS________NPM-SAME: (i32 [[TMP0:%.*]]) { -; IS________NPM-NEXT: [[TMP2:%.*]] = alloca i32, align 4 -; IS________NPM-NEXT: [[TMP3:%.*]] = alloca i32*, align 8 -; IS________NPM-NEXT: store i32 [[TMP0]], i32* [[TMP2]], align 4 -; IS________NPM-NEXT: br label [[TMP4:%.*]] -; IS________NPM: 4: -; IS________NPM-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS________NPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP5]], -1 -; IS________NPM-NEXT: store i32 [[TMP6]], i32* [[TMP2]], align 4 -; IS________NPM-NEXT: [[TMP7:%.*]] = icmp sgt i32 [[TMP6]], 0 -; IS________NPM-NEXT: br i1 [[TMP7]], label [[TMP8:%.*]], label [[TMP11:%.*]] -; IS________NPM: 8: -; IS________NPM-NEXT: [[TMP9:%.*]] = alloca i8, i64 4, align 1 -; IS________NPM-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* -; IS________NPM-NEXT: store i32 1, i32* [[TMP10]], align 8 -; IS________NPM-NEXT: br label [[TMP4]] -; IS________NPM: 11: -; IS________NPM-NEXT: ret i32 5 +; +; CHECK-LABEL: define {{[^@]+}}@malloc_in_loop +; CHECK-SAME: (i32 [[TMP0:%.*]]) { +; CHECK-NEXT: [[TMP2:%.*]] = alloca i32, align 4 +; CHECK-NEXT: [[TMP3:%.*]] = alloca i32*, align 8 +; CHECK-NEXT: store i32 [[TMP0]], i32* [[TMP2]], align 4 +; CHECK-NEXT: br label [[TMP4:%.*]] +; CHECK: 4: +; CHECK-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP2]], align 4 +; CHECK-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP5]], -1 +; CHECK-NEXT: store i32 [[TMP6]], i32* [[TMP2]], align 4 +; CHECK-NEXT: [[TMP7:%.*]] = icmp sgt i32 [[TMP6]], 0 +; CHECK-NEXT: br i1 [[TMP7]], label [[TMP8:%.*]], label [[TMP11:%.*]] +; CHECK: 8: +; CHECK-NEXT: [[TMP9:%.*]] = alloca i8, i64 4, align 1 +; CHECK-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* +; CHECK-NEXT: store i32 1, i32* [[TMP10]], align 8 +; CHECK-NEXT: br label [[TMP4]] +; CHECK: 11: +; CHECK-NEXT: ret i32 5 ; %2 = alloca i32, align 4 %3 = alloca i32*, align 8 @@ -759,20 +595,13 @@ } define void @test16a(i8 %v, i8** %P) { -; IS________OPM-LABEL: define {{[^@]+}}@test16a -; IS________OPM-SAME: (i8 [[V:%.*]], i8** nocapture nofree readnone [[P:%.*]]) { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: store i8 [[V]], i8* [[TMP1]], align 1 -; IS________OPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[TMP1]]) -; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture noundef nonnull dereferenceable(1) [[TMP1]]) -; IS________OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@test16a -; IS________NPM-SAME: (i8 [[V:%.*]], i8** nocapture nofree readnone [[P:%.*]]) { -; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 -; IS________NPM-NEXT: store i8 [[V]], i8* [[TMP1]], align 1 -; IS________NPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[TMP1]]) -; IS________NPM-NEXT: ret void +; +; CHECK-LABEL: define {{[^@]+}}@test16a +; CHECK-SAME: (i8 [[V:%.*]], i8** nocapture nofree readnone [[P:%.*]]) { +; CHECK-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 +; CHECK-NEXT: store i8 [[V]], i8* [[TMP1]], align 1 +; CHECK-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[TMP1]]) +; CHECK-NEXT: ret void ; %1 = tail call noalias i8* @malloc(i64 4) store i8 %v, i8* %1 @@ -798,20 +627,13 @@ } define void @test16c(i8 %v, i8** %P) { -; IS________OPM-LABEL: define {{[^@]+}}@test16c -; IS________OPM-SAME: (i8 [[V:%.*]], i8** nocapture nofree writeonly [[P:%.*]]) { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: store i8* [[TMP1]], i8** [[P]], align 8 -; IS________OPM-NEXT: tail call void @no_sync_func(i8* nocapture nofree [[TMP1]]) #[[ATTR5]] -; IS________OPM-NEXT: tail call void @free(i8* nocapture [[TMP1]]) -; IS________OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@test16c -; IS________NPM-SAME: (i8 [[V:%.*]], i8** nocapture nofree writeonly [[P:%.*]]) { -; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 -; IS________NPM-NEXT: store i8* [[TMP1]], i8** [[P]], align 8 -; IS________NPM-NEXT: tail call void @no_sync_func(i8* nocapture nofree [[TMP1]]) #[[ATTR6]] -; IS________NPM-NEXT: ret void +; +; CHECK-LABEL: define {{[^@]+}}@test16c +; CHECK-SAME: (i8 [[V:%.*]], i8** nocapture nofree writeonly [[P:%.*]]) { +; CHECK-NEXT: [[TMP1:%.*]] = alloca i8, i64 4, align 1 +; CHECK-NEXT: store i8* [[TMP1]], i8** [[P]], align 8 +; CHECK-NEXT: tail call void @no_sync_func(i8* nocapture nofree [[TMP1]]) #[[ATTR6]] +; CHECK-NEXT: ret void ; %1 = tail call noalias i8* @malloc(i64 4) store i8* %1, i8** %P @@ -832,18 +654,11 @@ ret void } ;. -; IS________OPM: attributes #[[ATTR0:[0-9]+]] = { nounwind willreturn } -; IS________OPM: attributes #[[ATTR1:[0-9]+]] = { nofree nosync willreturn } -; IS________OPM: attributes #[[ATTR2:[0-9]+]] = { nofree nounwind } -; IS________OPM: attributes #[[ATTR3]] = { noreturn } -; IS________OPM: attributes #[[ATTR4:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS________OPM: attributes #[[ATTR5]] = { nounwind } -;. -; IS________NPM: attributes #[[ATTR0:[0-9]+]] = { nounwind willreturn } -; IS________NPM: attributes #[[ATTR1:[0-9]+]] = { nofree nosync willreturn } -; IS________NPM: attributes #[[ATTR2:[0-9]+]] = { nofree nounwind } -; IS________NPM: attributes #[[ATTR3]] = { noreturn } -; IS________NPM: attributes #[[ATTR4:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS________NPM: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } -; IS________NPM: attributes #[[ATTR6]] = { nounwind } +; CHECK: attributes #[[ATTR0:[0-9]+]] = { nounwind willreturn } +; CHECK: attributes #[[ATTR1:[0-9]+]] = { nofree nosync willreturn } +; CHECK: attributes #[[ATTR2:[0-9]+]] = { nofree nounwind } +; CHECK: attributes #[[ATTR3]] = { noreturn } +; CHECK: attributes #[[ATTR4:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; CHECK: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; CHECK: attributes #[[ATTR6]] = { nounwind } ;. diff --git a/llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll b/llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll --- a/llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll +++ b/llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM target triple = "amdgcn-amd-amdhsa" @@ -90,19 +88,13 @@ } define void @test3a(i8* %p) { -; IS________OPM-LABEL: define {{[^@]+}}@test3a -; IS________OPM-SAME: (i8* nocapture [[P:%.*]]) { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: tail call void @nofree_arg_only(i8* nocapture nofree [[TMP1]], i8* nocapture [[P]]) -; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]]) -; IS________OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@test3a -; IS________NPM-SAME: (i8* nocapture [[P:%.*]]) { -; IS________NPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________NPM-NEXT: tail call void @nofree_arg_only(i8* noalias nocapture nofree [[TMP1]], i8* nocapture [[P]]) -; IS________NPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]]) -; IS________NPM-NEXT: ret void +; +; CHECK-LABEL: define {{[^@]+}}@test3a +; CHECK-SAME: (i8* nocapture [[P:%.*]]) { +; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) +; CHECK-NEXT: tail call void @nofree_arg_only(i8* noalias nocapture nofree [[TMP1]], i8* nocapture [[P]]) +; CHECK-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]]) +; CHECK-NEXT: ret void ; %1 = tail call noalias i8* @malloc(i64 4) tail call void @nofree_arg_only(i8* %1, i8* %p) @@ -113,19 +105,13 @@ declare noalias i8* @aligned_alloc(i64, i64) define void @test3b(i8* %p) { -; IS________OPM-LABEL: define {{[^@]+}}@test3b -; IS________OPM-SAME: (i8* nocapture [[P:%.*]]) { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @aligned_alloc(i64 noundef 32, i64 noundef 128) -; IS________OPM-NEXT: tail call void @nofree_arg_only(i8* nocapture nofree [[TMP1]], i8* nocapture [[P]]) -; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]]) -; IS________OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@test3b -; IS________NPM-SAME: (i8* nocapture [[P:%.*]]) { -; IS________NPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @aligned_alloc(i64 noundef 32, i64 noundef 128) -; IS________NPM-NEXT: tail call void @nofree_arg_only(i8* noalias nocapture nofree [[TMP1]], i8* nocapture [[P]]) -; IS________NPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]]) -; IS________NPM-NEXT: ret void +; +; CHECK-LABEL: define {{[^@]+}}@test3b +; CHECK-SAME: (i8* nocapture [[P:%.*]]) { +; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @aligned_alloc(i64 noundef 32, i64 noundef 128) +; CHECK-NEXT: tail call void @nofree_arg_only(i8* noalias nocapture nofree [[TMP1]], i8* nocapture [[P]]) +; CHECK-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]]) +; CHECK-NEXT: ret void ; %1 = tail call noalias i8* @aligned_alloc(i64 32, i64 128) tail call void @nofree_arg_only(i8* %1, i8* %p) @@ -177,35 +163,21 @@ ; are in nofree functions and are not captured define void @test5(i32, i8* %p) { -; IS________OPM-LABEL: define {{[^@]+}}@test5 -; IS________OPM-SAME: (i32 [[TMP0:%.*]], i8* nocapture [[P:%.*]]) { -; IS________OPM-NEXT: [[TMP2:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS________OPM-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] -; IS________OPM: 4: -; IS________OPM-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP2]]) -; IS________OPM-NEXT: br label [[TMP6:%.*]] -; IS________OPM: 5: -; IS________OPM-NEXT: tail call void @nofree_arg_only(i8* nocapture nofree [[TMP2]], i8* nocapture [[P]]) -; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP2]]) -; IS________OPM-NEXT: br label [[TMP6]] -; IS________OPM: 6: -; IS________OPM-NEXT: ret void -; -; IS________NPM-LABEL: define {{[^@]+}}@test5 -; IS________NPM-SAME: (i32 [[TMP0:%.*]], i8* nocapture [[P:%.*]]) { -; IS________NPM-NEXT: [[TMP2:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS________NPM-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] -; IS________NPM: 4: -; IS________NPM-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP2]]) -; IS________NPM-NEXT: br label [[TMP6:%.*]] -; IS________NPM: 5: -; IS________NPM-NEXT: tail call void @nofree_arg_only(i8* noalias nocapture nofree [[TMP2]], i8* nocapture [[P]]) -; IS________NPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP2]]) -; IS________NPM-NEXT: br label [[TMP6]] -; IS________NPM: 6: -; IS________NPM-NEXT: ret void +; +; CHECK-LABEL: define {{[^@]+}}@test5 +; CHECK-SAME: (i32 [[TMP0:%.*]], i8* nocapture [[P:%.*]]) { +; CHECK-NEXT: [[TMP2:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) +; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 +; CHECK-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] +; CHECK: 4: +; CHECK-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP2]]) +; CHECK-NEXT: br label [[TMP6:%.*]] +; CHECK: 5: +; CHECK-NEXT: tail call void @nofree_arg_only(i8* noalias nocapture nofree [[TMP2]], i8* nocapture [[P]]) +; CHECK-NEXT: tail call void @free(i8* noalias nocapture [[TMP2]]) +; CHECK-NEXT: br label [[TMP6]] +; CHECK: 6: +; CHECK-NEXT: ret void ; %2 = tail call noalias i8* @malloc(i64 4) %3 = icmp eq i32 %0, 0 @@ -377,68 +349,37 @@ ; TEST 12 define i32 @irreducible_cfg(i32 %0) { -; IS________OPM-LABEL: define {{[^@]+}}@irreducible_cfg -; IS________OPM-SAME: (i32 [[TMP0:%.*]]) { -; IS________OPM-NEXT: [[TMP2:%.*]] = call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to i32* -; IS________OPM-NEXT: store i32 10, i32* [[TMP3]], align 4 -; IS________OPM-NEXT: [[TMP4:%.*]] = icmp eq i32 [[TMP0]], 1 -; IS________OPM-NEXT: br i1 [[TMP4]], label [[TMP5:%.*]], label [[TMP7:%.*]] -; IS________OPM: 5: -; IS________OPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], 5 -; IS________OPM-NEXT: br label [[TMP13:%.*]] -; IS________OPM: 7: -; IS________OPM-NEXT: br label [[TMP8:%.*]] -; IS________OPM: 8: -; IS________OPM-NEXT: [[DOT0:%.*]] = phi i32 [ [[TMP14:%.*]], [[TMP13]] ], [ 1, [[TMP7]] ] -; IS________OPM-NEXT: [[TMP9:%.*]] = load i32, i32* [[TMP3]], align 4 -; IS________OPM-NEXT: [[TMP10:%.*]] = add nsw i32 [[TMP9]], -1 -; IS________OPM-NEXT: store i32 [[TMP10]], i32* [[TMP3]], align 4 -; IS________OPM-NEXT: [[TMP11:%.*]] = icmp ne i32 [[TMP9]], 0 -; IS________OPM-NEXT: br i1 [[TMP11]], label [[TMP12:%.*]], label [[TMP15:%.*]] -; IS________OPM: 12: -; IS________OPM-NEXT: br label [[TMP13]] -; IS________OPM: 13: -; IS________OPM-NEXT: [[DOT1:%.*]] = phi i32 [ [[TMP6]], [[TMP5]] ], [ [[DOT0]], [[TMP12]] ] -; IS________OPM-NEXT: [[TMP14]] = add nsw i32 [[DOT1]], 1 -; IS________OPM-NEXT: br label [[TMP8]] -; IS________OPM: 15: -; IS________OPM-NEXT: [[TMP16:%.*]] = load i32, i32* [[TMP3]], align 4 -; IS________OPM-NEXT: [[TMP17:%.*]] = bitcast i32* [[TMP3]] to i8* -; IS________OPM-NEXT: call void @free(i8* nocapture noundef [[TMP17]]) -; IS________OPM-NEXT: [[TMP18:%.*]] = load i32, i32* [[TMP3]], align 4 -; IS________OPM-NEXT: ret i32 [[TMP18]] -; -; IS________NPM-LABEL: define {{[^@]+}}@irreducible_cfg -; IS________NPM-SAME: (i32 [[TMP0:%.*]]) { -; IS________NPM-NEXT: [[TMP2:%.*]] = call noalias i8* @malloc(i64 noundef 4) -; IS________NPM-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to i32* -; IS________NPM-NEXT: store i32 10, i32* [[TMP3]], align 4 -; IS________NPM-NEXT: [[TMP4:%.*]] = icmp eq i32 [[TMP0]], 1 -; IS________NPM-NEXT: br i1 [[TMP4]], label [[TMP5:%.*]], label [[TMP7:%.*]] -; IS________NPM: 5: -; IS________NPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], 5 -; IS________NPM-NEXT: br label [[TMP13:%.*]] -; IS________NPM: 7: -; IS________NPM-NEXT: br label [[TMP8:%.*]] -; IS________NPM: 8: -; IS________NPM-NEXT: [[DOT0:%.*]] = phi i32 [ [[TMP14:%.*]], [[TMP13]] ], [ 1, [[TMP7]] ] -; IS________NPM-NEXT: [[TMP9:%.*]] = load i32, i32* [[TMP3]], align 4 -; IS________NPM-NEXT: [[TMP10:%.*]] = add nsw i32 [[TMP9]], -1 -; IS________NPM-NEXT: store i32 [[TMP10]], i32* [[TMP3]], align 4 -; IS________NPM-NEXT: [[TMP11:%.*]] = icmp ne i32 [[TMP9]], 0 -; IS________NPM-NEXT: br i1 [[TMP11]], label [[TMP12:%.*]], label [[TMP15:%.*]] -; IS________NPM: 12: -; IS________NPM-NEXT: br label [[TMP13]] -; IS________NPM: 13: -; IS________NPM-NEXT: [[DOT1:%.*]] = phi i32 [ [[TMP6]], [[TMP5]] ], [ [[DOT0]], [[TMP12]] ] -; IS________NPM-NEXT: [[TMP14]] = add nsw i32 [[DOT1]], 1 -; IS________NPM-NEXT: br label [[TMP8]] -; IS________NPM: 15: -; IS________NPM-NEXT: [[TMP16:%.*]] = load i32, i32* [[TMP3]], align 4 -; IS________NPM-NEXT: call void @free(i8* nocapture noundef [[TMP2]]) -; IS________NPM-NEXT: [[TMP17:%.*]] = load i32, i32* [[TMP3]], align 4 -; IS________NPM-NEXT: ret i32 [[TMP17]] +; +; CHECK-LABEL: define {{[^@]+}}@irreducible_cfg +; CHECK-SAME: (i32 [[TMP0:%.*]]) { +; CHECK-NEXT: [[TMP2:%.*]] = call noalias i8* @malloc(i64 noundef 4) +; CHECK-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to i32* +; CHECK-NEXT: store i32 10, i32* [[TMP3]], align 4 +; CHECK-NEXT: [[TMP4:%.*]] = icmp eq i32 [[TMP0]], 1 +; CHECK-NEXT: br i1 [[TMP4]], label [[TMP5:%.*]], label [[TMP7:%.*]] +; CHECK: 5: +; CHECK-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], 5 +; CHECK-NEXT: br label [[TMP13:%.*]] +; CHECK: 7: +; CHECK-NEXT: br label [[TMP8:%.*]] +; CHECK: 8: +; CHECK-NEXT: [[DOT0:%.*]] = phi i32 [ [[TMP14:%.*]], [[TMP13]] ], [ 1, [[TMP7]] ] +; CHECK-NEXT: [[TMP9:%.*]] = load i32, i32* [[TMP3]], align 4 +; CHECK-NEXT: [[TMP10:%.*]] = add nsw i32 [[TMP9]], -1 +; CHECK-NEXT: store i32 [[TMP10]], i32* [[TMP3]], align 4 +; CHECK-NEXT: [[TMP11:%.*]] = icmp ne i32 [[TMP9]], 0 +; CHECK-NEXT: br i1 [[TMP11]], label [[TMP12:%.*]], label [[TMP15:%.*]] +; CHECK: 12: +; CHECK-NEXT: br label [[TMP13]] +; CHECK: 13: +; CHECK-NEXT: [[DOT1:%.*]] = phi i32 [ [[TMP6]], [[TMP5]] ], [ [[DOT0]], [[TMP12]] ] +; CHECK-NEXT: [[TMP14]] = add nsw i32 [[DOT1]], 1 +; CHECK-NEXT: br label [[TMP8]] +; CHECK: 15: +; CHECK-NEXT: [[TMP16:%.*]] = load i32, i32* [[TMP3]], align 4 +; CHECK-NEXT: call void @free(i8* nocapture noundef [[TMP2]]) +; CHECK-NEXT: [[TMP17:%.*]] = load i32, i32* [[TMP3]], align 4 +; CHECK-NEXT: ret i32 [[TMP17]] ; %2 = call noalias i8* @malloc(i64 4) %3 = bitcast i8* %2 to i32* diff --git a/llvm/test/Transforms/Attributor/internal-noalias.ll b/llvm/test/Transforms/Attributor/internal-noalias.ll --- a/llvm/test/Transforms/Attributor/internal-noalias.ll +++ b/llvm/test/Transforms/Attributor/internal-noalias.ll @@ -1,36 +1,25 @@ ; 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=16 -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=16 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM define dso_local i32 @visible(i32* noalias %A, i32* noalias %B) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@visible -; IS__TUNIT____-SAME: (i32* noalias nocapture nofree readonly [[A:%.*]], i32* noalias nocapture nofree readonly [[B:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(i32* noalias nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree readonly align 4 [[B]]) #[[ATTR3:[0-9]+]] -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(i32* noalias nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree readonly align 4 [[B]]) #[[ATTR3]] -; IS__TUNIT____-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] -; IS__TUNIT____-NEXT: ret i32 [[ADD]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@visible -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR3:[0-9]+]] -; IS__CGSCC_OPM-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR3]] -; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] -; IS__CGSCC_OPM-NEXT: ret i32 [[ADD]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@visible -; IS__CGSCC_NPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4:[0-9]+]] -; IS__CGSCC_NPM-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4]] -; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] -; IS__CGSCC_NPM-NEXT: ret i32 [[ADD]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@visible +; NOT_CGSCC_NPM-SAME: (i32* noalias nocapture nofree readonly [[A:%.*]], i32* noalias nocapture nofree readonly [[B:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(i32* noalias nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree readonly align 4 [[B]]) #[[ATTR3:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(i32* noalias nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree readonly align 4 [[B]]) #[[ATTR3]] +; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[ADD]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@visible +; NOT_TUNIT_NPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4]] +; NOT_TUNIT_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[ADD]] ; entry: %call1 = call i32 @noalias_args(i32* %A, i32* %B) @@ -40,38 +29,27 @@ } define private i32 @noalias_args(i32* %A, i32* %B) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@noalias_args -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 -; IS__TUNIT____-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR3]] -; IS__TUNIT____-NEXT: [[ADD2:%.*]] = add nsw i32 [[ADD]], [[CALL]] -; IS__TUNIT____-NEXT: ret i32 [[ADD2]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@noalias_args -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 -; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4:[0-9]+]] -; IS__CGSCC_OPM-NEXT: [[ADD2:%.*]] = add nsw i32 [[ADD]], [[CALL]] -; IS__CGSCC_OPM-NEXT: ret i32 [[ADD2]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@noalias_args -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 -; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] -; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR5:[0-9]+]] -; IS__CGSCC_NPM-NEXT: [[ADD2:%.*]] = add nsw i32 [[ADD]], [[CALL]] -; IS__CGSCC_NPM-NEXT: ret i32 [[ADD2]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@noalias_args +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 +; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR3]] +; NOT_CGSCC_NPM-NEXT: [[ADD2:%.*]] = add nsw i32 [[ADD]], [[CALL]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[ADD2]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@noalias_args +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 +; NOT_TUNIT_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR5:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[ADD2:%.*]] = add nsw i32 [[ADD]], [[CALL]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[ADD2]] ; entry: %0 = load i32, i32* %A, align 4 @@ -84,23 +62,23 @@ define internal i32 @noalias_args_argmem(i32* %A, i32* %B) #1 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@noalias_args_argmem -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 -; IS__TUNIT____-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] -; IS__TUNIT____-NEXT: ret i32 [[ADD]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@noalias_args_argmem -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 -; IS__CGSCC____-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] -; IS__CGSCC____-NEXT: ret i32 [[ADD]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@noalias_args_argmem +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 +; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[ADD]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@noalias_args_argmem +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 +; NOT_TUNIT_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[ADD]] ; entry: %0 = load i32, i32* %A, align 4 @@ -110,38 +88,27 @@ } define dso_local i32 @visible_local(i32* %A) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@visible_local -; IS__TUNIT____-SAME: (i32* nocapture nofree readonly [[A:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: store i32 5, i32* [[B]], align 4 -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(i32* nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR3]] -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(i32* nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR3]] -; IS__TUNIT____-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] -; IS__TUNIT____-NEXT: ret i32 [[ADD]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@visible_local -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: store i32 5, i32* [[B]], align 4 -; IS__CGSCC_OPM-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4]] -; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] -; IS__CGSCC_OPM-NEXT: ret i32 [[ADD]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@visible_local -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: store i32 5, i32* [[B]], align 4 -; IS__CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR5]] -; IS__CGSCC_NPM-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR5]] -; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] -; IS__CGSCC_NPM-NEXT: ret i32 [[ADD]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@visible_local +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readonly [[A:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 5, i32* [[B]], align 4 +; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(i32* nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR3]] +; NOT_CGSCC_NPM-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(i32* nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR3]] +; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[ADD]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@visible_local +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: store i32 5, i32* [[B]], align 4 +; NOT_TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR5]] +; NOT_TUNIT_NPM-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR5]] +; NOT_TUNIT_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[ADD]] ; entry: %B = alloca i32, align 4 @@ -153,43 +120,28 @@ } define internal i32 @noalias_args_argmem_ro(i32* %A, i32* %B) #1 { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@noalias_args_argmem_ro -; IS__TUNIT_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: [[T0:%.*]] = load i32, i32* [[A]], align 4 -; IS__TUNIT_OPM-NEXT: [[T1:%.*]] = load i32, i32* [[B]], align 4 -; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[T0]], [[T1]] -; IS__TUNIT_OPM-NEXT: ret i32 [[ADD]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@noalias_args_argmem_ro -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: [[B_PRIV:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP1]], i32* [[B_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[A_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[T0:%.*]] = load i32, i32* [[A_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[T1:%.*]] = load i32, i32* [[B_PRIV]], align 4 -; IS__TUNIT_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[T0]], [[T1]] -; IS__TUNIT_NPM-NEXT: ret i32 [[ADD]] ; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@noalias_args_argmem_ro -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[T0:%.*]] = load i32, i32* [[A]], align 4 -; IS__CGSCC_OPM-NEXT: [[T1:%.*]] = load i32, i32* [[B]], align 4 -; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[T0]], [[T1]] -; IS__CGSCC_OPM-NEXT: ret i32 [[ADD]] -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@noalias_args_argmem_ro -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[B_PRIV:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[T0:%.*]] = load i32, i32* [[A_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: [[T1:%.*]] = load i32, i32* [[B_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = add nsw i32 5, 5 -; IS__CGSCC_NPM-NEXT: ret i32 undef +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@noalias_args_argmem_ro +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[B_PRIV:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP1]], i32* [[B_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[A_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[T0:%.*]] = load i32, i32* [[A_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[T1:%.*]] = load i32, i32* [[B_PRIV]], align 4 +; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[T0]], [[T1]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[ADD]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@noalias_args_argmem_ro +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[B_PRIV:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[T0:%.*]] = load i32, i32* [[A_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: [[T1:%.*]] = load i32, i32* [[B_PRIV]], align 4 +; NOT_TUNIT_NPM-NEXT: [[ADD:%.*]] = add nsw i32 5, 5 +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %t0 = load i32, i32* %A, align 4 %t1 = load i32, i32* %B, align 4 @@ -198,36 +150,21 @@ } define i32 @visible_local_2() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@visible_local_2 -; IS__TUNIT_OPM-SAME: () #[[ATTR2:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__TUNIT_OPM-NEXT: store i32 5, i32* [[B]], align 4 -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_ro(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret i32 [[CALL]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@visible_local_2 -; IS__TUNIT_NPM-SAME: () #[[ATTR2:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: store i32 5, i32* [[B]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[B]], align 4 -; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_ro(i32 [[TMP1]], i32 [[TMP2]]) #[[ATTR4:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret i32 [[CALL]] ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@visible_local_2 -; IS__CGSCC_OPM-SAME: () #[[ATTR2:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: store i32 5, i32* [[B]], align 4 -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_ro(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]], i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR5:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 [[CALL]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@visible_local_2 -; IS__CGSCC_NPM-SAME: () #[[ATTR3:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: ret i32 10 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@visible_local_2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 5, i32* [[B]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[B]], align 4 +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_ro(i32 [[TMP1]], i32 [[TMP2]]) #[[ATTR4:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[CALL]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@visible_local_2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR3:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret i32 10 ; %B = alloca i32, align 4 store i32 5, i32* %B, align 4 @@ -236,19 +173,19 @@ } define internal i32 @noalias_args_argmem_rn(i32* %A, i32* %B) #1 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@noalias_args_argmem_rn -; IS__TUNIT____-SAME: (i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[T0:%.*]] = load i32, i32* [[B]], align 4 -; IS__TUNIT____-NEXT: store i32 0, i32* [[B]], align 4 -; IS__TUNIT____-NEXT: ret i32 [[T0]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@noalias_args_argmem_rn -; IS__CGSCC____-SAME: (i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: [[T0:%.*]] = load i32, i32* [[B]], align 4 -; IS__CGSCC____-NEXT: store i32 0, i32* [[B]], align 4 -; IS__CGSCC____-NEXT: ret i32 [[T0]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@noalias_args_argmem_rn +; NOT_CGSCC_NPM-SAME: (i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[T0:%.*]] = load i32, i32* [[B]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[B]], align 4 +; NOT_CGSCC_NPM-NEXT: ret i32 [[T0]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@noalias_args_argmem_rn +; NOT_TUNIT_NPM-SAME: (i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[T0:%.*]] = load i32, i32* [[B]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[B]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 [[T0]] ; %t0 = load i32, i32* %B, align 4 store i32 0, i32* %B @@ -256,29 +193,21 @@ } define i32 @visible_local_3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@visible_local_3 -; IS__TUNIT____-SAME: () #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: store i32 5, i32* [[B]], align 4 -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_rn(i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B]]) #[[ATTR5:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 [[CALL]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@visible_local_3 -; IS__CGSCC_OPM-SAME: () #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: store i32 5, i32* [[B]], align 4 -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_rn(i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B]]) #[[ATTR6:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 [[CALL]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@visible_local_3 -; IS__CGSCC_NPM-SAME: () #[[ATTR3]] { -; IS__CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: store i32 5, i32* [[B]], align 4 -; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_rn(i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B]]) #[[ATTR6:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 [[CALL]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@visible_local_3 +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 5, i32* [[B]], align 4 +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_rn(i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B]]) #[[ATTR5:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[CALL]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@visible_local_3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: store i32 5, i32* [[B]], align 4 +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_rn(i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B]]) #[[ATTR6:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[CALL]] ; %B = alloca i32, align 4 store i32 5, i32* %B, align 4 @@ -289,26 +218,18 @@ attributes #0 = { noinline nounwind uwtable willreturn } attributes #1 = { argmemonly noinline nounwind uwtable willreturn} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree noinline nosync nounwind readonly uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { argmemonly nofree noinline nosync nounwind uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nosync nounwind readonly } -; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nounwind readonly } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nosync nounwind readonly } -; IS__CGSCC_OPM: attributes #[[ATTR5]] = { nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR6]] = { nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree noinline nosync nounwind readonly uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree noinline nosync nounwind uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind readonly } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nounwind readonly } -; IS__CGSCC_NPM: attributes #[[ATTR5]] = { nosync nounwind readonly } -; IS__CGSCC_NPM: attributes #[[ATTR6]] = { nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { nounwind readonly } +; NOT_TUNIT_NPM: attributes #[[ATTR5]] = { nosync nounwind readonly } +; NOT_TUNIT_NPM: attributes #[[ATTR6]] = { nounwind willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/liveness.ll b/llvm/test/Transforms/Attributor/liveness.ll --- a/llvm/test/Transforms/Attributor/liveness.ll +++ b/llvm/test/Transforms/Attributor/liveness.ll @@ -1,8 +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=34 -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=34 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; TODO: The old pass manager cgscc run is disabled as it causes a crash on windows which is under investigation: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/23151 -; 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 ; NOT_CGSCC___: @dead_with_blockaddress_users.l = constant [2 x i8*] [i8* inttoptr (i32 1 to i8*), i8* inttoptr (i32 1 to i8*)] @@ -33,26 +31,26 @@ ; NOT_CGSCC_NPM: @[[E:[a-zA-Z0-9_$"\\.-]+]] = global %struct.a* null ; NOT_CGSCC_NPM: @[[P:[a-zA-Z0-9_$"\\.-]+]] = global i8 0 ;. -; IS__CGSCC____: @[[DEAD_WITH_BLOCKADDRESS_USERS_L:[a-zA-Z0-9_$"\\.-]+]] = constant [2 x i8*] [i8* blockaddress(@dead_with_blockaddress_users, [[LAB0:%.*]]), i8* blockaddress(@dead_with_blockaddress_users, [[END:%.*]])] -; IS__CGSCC____: @[[A1:[a-zA-Z0-9_$"\\.-]+]] = common global i8 0, align 8 -; IS__CGSCC____: @[[A2:[a-zA-Z0-9_$"\\.-]+]] = common global i8 0, align 16 -; IS__CGSCC____: @[[E:[a-zA-Z0-9_$"\\.-]+]] = global %struct.a* null -; IS__CGSCC____: @[[P:[a-zA-Z0-9_$"\\.-]+]] = global i8 0 +; NOT_TUNIT_NPM: @[[DEAD_WITH_BLOCKADDRESS_USERS_L:[a-zA-Z0-9_$"\\.-]+]] = constant [2 x i8*] [i8* blockaddress(@dead_with_blockaddress_users, [[LAB0:%.*]]), i8* blockaddress(@dead_with_blockaddress_users, [[END:%.*]])] +; NOT_TUNIT_NPM: @[[A1:[a-zA-Z0-9_$"\\.-]+]] = common global i8 0, align 8 +; NOT_TUNIT_NPM: @[[A2:[a-zA-Z0-9_$"\\.-]+]] = common global i8 0, align 16 +; NOT_TUNIT_NPM: @[[E:[a-zA-Z0-9_$"\\.-]+]] = global %struct.a* null +; NOT_TUNIT_NPM: @[[P:[a-zA-Z0-9_$"\\.-]+]] = global i8 0 ;. define internal i32 @dead_internal_func(i32 %0) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@dead_internal_func -; IS__CGSCC____-SAME: () #[[ATTR6:[0-9]+]] { -; IS__CGSCC____-NEXT: br label [[TMP2:%.*]] -; IS__CGSCC____: 1: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: 2: -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = phi i32 [ [[TMP6:%.*]], [[TMP2]] ], [ 1, [[TMP0:%.*]] ] -; IS__CGSCC____-NEXT: [[TMP4:%.*]] = phi i32 [ [[TMP5:%.*]], [[TMP2]] ], [ 1, [[TMP0]] ] -; IS__CGSCC____-NEXT: [[TMP5]] = mul nsw i32 [[TMP3]], [[TMP4]] -; IS__CGSCC____-NEXT: [[TMP6]] = add nuw nsw i32 [[TMP3]], 1 -; IS__CGSCC____-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP3]], 10 -; IS__CGSCC____-NEXT: br i1 [[TMP7]], label [[TMP1:%.*]], label [[TMP2]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@dead_internal_func +; NOT_TUNIT_NPM-SAME: () #[[ATTR6:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: br label [[TMP2:%.*]] +; NOT_TUNIT_NPM: 1: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: 2: +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = phi i32 [ [[TMP6:%.*]], [[TMP2]] ], [ 1, [[TMP0:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ [[TMP5:%.*]], [[TMP2]] ], [ 1, [[TMP0]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP5]] = mul nsw i32 [[TMP3]], [[TMP4]] +; NOT_TUNIT_NPM-NEXT: [[TMP6]] = add nuw nsw i32 [[TMP3]], 1 +; NOT_TUNIT_NPM-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP3]], 10 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP7]], label [[TMP1:%.*]], label [[TMP2]] ; %2 = icmp slt i32 %0, 1 br i1 %2, label %3, label %5 @@ -77,21 +75,21 @@ ; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = load volatile i32, i32* [[TMP0]], align 4 ; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP2]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nounwind uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@volatile_load -; IS__CGSCC____-SAME: (i32* nofree align 4 [[TMP0:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = load volatile i32, i32* [[TMP0]], align 4 -; IS__CGSCC____-NEXT: ret i32 [[TMP2]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@volatile_load +; NOT_TUNIT_NPM-SAME: (i32* nofree align 4 [[TMP0:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = load volatile i32, i32* [[TMP0]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP2]] ; %2 = load volatile i32, i32* %0, align 4 ret i32 %2 } define internal i32 @internal_load(i32*) norecurse nounwind uwtable { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@internal_load -; IS__CGSCC____-SAME: () #[[ATTR8:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@internal_load +; NOT_TUNIT_NPM-SAME: () #[[ATTR8:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %2 = load i32, i32* %0, align 4 ret i32 %2 @@ -158,21 +156,21 @@ ; NOT_CGSCC_NPM: cond.end: ; NOT_CGSCC_NPM-NEXT: ret i32 [[CALL1]] ; -; IS__CGSCC____: Function Attrs: nosync -; IS__CGSCC____-LABEL: define {{[^@]+}}@dead_block_present -; IS__CGSCC____-SAME: (i32 [[A:%.*]], i32* nocapture nofree readnone [[PTR1:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; IS__CGSCC____: cond.true: -; IS__CGSCC____-NEXT: call void @no_return_call() #[[ATTR3]] -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: cond.false: -; IS__CGSCC____-NEXT: call void @normal_call() -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32 @bar() -; IS__CGSCC____-NEXT: br label [[COND_END:%.*]] -; IS__CGSCC____: cond.end: -; IS__CGSCC____-NEXT: ret i32 [[CALL1]] +; NOT_TUNIT_NPM: Function Attrs: nosync +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@dead_block_present +; NOT_TUNIT_NPM-SAME: (i32 [[A:%.*]], i32* nocapture nofree readnone [[PTR1:%.*]]) #[[ATTR9:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; NOT_TUNIT_NPM: cond.true: +; NOT_TUNIT_NPM-NEXT: call void @no_return_call() #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: cond.false: +; NOT_TUNIT_NPM-NEXT: call void @normal_call() +; NOT_TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i32 @bar() +; NOT_TUNIT_NPM-NEXT: br label [[COND_END:%.*]] +; NOT_TUNIT_NPM: cond.end: +; NOT_TUNIT_NPM-NEXT: ret i32 [[CALL1]] ; entry: %cmp = icmp eq i32 %a, 0 @@ -518,23 +516,18 @@ ; FIXME: Should be able to detect undefined behavior. define void @ub(i32* %0) { -; IS________OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS________OPM-LABEL: define {{[^@]+}}@ub -; IS________OPM-SAME: (i32* nocapture nofree writeonly [[TMP0:%.*]]) #[[ATTR8:[0-9]+]] { -; IS________OPM-NEXT: store i32 0, i32* [[TMP0]], align 4 -; IS________OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@ub -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: store i32 0, i32* undef, align 4294967296 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@ub -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR10:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 0, i32* undef, align 4294967296 -; IS__CGSCC____-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ub +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* undef, align 4294967296 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ub +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR10:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* undef, align 4294967296 +; NOT_TUNIT_NPM-NEXT: ret void ; %poison = sub nuw i32 0, 1 ; Results in a poison value. %still_poison = and i32 %poison, 0 ; 0, but also poison. @@ -552,13 +545,13 @@ ; NOT_CGSCC_NPM: while.body: ; NOT_CGSCC_NPM-NEXT: br label [[WHILE_BODY]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@inf_loop -; IS__CGSCC____-SAME: () #[[ATTR11:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[WHILE_BODY:%.*]] -; IS__CGSCC____: while.body: -; IS__CGSCC____-NEXT: br label [[WHILE_BODY]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@inf_loop +; NOT_TUNIT_NPM-SAME: () #[[ATTR11:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_BODY:%.*]] +; NOT_TUNIT_NPM: while.body: +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_BODY]] ; entry: br label %while.body @@ -614,11 +607,11 @@ ; NOT_CGSCC_NPM-NEXT: entry: ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@rec -; IS__CGSCC____-SAME: () #[[ATTR12:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@rec +; NOT_TUNIT_NPM-SAME: () #[[ATTR12:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: call void @rec() @@ -643,18 +636,18 @@ ; NOT_CGSCC_NPM: cond.end: ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test6 -; IS__CGSCC____-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR12]] { -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: cond.if: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: cond.elseif: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: cond.else: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: cond.end: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test6 +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR12]] { +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: cond.if: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: cond.elseif: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: cond.else: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: cond.end: +; NOT_TUNIT_NPM-NEXT: unreachable ; call void @rec() %3 = icmp sgt i32 %0, %1 @@ -740,16 +733,16 @@ @a2 = common global i8 0, align 16 define internal i8* @f1(i8* readnone %0) local_unnamed_addr #0 { -; IS__CGSCC____-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC____-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr { -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP0]], null -; IS__CGSCC____-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__CGSCC____: 3: -; IS__CGSCC____-NEXT: [[TMP4:%.*]] = tail call i8* @f2(i8* nonnull @a1) -; IS__CGSCC____-NEXT: br label [[TMP5]] -; IS__CGSCC____: 5: -; IS__CGSCC____-NEXT: [[TMP6:%.*]] = phi i8* [ [[TMP4]], [[TMP3]] ], [ [[TMP0]], [[TMP1:%.*]] ] -; IS__CGSCC____-NEXT: ret i8* [[TMP6]] +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f1 +; NOT_TUNIT_NPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr { +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP0]], null +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; NOT_TUNIT_NPM: 3: +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = tail call i8* @f2(i8* nonnull @a1) +; NOT_TUNIT_NPM-NEXT: br label [[TMP5]] +; NOT_TUNIT_NPM: 5: +; NOT_TUNIT_NPM-NEXT: [[TMP6:%.*]] = phi i8* [ [[TMP4]], [[TMP3]] ], [ [[TMP0]], [[TMP1:%.*]] ] +; NOT_TUNIT_NPM-NEXT: ret i8* [[TMP6]] ; %2 = icmp eq i8* %0, null br i1 %2, label %3, label %5 @@ -764,19 +757,19 @@ } define internal i8* @f2(i8* readnone %0) local_unnamed_addr #0 { -; IS__CGSCC____-LABEL: define {{[^@]+}}@f2 -; IS__CGSCC____-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr { -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP0]], null -; IS__CGSCC____-NEXT: br i1 [[TMP2]], label [[TMP5:%.*]], label [[TMP3:%.*]] -; IS__CGSCC____: 3: -; IS__CGSCC____-NEXT: [[TMP4:%.*]] = tail call i8* @f1(i8* nonnull [[TMP0]]) -; IS__CGSCC____-NEXT: br label [[TMP7:%.*]] -; IS__CGSCC____: 5: -; IS__CGSCC____-NEXT: [[TMP6:%.*]] = tail call i8* @f3(i8* nonnull @a2) -; IS__CGSCC____-NEXT: br label [[TMP7]] -; IS__CGSCC____: 7: -; IS__CGSCC____-NEXT: [[TMP8:%.*]] = phi i8* [ [[TMP4]], [[TMP3]] ], [ [[TMP6]], [[TMP5]] ] -; IS__CGSCC____-NEXT: ret i8* [[TMP8]] +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f2 +; NOT_TUNIT_NPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr { +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP0]], null +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP2]], label [[TMP5:%.*]], label [[TMP3:%.*]] +; NOT_TUNIT_NPM: 3: +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = tail call i8* @f1(i8* nonnull [[TMP0]]) +; NOT_TUNIT_NPM-NEXT: br label [[TMP7:%.*]] +; NOT_TUNIT_NPM: 5: +; NOT_TUNIT_NPM-NEXT: [[TMP6:%.*]] = tail call i8* @f3(i8* nonnull @a2) +; NOT_TUNIT_NPM-NEXT: br label [[TMP7]] +; NOT_TUNIT_NPM: 7: +; NOT_TUNIT_NPM-NEXT: [[TMP8:%.*]] = phi i8* [ [[TMP4]], [[TMP3]] ], [ [[TMP6]], [[TMP5]] ] +; NOT_TUNIT_NPM-NEXT: ret i8* [[TMP8]] ; %2 = icmp eq i8* %0, null br i1 %2, label %5, label %3 @@ -796,16 +789,16 @@ } define internal i8* @f3(i8* readnone %0) local_unnamed_addr #0 { -; IS__CGSCC____-LABEL: define {{[^@]+}}@f3 -; IS__CGSCC____-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr { -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP0]], null -; IS__CGSCC____-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__CGSCC____: 3: -; IS__CGSCC____-NEXT: [[TMP4:%.*]] = tail call i8* @f1(i8* nonnull @a2) -; IS__CGSCC____-NEXT: br label [[TMP5]] -; IS__CGSCC____: 5: -; IS__CGSCC____-NEXT: [[TMP6:%.*]] = phi i8* [ [[TMP4]], [[TMP3]] ], [ @a1, [[TMP1:%.*]] ] -; IS__CGSCC____-NEXT: ret i8* [[TMP6]] +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f3 +; NOT_TUNIT_NPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr { +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP0]], null +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; NOT_TUNIT_NPM: 3: +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = tail call i8* @f1(i8* nonnull @a2) +; NOT_TUNIT_NPM-NEXT: br label [[TMP5]] +; NOT_TUNIT_NPM: 5: +; NOT_TUNIT_NPM-NEXT: [[TMP6:%.*]] = phi i8* [ [[TMP4]], [[TMP3]] ], [ @a1, [[TMP1:%.*]] ] +; NOT_TUNIT_NPM-NEXT: ret i8* [[TMP6]] ; %2 = icmp eq i8* %0, null br i1 %2, label %3, label %5 @@ -828,12 +821,12 @@ ; NOT_CGSCC_NPM-NEXT: call void @test_unreachable() #[[ATTR0]] ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree noreturn nosync nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_unreachable -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17:[0-9]+]] -; IS__CGSCC____-NEXT: call void @test_unreachable() #[[ATTR0]] -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree noreturn nosync nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_unreachable +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: call void @test_unreachable() #[[ATTR0]] +; NOT_TUNIT_NPM-NEXT: unreachable ; call void @sink() call void @test_unreachable() @@ -910,34 +903,34 @@ ; NOT_CGSCC_NPM-NEXT: call void @non_exact2() ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@middle() { -; IS__CGSCC____-NEXT: bb0: -; IS__CGSCC____-NEXT: call void @non_dead_b0() #[[ATTR17]] -; IS__CGSCC____-NEXT: call void @non_dead_b1() #[[ATTR17]] -; IS__CGSCC____-NEXT: call void @non_dead_b2() #[[ATTR17]] -; IS__CGSCC____-NEXT: call void @non_dead_b3() #[[ATTR17]] -; IS__CGSCC____-NEXT: br label [[BB1:%.*]] -; IS__CGSCC____: bb1: -; IS__CGSCC____-NEXT: call void @non_dead_b4() #[[ATTR17]] -; IS__CGSCC____-NEXT: call void @non_dead_b5() #[[ATTR17]] -; IS__CGSCC____-NEXT: call void @non_dead_b6() #[[ATTR17]] -; IS__CGSCC____-NEXT: call void @non_dead_b7() #[[ATTR17]] -; IS__CGSCC____-NEXT: br label [[BB2:%.*]] -; IS__CGSCC____: bb2: -; IS__CGSCC____-NEXT: call void @non_dead_b8() #[[ATTR17]] -; IS__CGSCC____-NEXT: call void @non_dead_b9() #[[ATTR17]] -; IS__CGSCC____-NEXT: call void @non_dead_b10() #[[ATTR17]] -; IS__CGSCC____-NEXT: call void @non_dead_b11() #[[ATTR17]] -; IS__CGSCC____-NEXT: br label [[BB3:%.*]] -; IS__CGSCC____: bb3: -; IS__CGSCC____-NEXT: call void @non_dead_b12() #[[ATTR17]] -; IS__CGSCC____-NEXT: call void @non_dead_b13() #[[ATTR17]] -; IS__CGSCC____-NEXT: call void @non_dead_b14() #[[ATTR17]] -; IS__CGSCC____-NEXT: call void @non_dead_b15() #[[ATTR17]] -; IS__CGSCC____-NEXT: br label [[BB4:%.*]] -; IS__CGSCC____: bb4: -; IS__CGSCC____-NEXT: call void @non_exact2() -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@middle() { +; NOT_TUNIT_NPM-NEXT: bb0: +; NOT_TUNIT_NPM-NEXT: call void @non_dead_b0() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: call void @non_dead_b1() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: call void @non_dead_b2() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: call void @non_dead_b3() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: br label [[BB1:%.*]] +; NOT_TUNIT_NPM: bb1: +; NOT_TUNIT_NPM-NEXT: call void @non_dead_b4() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: call void @non_dead_b5() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: call void @non_dead_b6() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: call void @non_dead_b7() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: br label [[BB2:%.*]] +; NOT_TUNIT_NPM: bb2: +; NOT_TUNIT_NPM-NEXT: call void @non_dead_b8() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: call void @non_dead_b9() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: call void @non_dead_b10() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: call void @non_dead_b11() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: br label [[BB3:%.*]] +; NOT_TUNIT_NPM: bb3: +; NOT_TUNIT_NPM-NEXT: call void @non_dead_b12() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: call void @non_dead_b13() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: call void @non_dead_b14() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: call void @non_dead_b15() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: br label [[BB4:%.*]] +; NOT_TUNIT_NPM: bb4: +; NOT_TUNIT_NPM-NEXT: call void @non_exact2() +; NOT_TUNIT_NPM-NEXT: ret void ; bb0: call void @non_dead_b0() @@ -1056,11 +1049,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a0 -; IS__CGSCC____-SAME: () #[[ATTR13:[0-9]+]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_a0 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1072,11 +1065,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a1 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_a1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1088,11 +1081,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a2 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_a2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1104,11 +1097,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a3 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_a3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1120,11 +1113,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a4 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_a4 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1136,11 +1129,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a5 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_a5 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1152,11 +1145,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a6 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_a6 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1168,11 +1161,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a7 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_a7 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1184,11 +1177,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a8 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_a8 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1200,11 +1193,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a9 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_a9 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1216,11 +1209,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a10 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_a10 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1232,11 +1225,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a11 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_a11 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1248,11 +1241,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a12 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_a12 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1264,11 +1257,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a13 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_a13 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1280,11 +1273,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a14 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_a14 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1296,11 +1289,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_a15 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_a15 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1312,11 +1305,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b0 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_b0 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1328,11 +1321,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b1 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_b1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1344,11 +1337,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b2 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_b2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1360,11 +1353,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b3 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_b3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1376,11 +1369,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b4 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_b4 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1392,11 +1385,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b5 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_b5 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1408,11 +1401,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b6 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_b6 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1424,11 +1417,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b7 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_b7 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1440,11 +1433,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b8 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_b8 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1456,11 +1449,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b9 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_b9 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1472,11 +1465,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b10 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_b10 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1488,11 +1481,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b11 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_b11 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1504,11 +1497,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b12 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_b12 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1520,11 +1513,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b13 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_b13 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1536,11 +1529,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b14 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_b14 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1552,11 +1545,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_b15 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_b15 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1568,11 +1561,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c0 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_c0 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1584,11 +1577,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c1 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_c1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1600,11 +1593,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c2 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_c2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1616,11 +1609,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c3 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_c3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1632,11 +1625,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c4 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_c4 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1648,11 +1641,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c5 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_c5 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1664,11 +1657,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c6 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_c6 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1680,11 +1673,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c7 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_c7 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1696,11 +1689,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c8 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_c8 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1712,11 +1705,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c9 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_c9 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1728,11 +1721,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c10 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_c10 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1744,11 +1737,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c11 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_c11 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1760,11 +1753,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c12 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_c12 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1776,11 +1769,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c13 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_c13 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1792,11 +1785,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c14 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_c14 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1808,11 +1801,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_c15 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_c15 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1824,11 +1817,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d0 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_d0 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1840,11 +1833,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d1 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_d1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1856,11 +1849,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d2 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_d2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1872,11 +1865,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d3 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_d3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1888,11 +1881,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d4 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_d4 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1904,11 +1897,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d5 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_d5 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1920,11 +1913,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d6 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_d6 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1936,11 +1929,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d7 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_d7 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1952,11 +1945,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d8 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_d8 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1968,11 +1961,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d9 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_d9 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -1984,11 +1977,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d10 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_d10 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -2000,11 +1993,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d11 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_d11 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -2016,11 +2009,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d12 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_d12 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -2032,11 +2025,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d13 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_d13 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -2048,11 +2041,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d14 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_d14 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -2064,19 +2057,19 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@non_dead_d15 -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_dead_d15 +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void } define internal void @dead_e0() { call void @dead_e1() ret void } -; IS__CGSCC____-LABEL: define {{[^@]+}}@dead_e0() { -; IS__CGSCC____-NEXT: call void @dead_e1() -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@dead_e0() { +; NOT_TUNIT_NPM-NEXT: call void @dead_e1() +; NOT_TUNIT_NPM-NEXT: ret void ; define internal void @dead_e1() { call void @dead_e2() ret void } define internal void @dead_e2() { ret void } @@ -2136,11 +2129,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@useless_arg_sink -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@useless_arg_sink +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @sink() ret void @@ -2153,11 +2146,11 @@ ; NOT_CGSCC_NPM-NEXT: call void @useless_arg_sink() #[[ATTR11]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@useless_arg_almost_sink -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: call void @useless_arg_sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@useless_arg_almost_sink +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: call void @useless_arg_sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @useless_arg_sink(i32* %a) ret void @@ -2211,19 +2204,19 @@ ; NOT_CGSCC_NPM: return: ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@switch_default -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ -; IS__CGSCC____-NEXT: i64 3, label [[RETURN:%.*]] -; IS__CGSCC____-NEXT: i64 10, label [[RETURN]] -; IS__CGSCC____-NEXT: ] -; IS__CGSCC____: sw.default: -; IS__CGSCC____-NEXT: call void @sink() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@switch_default +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ +; NOT_TUNIT_NPM-NEXT: i64 3, label [[RETURN:%.*]] +; NOT_TUNIT_NPM-NEXT: i64 10, label [[RETURN]] +; NOT_TUNIT_NPM-NEXT: ] +; NOT_TUNIT_NPM: sw.default: +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: switch i64 %i, label %sw.default [ @@ -2246,29 +2239,29 @@ ; NOT_CGSCC_NPM-NEXT: [[CALL2:%.*]] = tail call i32 @switch_default() #[[ATTR11]] ; NOT_CGSCC_NPM-NEXT: ret i32 123 ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@switch_default_caller -; IS__CGSCC____-SAME: () #[[ATTR13]] { -; IS__CGSCC____-NEXT: [[CALL2:%.*]] = tail call i32 @switch_default() #[[ATTR17]] -; IS__CGSCC____-NEXT: ret i32 123 +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@switch_default_caller +; NOT_TUNIT_NPM-SAME: () #[[ATTR13]] { +; NOT_TUNIT_NPM-NEXT: [[CALL2:%.*]] = tail call i32 @switch_default() #[[ATTR17]] +; NOT_TUNIT_NPM-NEXT: ret i32 123 ; %call2 = tail call i32 @switch_default(i64 0) ret i32 %call2 } define internal i32 @switch_default_dead(i64 %i) nounwind { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@switch_default_dead -; IS__CGSCC____-SAME: () #[[ATTR6]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ -; IS__CGSCC____-NEXT: i64 3, label [[RETURN:%.*]] -; IS__CGSCC____-NEXT: i64 10, label [[RETURN]] -; IS__CGSCC____-NEXT: ] -; IS__CGSCC____: sw.default: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@switch_default_dead +; NOT_TUNIT_NPM-SAME: () #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ +; NOT_TUNIT_NPM-NEXT: i64 3, label [[RETURN:%.*]] +; NOT_TUNIT_NPM-NEXT: i64 10, label [[RETURN]] +; NOT_TUNIT_NPM-NEXT: ] +; NOT_TUNIT_NPM: sw.default: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: switch i64 %i, label %sw.default [ @@ -2289,10 +2282,10 @@ ; NOT_CGSCC_NPM-SAME: () #[[ATTR12:[0-9]+]] { ; NOT_CGSCC_NPM-NEXT: ret i32 123 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@switch_default_dead_caller -; IS__CGSCC____-SAME: () #[[ATTR6]] { -; IS__CGSCC____-NEXT: ret i32 123 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@switch_default_dead_caller +; NOT_TUNIT_NPM-SAME: () #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: ret i32 123 ; %call2 = tail call i32 @switch_default_dead(i64 0) ret i32 %call2 @@ -2314,10 +2307,10 @@ ; NOT_CGSCC_NPM-NEXT: call void @called_via_pointer(i32* [[A]], i32* nonnull align 128 dereferenceable(4) [[B]], i32* [[A]], i64 -1, i32** null) ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_internal_a -; IS__CGSCC____-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull [[FP:%.*]]) { -; IS__CGSCC____-NEXT: call void [[FP]](i32* [[A]], i32* nonnull align 128 dereferenceable(4) [[B]], i32* [[A]], i64 -1, i32** null) -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_internal_a +; NOT_TUNIT_NPM-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull [[FP:%.*]]) { +; NOT_TUNIT_NPM-NEXT: call void [[FP]](i32* [[A]], i32* nonnull align 128 dereferenceable(4) [[B]], i32* [[A]], i64 -1, i32** null) +; NOT_TUNIT_NPM-NEXT: ret void ; call void %fp(i32* %a, i32* %b, i32* %a, i64 -1, i32** null) ret void @@ -2328,10 +2321,10 @@ ; NOT_CGSCC_NPM-NEXT: call void @called_via_pointer_internal_2(i32* [[A]], i32* nonnull align 128 dereferenceable(4) [[B]], i32* [[A]], i64 -1, i32** null) ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_internal_b -; IS__CGSCC____-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull [[FP:%.*]]) { -; IS__CGSCC____-NEXT: call void [[FP]](i32* [[A]], i32* nonnull align 128 dereferenceable(4) [[B]], i32* [[A]], i64 -1, i32** null) -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_internal_b +; NOT_TUNIT_NPM-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull [[FP:%.*]]) { +; NOT_TUNIT_NPM-NEXT: call void [[FP]](i32* [[A]], i32* nonnull align 128 dereferenceable(4) [[B]], i32* [[A]], i64 -1, i32** null) +; NOT_TUNIT_NPM-NEXT: ret void ; call void %fp(i32* %a, i32* %b, i32* %a, i64 -1, i32** null) ret void @@ -2349,17 +2342,17 @@ ; NOT_CGSCC_NPM-NEXT: call void @call_via_pointer_with_dead_args_internal_b(i32* [[B]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR4]]) ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_caller -; IS__CGSCC____-SAME: (i32* [[A:%.*]], i32* [[B:%.*]]) { -; IS__CGSCC____-NEXT: [[PTR1:%.*]] = alloca i32, align 128 -; IS__CGSCC____-NEXT: [[PTR2:%.*]] = alloca i32, align 128 -; IS__CGSCC____-NEXT: [[PTR3:%.*]] = alloca i32, align 128 -; IS__CGSCC____-NEXT: [[PTR4:%.*]] = alloca i32, align 128 -; IS__CGSCC____-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR1]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull @called_via_pointer) -; IS__CGSCC____-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR2]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull @called_via_pointer_internal_1) -; IS__CGSCC____-NEXT: call void @call_via_pointer_with_dead_args_internal_a(i32* [[B]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR3]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull @called_via_pointer) -; IS__CGSCC____-NEXT: call void @call_via_pointer_with_dead_args_internal_b(i32* [[B]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR4]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull @called_via_pointer_internal_2) -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_caller +; NOT_TUNIT_NPM-SAME: (i32* [[A:%.*]], i32* [[B:%.*]]) { +; NOT_TUNIT_NPM-NEXT: [[PTR1:%.*]] = alloca i32, align 128 +; NOT_TUNIT_NPM-NEXT: [[PTR2:%.*]] = alloca i32, align 128 +; NOT_TUNIT_NPM-NEXT: [[PTR3:%.*]] = alloca i32, align 128 +; NOT_TUNIT_NPM-NEXT: [[PTR4:%.*]] = alloca i32, align 128 +; NOT_TUNIT_NPM-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR1]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull @called_via_pointer) +; NOT_TUNIT_NPM-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR2]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull @called_via_pointer_internal_1) +; NOT_TUNIT_NPM-NEXT: call void @call_via_pointer_with_dead_args_internal_a(i32* [[B]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR3]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull @called_via_pointer) +; NOT_TUNIT_NPM-NEXT: call void @call_via_pointer_with_dead_args_internal_b(i32* [[B]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR4]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull @called_via_pointer_internal_2) +; NOT_TUNIT_NPM-NEXT: ret void ; %ptr1 = alloca i32, align 128 %ptr2 = alloca i32, align 128 @@ -2415,36 +2408,20 @@ ; Allow blockaddress users define internal void @dead_with_blockaddress_users(i32* nocapture %pc) nounwind readonly { -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@dead_with_blockaddress_users -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree nonnull readonly align 536870912 dereferenceable(4294967295) [[PC:%.*]]) -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[INDIRECTGOTO:%.*]] -; IS__CGSCC_OPM: lab0: -; IS__CGSCC_OPM-NEXT: [[INDVAR_NEXT:%.*]] = add i32 [[INDVAR:%.*]], 1 -; IS__CGSCC_OPM-NEXT: br label [[INDIRECTGOTO]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: ret void -; IS__CGSCC_OPM: indirectgoto: -; IS__CGSCC_OPM-NEXT: [[INDVAR]] = phi i32 [ [[INDVAR_NEXT]], [[LAB0:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[PC_ADDR_0:%.*]] = getelementptr i32, i32* [[PC]], i32 [[INDVAR]] -; IS__CGSCC_OPM-NEXT: [[TMP1_PN:%.*]] = load i32, i32* [[PC_ADDR_0]] -; IS__CGSCC_OPM-NEXT: [[INDIRECT_GOTO_DEST_IN:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* @dead_with_blockaddress_users.l, i32 0, i32 [[TMP1_PN]] -; IS__CGSCC_OPM-NEXT: [[INDIRECT_GOTO_DEST:%.*]] = load i8*, i8** [[INDIRECT_GOTO_DEST_IN]] -; IS__CGSCC_OPM-NEXT: indirectbr i8* [[INDIRECT_GOTO_DEST]], [label [[LAB0]], label %end] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@dead_with_blockaddress_users -; IS__CGSCC____-SAME: () #[[ATTR14:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[INDIRECTGOTO:%.*]] -; IS__CGSCC____: lab0: -; IS__CGSCC____-NEXT: [[INDVAR_NEXT:%.*]] = add i32 [[INDVAR:%.*]], 1 -; IS__CGSCC____-NEXT: br label [[INDIRECTGOTO]] -; IS__CGSCC____: end: -; IS__CGSCC____-NEXT: ret void -; IS__CGSCC____: indirectgoto: -; IS__CGSCC____-NEXT: [[INDVAR]] = phi i32 [ [[INDVAR_NEXT]], [[LAB0:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC____-NEXT: indirectbr i8* undef, [label [[LAB0]], label %end] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@dead_with_blockaddress_users +; NOT_TUNIT_NPM-SAME: () #[[ATTR14:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[INDIRECTGOTO:%.*]] +; NOT_TUNIT_NPM: lab0: +; NOT_TUNIT_NPM-NEXT: [[INDVAR_NEXT:%.*]] = add i32 [[INDVAR:%.*]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[INDIRECTGOTO]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: ret void +; NOT_TUNIT_NPM: indirectgoto: +; NOT_TUNIT_NPM-NEXT: [[INDVAR]] = phi i32 [ [[INDVAR_NEXT]], [[LAB0:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; NOT_TUNIT_NPM-NEXT: indirectbr i8* undef, [label [[LAB0]], label %end] ; entry: br label %indirectgoto @@ -2501,31 +2478,31 @@ ; NOT_CGSCC_NPM: for.end.1: ; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@main() { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[FOR_COND_0:%.*]] -; IS__CGSCC____: for.cond.0: -; IS__CGSCC____-NEXT: [[G_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY_0:%.*]] ] -; IS__CGSCC____-NEXT: [[CMP_0:%.*]] = icmp ult i32 [[G_0]], 100 -; IS__CGSCC____-NEXT: br i1 [[CMP_0]], label [[FOR_BODY_0]], label [[FOR_END_0:%.*]] -; IS__CGSCC____: for.body.0: -; IS__CGSCC____-NEXT: [[INC]] = add nuw nsw i32 [[G_0]], 1 -; IS__CGSCC____-NEXT: br label [[FOR_COND_0]] -; IS__CGSCC____: for.end.0: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i8* @malloc(i64 noundef 8) -; IS__CGSCC____-NEXT: store i8* [[CALL]], i8** bitcast (%struct.a** @e to i8**), align 8 -; IS__CGSCC____-NEXT: [[B:%.*]] = bitcast i8* [[CALL]] to %struct.a** -; IS__CGSCC____-NEXT: store %struct.a* null, %struct.a** [[B]], align 8 -; IS__CGSCC____-NEXT: br label [[FOR_COND_1:%.*]] -; IS__CGSCC____: for.cond.1: -; IS__CGSCC____-NEXT: [[G_1:%.*]] = phi i32 [ 0, [[FOR_END_0]] ], [ [[INC6:%.*]], [[FOR_BODY_1:%.*]] ] -; IS__CGSCC____-NEXT: [[CMP_1:%.*]] = icmp ult i32 [[G_1]], 100 -; IS__CGSCC____-NEXT: br i1 [[CMP_1]], label [[FOR_BODY_1]], label [[FOR_END_1:%.*]] -; IS__CGSCC____: for.body.1: -; IS__CGSCC____-NEXT: [[INC6]] = add nuw nsw i32 [[G_1]], 1 -; IS__CGSCC____-NEXT: br label [[FOR_COND_1]] -; IS__CGSCC____: for.end.1: -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@main() { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND_0:%.*]] +; NOT_TUNIT_NPM: for.cond.0: +; NOT_TUNIT_NPM-NEXT: [[G_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY_0:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[CMP_0:%.*]] = icmp ult i32 [[G_0]], 100 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP_0]], label [[FOR_BODY_0]], label [[FOR_END_0:%.*]] +; NOT_TUNIT_NPM: for.body.0: +; NOT_TUNIT_NPM-NEXT: [[INC]] = add nuw nsw i32 [[G_0]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND_0]] +; NOT_TUNIT_NPM: for.end.0: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i8* @malloc(i64 noundef 8) +; NOT_TUNIT_NPM-NEXT: store i8* [[CALL]], i8** bitcast (%struct.a** @e to i8**), align 8 +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = bitcast i8* [[CALL]] to %struct.a** +; NOT_TUNIT_NPM-NEXT: store %struct.a* null, %struct.a** [[B]], align 8 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND_1:%.*]] +; NOT_TUNIT_NPM: for.cond.1: +; NOT_TUNIT_NPM-NEXT: [[G_1:%.*]] = phi i32 [ 0, [[FOR_END_0]] ], [ [[INC6:%.*]], [[FOR_BODY_1:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[CMP_1:%.*]] = icmp ult i32 [[G_1]], 100 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP_1]], label [[FOR_BODY_1]], label [[FOR_END_1:%.*]] +; NOT_TUNIT_NPM: for.body.1: +; NOT_TUNIT_NPM-NEXT: [[INC6]] = add nuw nsw i32 [[G_1]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND_1]] +; NOT_TUNIT_NPM: for.end.1: +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; entry: %f = alloca i32 @@ -2569,10 +2546,10 @@ ; NOT_CGSCC_NPM-SAME: (i32 [[I:%.*]]) #[[ATTR12]] { ; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@h -; IS__CGSCC____-SAME: (i32 [[I:%.*]]) #[[ATTR6]] { -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@h +; NOT_TUNIT_NPM-SAME: (i32 [[I:%.*]]) #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; ret i32 0 } @@ -2601,23 +2578,23 @@ ; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR15]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bad_gep -; IS__CGSCC____-SAME: () #[[ATTR15:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[N:%.*]] = alloca i8, align 1 -; IS__CGSCC____-NEXT: [[M:%.*]] = alloca i8, align 1 -; IS__CGSCC____-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR18:[0-9]+]] -; IS__CGSCC____-NEXT: br label [[EXIT:%.*]] -; IS__CGSCC____: while.body: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR18]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bad_gep +; NOT_TUNIT_NPM-SAME: () #[[ATTR15:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[N:%.*]] = alloca i8, align 1 +; NOT_TUNIT_NPM-NEXT: [[M:%.*]] = alloca i8, align 1 +; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR18:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: br label [[EXIT:%.*]] +; NOT_TUNIT_NPM: while.body: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: exit: +; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR18]] +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %n = alloca i8 @@ -2658,7 +2635,7 @@ ; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { nosync readnone } ; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nounwind uwtable willreturn } ; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { nosync } -; NOT_CGSCC_NPM: attributes #[[ATTR8:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { argmemonly nofree nosync nounwind willreturn writeonly } ; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { nofree noreturn nosync nounwind readnone } ; NOT_CGSCC_NPM: attributes #[[ATTR10]] = { nofree noreturn nosync nounwind readnone willreturn } ; NOT_CGSCC_NPM: attributes #[[ATTR11]] = { nofree nosync nounwind willreturn } @@ -2667,23 +2644,23 @@ ; NOT_CGSCC_NPM: attributes #[[ATTR14]] = { nounwind willreturn } ; NOT_CGSCC_NPM: attributes #[[ATTR15]] = { willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind } -; IS__CGSCC____: attributes #[[ATTR1:[0-9]+]] = { readnone } -; IS__CGSCC____: attributes #[[ATTR2]] = { nounwind } -; IS__CGSCC____: attributes #[[ATTR3]] = { noreturn nounwind } -; IS__CGSCC____: attributes #[[ATTR4]] = { noreturn } -; IS__CGSCC____: attributes #[[ATTR5]] = { nosync readnone } -; IS__CGSCC____: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR7]] = { argmemonly nofree norecurse nounwind uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR9]] = { nosync } -; IS__CGSCC____: attributes #[[ATTR10]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR11]] = { nofree norecurse noreturn nosync nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR12]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR13]] = { nofree nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR14]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR15]] = { nofree nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR16:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR17]] = { nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR18]] = { willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR1:[0-9]+]] = { readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { noreturn nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { noreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR5]] = { nosync readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR7]] = { argmemonly nofree norecurse nounwind uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR9]] = { nosync } +; NOT_TUNIT_NPM: attributes #[[ATTR10]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR11]] = { nofree norecurse noreturn nosync nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR12]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR13]] = { nofree nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR14]] = { nofree norecurse nosync nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR15]] = { nofree nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR16:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR17]] = { nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR18]] = { willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/liveness_chains.ll b/llvm/test/Transforms/Attributor/liveness_chains.ll --- a/llvm/test/Transforms/Attributor/liveness_chains.ll +++ b/llvm/test/Transforms/Attributor/liveness_chains.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; Make sure we need a single iteration to determine the chains are dead/alive. @@ -9,15 +7,15 @@ declare i32 @source() nounwind readonly define i32 @chain_dead(i32 %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@chain_dead -; IS__TUNIT____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@chain_dead +; NOT_CGSCC_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@chain_dead -; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@chain_dead +; NOT_TUNIT_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; %init = call i32 @source() %v0 = add i32 %arg, %init @@ -64,9 +62,9 @@ ret i32 %v9 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nounwind readonly } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nounwind readonly } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nounwind readonly } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nounwind readonly } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/lowerheap.ll b/llvm/test/Transforms/Attributor/lowerheap.ll --- a/llvm/test/Transforms/Attributor/lowerheap.ll +++ b/llvm/test/Transforms/Attributor/lowerheap.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -max-heap-to-stack-size=-1 -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -max-heap-to-stack-size=-1 -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -max-heap-to-stack-size=-1 -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 -max-heap-to-stack-size=-1 -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 declare i64 @subfn(i8*) #0 @@ -11,20 +9,13 @@ declare void @free(i8*) define i64 @f(i64 %len) { -; IS________OPM-LABEL: define {{[^@]+}}@f -; IS________OPM-SAME: (i64 [[LEN:%.*]]) { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[MEM:%.*]] = call noalias i8* @malloc(i64 [[LEN]]) -; IS________OPM-NEXT: [[RES:%.*]] = call i64 @subfn(i8* [[MEM]]) #[[ATTR1:[0-9]+]] -; IS________OPM-NEXT: call void @free(i8* [[MEM]]) -; IS________OPM-NEXT: ret i64 [[RES]] ; -; IS________NPM-LABEL: define {{[^@]+}}@f -; IS________NPM-SAME: (i64 [[LEN:%.*]]) { -; IS________NPM-NEXT: entry: -; IS________NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 [[LEN]], align 1 -; IS________NPM-NEXT: [[RES:%.*]] = call i64 @subfn(i8* [[TMP0]]) #[[ATTR2:[0-9]+]] -; IS________NPM-NEXT: ret i64 [[RES]] +; CHECK-LABEL: define {{[^@]+}}@f +; CHECK-SAME: (i64 [[LEN:%.*]]) { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[TMP0:%.*]] = alloca i8, i64 [[LEN]], align 1 +; CHECK-NEXT: [[RES:%.*]] = call i64 @subfn(i8* [[TMP0]]) #[[ATTR2:[0-9]+]] +; CHECK-NEXT: ret i64 [[RES]] ; entry: %mem = call i8* @malloc(i64 %len) @@ -35,23 +26,16 @@ define i64 @g(i64 %len) { -; IS________OPM-LABEL: define {{[^@]+}}@g -; IS________OPM-SAME: (i64 [[LEN:%.*]]) { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[MEM:%.*]] = call noalias i8* @calloc(i64 [[LEN]], i64 noundef 8) -; IS________OPM-NEXT: [[RES:%.*]] = call i64 @subfn(i8* [[MEM]]) #[[ATTR1]] -; IS________OPM-NEXT: call void @free(i8* [[MEM]]) -; IS________OPM-NEXT: ret i64 [[RES]] ; -; IS________NPM-LABEL: define {{[^@]+}}@g -; IS________NPM-SAME: (i64 [[LEN:%.*]]) { -; IS________NPM-NEXT: entry: -; IS________NPM-NEXT: [[H2S_CALLOC_SIZE:%.*]] = mul i64 [[LEN]], 8 -; IS________NPM-NEXT: [[TMP0:%.*]] = alloca i8, i64 [[H2S_CALLOC_SIZE]], align 1 -; IS________NPM-NEXT: [[CALLOC_BC:%.*]] = bitcast i8* [[TMP0]] to i8* -; IS________NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* [[CALLOC_BC]], i8 0, i64 [[H2S_CALLOC_SIZE]], i1 false) -; IS________NPM-NEXT: [[RES:%.*]] = call i64 @subfn(i8* [[TMP0]]) #[[ATTR2]] -; IS________NPM-NEXT: ret i64 [[RES]] +; CHECK-LABEL: define {{[^@]+}}@g +; CHECK-SAME: (i64 [[LEN:%.*]]) { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[H2S_CALLOC_SIZE:%.*]] = mul i64 [[LEN]], 8 +; CHECK-NEXT: [[TMP0:%.*]] = alloca i8, i64 [[H2S_CALLOC_SIZE]], align 1 +; CHECK-NEXT: [[CALLOC_BC:%.*]] = bitcast i8* [[TMP0]] to i8* +; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[CALLOC_BC]], i8 0, i64 [[H2S_CALLOC_SIZE]], i1 false) +; CHECK-NEXT: [[RES:%.*]] = call i64 @subfn(i8* [[TMP0]]) #[[ATTR2]] +; CHECK-NEXT: ret i64 [[RES]] ; entry: %mem = call i8* @calloc(i64 %len, i64 8) @@ -62,10 +46,7 @@ attributes #0 = { nounwind willreturn } ;. -; IS________OPM: attributes #[[ATTR0:[0-9]+]] = { nounwind willreturn } -; IS________OPM: attributes #[[ATTR1]] = { nounwind } -;. -; IS________NPM: attributes #[[ATTR0:[0-9]+]] = { nounwind willreturn } -; IS________NPM: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } -; IS________NPM: attributes #[[ATTR2]] = { nounwind } +; CHECK: attributes #[[ATTR0:[0-9]+]] = { nounwind willreturn } +; CHECK: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; CHECK: attributes #[[ATTR2]] = { nounwind } ;. diff --git a/llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll b/llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll --- a/llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll +++ b/llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll @@ -1,71 +1,38 @@ ; 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=17 -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=17 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM define i8 @test1(i32 %a, i32 %length) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test1 -; IS__TUNIT_OPM-SAME: (i32 [[A:%.*]], i32 [[LENGTH:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_OPM: loop: -; IS__TUNIT_OPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[CND:%.*]] = icmp sge i32 [[IV]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[CND]], label [[BACKEDGE]], label [[EXIT:%.*]] -; IS__TUNIT_OPM: backedge: -; IS__TUNIT_OPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__TUNIT_OPM-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__TUNIT_OPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] -; IS__TUNIT_OPM: exit: -; IS__TUNIT_OPM-NEXT: ret i8 0 ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test1 -; IS__TUNIT_NPM-SAME: (i32 [[A:%.*]], i32 [[LENGTH:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_NPM: loop: -; IS__TUNIT_NPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__TUNIT_NPM-NEXT: br label [[BACKEDGE]] -; IS__TUNIT_NPM: backedge: -; IS__TUNIT_NPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__TUNIT_NPM-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__TUNIT_NPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT:%.*]] -; IS__TUNIT_NPM: exit: -; IS__TUNIT_NPM-NEXT: ret i8 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test1 +; NOT_CGSCC_NPM-SAME: (i32 [[A:%.*]], i32 [[LENGTH:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[LOOP:%.*]] +; NOT_CGSCC_NPM: loop: +; NOT_CGSCC_NPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] +; NOT_CGSCC_NPM-NEXT: br label [[BACKEDGE]] +; NOT_CGSCC_NPM: backedge: +; NOT_CGSCC_NPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 +; NOT_CGSCC_NPM-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400 +; NOT_CGSCC_NPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT:%.*]] +; NOT_CGSCC_NPM: exit: +; NOT_CGSCC_NPM-NEXT: ret i8 0 ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test1 -; IS__CGSCC_OPM-SAME: (i32 [[A:%.*]], i32 [[LENGTH:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_OPM: loop: -; IS__CGSCC_OPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[CND:%.*]] = icmp sge i32 [[IV]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CND]], label [[BACKEDGE]], label [[EXIT:%.*]] -; IS__CGSCC_OPM: backedge: -; IS__CGSCC_OPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__CGSCC_OPM-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__CGSCC_OPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] -; IS__CGSCC_OPM: exit: -; IS__CGSCC_OPM-NEXT: ret i8 0 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test1 -; IS__CGSCC_NPM-SAME: (i32 [[A:%.*]], i32 [[LENGTH:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_NPM: loop: -; IS__CGSCC_NPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__CGSCC_NPM-NEXT: br label [[BACKEDGE]] -; IS__CGSCC_NPM: backedge: -; IS__CGSCC_NPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__CGSCC_NPM-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__CGSCC_NPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT:%.*]] -; IS__CGSCC_NPM: exit: -; IS__CGSCC_NPM-NEXT: ret i8 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test1 +; NOT_TUNIT_NPM-SAME: (i32 [[A:%.*]], i32 [[LENGTH:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[LOOP:%.*]] +; NOT_TUNIT_NPM: loop: +; NOT_TUNIT_NPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] +; NOT_TUNIT_NPM-NEXT: br label [[BACKEDGE]] +; NOT_TUNIT_NPM: backedge: +; NOT_TUNIT_NPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 +; NOT_TUNIT_NPM-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400 +; NOT_TUNIT_NPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT:%.*]] +; NOT_TUNIT_NPM: exit: +; NOT_TUNIT_NPM-NEXT: ret i8 0 ; entry: br label %loop @@ -85,89 +52,46 @@ } define i8 @test2(i32 %n) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_OPM: loop: -; IS__TUNIT_OPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[IV2:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[IV2_NEXT:%.*]], [[BACKEDGE]] ] -; IS__TUNIT_OPM-NEXT: [[CND1:%.*]] = icmp sge i32 [[IV]], 0 -; IS__TUNIT_OPM-NEXT: [[CND2:%.*]] = icmp sgt i32 [[IV2]], 0 -; IS__TUNIT_OPM-NEXT: [[CND:%.*]] = and i1 [[CND1]], [[CND2]] -; IS__TUNIT_OPM-NEXT: br i1 [[CND]], label [[BACKEDGE]], label [[EXIT:%.*]] -; IS__TUNIT_OPM: backedge: -; IS__TUNIT_OPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__TUNIT_OPM-NEXT: [[IV2_NEXT]] = sub nsw i32 [[IV2]], 1 -; IS__TUNIT_OPM-NEXT: [[CONT1:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__TUNIT_OPM-NEXT: [[CONT2:%.*]] = icmp sgt i32 [[IV2_NEXT]], 0 -; IS__TUNIT_OPM-NEXT: [[CONT:%.*]] = and i1 [[CONT1]], [[CONT2]] -; IS__TUNIT_OPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] -; IS__TUNIT_OPM: exit: -; IS__TUNIT_OPM-NEXT: ret i8 0 -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_NPM: loop: -; IS__TUNIT_NPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[IV2:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[IV2_NEXT:%.*]], [[BACKEDGE]] ] -; IS__TUNIT_NPM-NEXT: [[CND2:%.*]] = icmp sgt i32 [[IV2]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[CND2]], label [[BACKEDGE]], label [[EXIT:%.*]] -; IS__TUNIT_NPM: backedge: -; IS__TUNIT_NPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__TUNIT_NPM-NEXT: [[IV2_NEXT]] = sub nsw i32 [[IV2]], 1 -; IS__TUNIT_NPM-NEXT: [[CONT1:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__TUNIT_NPM-NEXT: [[CONT2:%.*]] = icmp sgt i32 [[IV2_NEXT]], 0 -; IS__TUNIT_NPM-NEXT: [[CONT:%.*]] = and i1 [[CONT1]], [[CONT2]] -; IS__TUNIT_NPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] -; IS__TUNIT_NPM: exit: -; IS__TUNIT_NPM-NEXT: ret i8 0 ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_OPM: loop: -; IS__CGSCC_OPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[IV2:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[IV2_NEXT:%.*]], [[BACKEDGE]] ] -; IS__CGSCC_OPM-NEXT: [[CND1:%.*]] = icmp sge i32 [[IV]], 0 -; IS__CGSCC_OPM-NEXT: [[CND2:%.*]] = icmp sgt i32 [[IV2]], 0 -; IS__CGSCC_OPM-NEXT: [[CND:%.*]] = and i1 [[CND1]], [[CND2]] -; IS__CGSCC_OPM-NEXT: br i1 [[CND]], label [[BACKEDGE]], label [[EXIT:%.*]] -; IS__CGSCC_OPM: backedge: -; IS__CGSCC_OPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__CGSCC_OPM-NEXT: [[IV2_NEXT]] = sub nsw i32 [[IV2]], 1 -; IS__CGSCC_OPM-NEXT: [[CONT1:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__CGSCC_OPM-NEXT: [[CONT2:%.*]] = icmp sgt i32 [[IV2_NEXT]], 0 -; IS__CGSCC_OPM-NEXT: [[CONT:%.*]] = and i1 [[CONT1]], [[CONT2]] -; IS__CGSCC_OPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] -; IS__CGSCC_OPM: exit: -; IS__CGSCC_OPM-NEXT: ret i8 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[LOOP:%.*]] +; NOT_CGSCC_NPM: loop: +; NOT_CGSCC_NPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[IV2:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[IV2_NEXT:%.*]], [[BACKEDGE]] ] +; NOT_CGSCC_NPM-NEXT: [[CND2:%.*]] = icmp sgt i32 [[IV2]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[CND2]], label [[BACKEDGE]], label [[EXIT:%.*]] +; NOT_CGSCC_NPM: backedge: +; NOT_CGSCC_NPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 +; NOT_CGSCC_NPM-NEXT: [[IV2_NEXT]] = sub nsw i32 [[IV2]], 1 +; NOT_CGSCC_NPM-NEXT: [[CONT1:%.*]] = icmp slt i32 [[IV_NEXT]], 400 +; NOT_CGSCC_NPM-NEXT: [[CONT2:%.*]] = icmp sgt i32 [[IV2_NEXT]], 0 +; NOT_CGSCC_NPM-NEXT: [[CONT:%.*]] = and i1 [[CONT1]], [[CONT2]] +; NOT_CGSCC_NPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] +; NOT_CGSCC_NPM: exit: +; NOT_CGSCC_NPM-NEXT: ret i8 0 ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_NPM: loop: -; IS__CGSCC_NPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[IV2:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[IV2_NEXT:%.*]], [[BACKEDGE]] ] -; IS__CGSCC_NPM-NEXT: [[CND2:%.*]] = icmp sgt i32 [[IV2]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[CND2]], label [[BACKEDGE]], label [[EXIT:%.*]] -; IS__CGSCC_NPM: backedge: -; IS__CGSCC_NPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__CGSCC_NPM-NEXT: [[IV2_NEXT]] = sub nsw i32 [[IV2]], 1 -; IS__CGSCC_NPM-NEXT: [[CONT1:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__CGSCC_NPM-NEXT: [[CONT2:%.*]] = icmp sgt i32 [[IV2_NEXT]], 0 -; IS__CGSCC_NPM-NEXT: [[CONT:%.*]] = and i1 [[CONT1]], [[CONT2]] -; IS__CGSCC_NPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] -; IS__CGSCC_NPM: exit: -; IS__CGSCC_NPM-NEXT: ret i8 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[LOOP:%.*]] +; NOT_TUNIT_NPM: loop: +; NOT_TUNIT_NPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[IV2:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[IV2_NEXT:%.*]], [[BACKEDGE]] ] +; NOT_TUNIT_NPM-NEXT: [[CND2:%.*]] = icmp sgt i32 [[IV2]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[CND2]], label [[BACKEDGE]], label [[EXIT:%.*]] +; NOT_TUNIT_NPM: backedge: +; NOT_TUNIT_NPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 +; NOT_TUNIT_NPM-NEXT: [[IV2_NEXT]] = sub nsw i32 [[IV2]], 1 +; NOT_TUNIT_NPM-NEXT: [[CONT1:%.*]] = icmp slt i32 [[IV_NEXT]], 400 +; NOT_TUNIT_NPM-NEXT: [[CONT2:%.*]] = icmp sgt i32 [[IV2_NEXT]], 0 +; NOT_TUNIT_NPM-NEXT: [[CONT:%.*]] = and i1 [[CONT1]], [[CONT2]] +; NOT_TUNIT_NPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] +; NOT_TUNIT_NPM: exit: +; NOT_TUNIT_NPM-NEXT: ret i8 0 ; entry: br label %loop @@ -195,46 +119,26 @@ ; Merging cont block into do block. define i32 @test3(i32 %i, i1 %f, i32 %n) { -; IS________OPM-LABEL: define {{[^@]+}}@test3 -; IS________OPM-SAME: (i32 [[I:%.*]], i1 [[F:%.*]], i32 [[N:%.*]]) { -; IS________OPM-NEXT: entry: -; IS________OPM-NEXT: [[C:%.*]] = icmp ne i32 [[I]], -2134 -; IS________OPM-NEXT: br i1 [[C]], label [[DO:%.*]], label [[EXIT:%.*]] -; IS________OPM: exit: -; IS________OPM-NEXT: [[C1:%.*]] = icmp ne i32 [[I]], -42 -; IS________OPM-NEXT: br i1 [[C1]], label [[EXIT2:%.*]], label [[EXIT]] -; IS________OPM: cont: -; IS________OPM-NEXT: [[COND_3:%.*]] = icmp sgt i32 [[I]], [[N]] -; IS________OPM-NEXT: br i1 [[COND_3]], label [[EXIT2]], label [[EXIT]] -; IS________OPM: do: -; IS________OPM-NEXT: [[COND_0:%.*]] = icmp sgt i32 [[I]], 0 -; IS________OPM-NEXT: [[CONSUME:%.*]] = call i32 @consume(i1 [[COND_0]]) -; IS________OPM-NEXT: [[COND:%.*]] = icmp eq i32 [[I]], 0 -; IS________OPM-NEXT: call void (i1, ...) @llvm.experimental.guard(i1 [[COND]]) [ "deopt"() ] -; IS________OPM-NEXT: [[COND_2:%.*]] = icmp sgt i32 [[I]], 0 -; IS________OPM-NEXT: br i1 [[COND_2]], label [[EXIT]], label [[CONT:%.*]] -; IS________OPM: exit2: -; IS________OPM-NEXT: ret i32 30 ; -; IS________NPM-LABEL: define {{[^@]+}}@test3 -; IS________NPM-SAME: (i32 [[I:%.*]], i1 [[F:%.*]], i32 [[N:%.*]]) { -; IS________NPM-NEXT: entry: -; IS________NPM-NEXT: [[C:%.*]] = icmp ne i32 [[I]], -2134 -; IS________NPM-NEXT: br i1 [[C]], label [[DO:%.*]], label [[EXIT:%.*]] -; IS________NPM: exit: -; IS________NPM-NEXT: [[C1:%.*]] = icmp ne i32 [[I]], -42 -; IS________NPM-NEXT: br i1 [[C1]], label [[EXIT2:%.*]], label [[EXIT]] -; IS________NPM: cont: -; IS________NPM-NEXT: [[COND_3:%.*]] = icmp sgt i32 [[I]], [[N]] -; IS________NPM-NEXT: br i1 [[COND_3]], label [[EXIT2]], label [[EXIT]] -; IS________NPM: do: -; IS________NPM-NEXT: [[COND_0:%.*]] = icmp sgt i32 [[I]], 0 -; IS________NPM-NEXT: [[CONSUME:%.*]] = call i32 @consume(i1 [[COND_0]]) -; IS________NPM-NEXT: [[COND:%.*]] = icmp eq i32 [[I]], 0 -; IS________NPM-NEXT: call void (i1, ...) @llvm.experimental.guard(i1 [[COND]]) [ "deopt"() ] -; IS________NPM-NEXT: br label [[CONT:%.*]] -; IS________NPM: exit2: -; IS________NPM-NEXT: ret i32 30 +; CHECK-LABEL: define {{[^@]+}}@test3 +; CHECK-SAME: (i32 [[I:%.*]], i1 [[F:%.*]], i32 [[N:%.*]]) { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[C:%.*]] = icmp ne i32 [[I]], -2134 +; CHECK-NEXT: br i1 [[C]], label [[DO:%.*]], label [[EXIT:%.*]] +; CHECK: exit: +; CHECK-NEXT: [[C1:%.*]] = icmp ne i32 [[I]], -42 +; CHECK-NEXT: br i1 [[C1]], label [[EXIT2:%.*]], label [[EXIT]] +; CHECK: cont: +; CHECK-NEXT: [[COND_3:%.*]] = icmp sgt i32 [[I]], [[N]] +; CHECK-NEXT: br i1 [[COND_3]], label [[EXIT2]], label [[EXIT]] +; CHECK: do: +; CHECK-NEXT: [[COND_0:%.*]] = icmp sgt i32 [[I]], 0 +; CHECK-NEXT: [[CONSUME:%.*]] = call i32 @consume(i1 [[COND_0]]) +; CHECK-NEXT: [[COND:%.*]] = icmp eq i32 [[I]], 0 +; CHECK-NEXT: call void (i1, ...) @llvm.experimental.guard(i1 [[COND]]) [ "deopt"() ] +; CHECK-NEXT: br label [[CONT:%.*]] +; CHECK: exit2: +; CHECK-NEXT: ret i32 30 ; entry: %c = icmp ne i32 %i, -2134 @@ -315,23 +219,13 @@ declare void @dummy(i1) nounwind declare void @llvm.experimental.guard(i1, ...) ;. -; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone } -; IS__TUNIT_OPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nounwind } -; IS__TUNIT_OPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync willreturn } -;. -; IS__TUNIT_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR2]] = { nounwind } -; IS__TUNIT_NPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC_OPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/lvi-for-ashr.ll b/llvm/test/Transforms/Attributor/lvi-for-ashr.ll --- a/llvm/test/Transforms/Attributor/lvi-for-ashr.ll +++ b/llvm/test/Transforms/Attributor/lvi-for-ashr.ll @@ -1,93 +1,50 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 ; FIXME: DOT should be replaced with 3 define i32 @test-ashr(i32 %c) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test-ashr -; IS__TUNIT_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: chk65: -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] -; IS__TUNIT_OPM: chk0: -; IS__TUNIT_OPM-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] -; IS__TUNIT_OPM: bb_if: -; IS__TUNIT_OPM-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 -; IS__TUNIT_OPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] -; IS__TUNIT_OPM: bb_then: -; IS__TUNIT_OPM-NEXT: [[CMP3:%.*]] = icmp eq i32 [[ASHR_VAL]], 16 -; IS__TUNIT_OPM-NEXT: [[DOT:%.*]] = select i1 [[CMP3]], i32 3, i32 2 -; IS__TUNIT_OPM-NEXT: br label [[RETURN]] -; IS__TUNIT_OPM: return: -; IS__TUNIT_OPM-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[RETVAL]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test-ashr -; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: chk65: -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] -; IS__TUNIT_NPM: chk0: -; IS__TUNIT_NPM-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] -; IS__TUNIT_NPM: bb_if: -; IS__TUNIT_NPM-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 -; IS__TUNIT_NPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] -; IS__TUNIT_NPM: bb_then: -; IS__TUNIT_NPM-NEXT: [[DOT:%.*]] = select i1 true, i32 3, i32 2 -; IS__TUNIT_NPM-NEXT: br label [[RETURN]] -; IS__TUNIT_NPM: return: -; IS__TUNIT_NPM-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[RETVAL]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test-ashr +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: chk65: +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] +; NOT_CGSCC_NPM: chk0: +; NOT_CGSCC_NPM-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] +; NOT_CGSCC_NPM: bb_if: +; NOT_CGSCC_NPM-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 +; NOT_CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] +; NOT_CGSCC_NPM: bb_then: +; NOT_CGSCC_NPM-NEXT: [[DOT:%.*]] = select i1 true, i32 3, i32 2 +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] +; NOT_CGSCC_NPM-NEXT: ret i32 [[RETVAL]] ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test-ashr -; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: chk65: -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] -; IS__CGSCC_OPM: chk0: -; IS__CGSCC_OPM-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] -; IS__CGSCC_OPM: bb_if: -; IS__CGSCC_OPM-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 -; IS__CGSCC_OPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] -; IS__CGSCC_OPM: bb_then: -; IS__CGSCC_OPM-NEXT: [[CMP3:%.*]] = icmp eq i32 [[ASHR_VAL]], 16 -; IS__CGSCC_OPM-NEXT: [[DOT:%.*]] = select i1 [[CMP3]], i32 3, i32 2 -; IS__CGSCC_OPM-NEXT: br label [[RETURN]] -; IS__CGSCC_OPM: return: -; IS__CGSCC_OPM-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[RETVAL]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test-ashr -; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: chk65: -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] -; IS__CGSCC_NPM: chk0: -; IS__CGSCC_NPM-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] -; IS__CGSCC_NPM: bb_if: -; IS__CGSCC_NPM-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 -; IS__CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] -; IS__CGSCC_NPM: bb_then: -; IS__CGSCC_NPM-NEXT: [[DOT:%.*]] = select i1 true, i32 3, i32 2 -; IS__CGSCC_NPM-NEXT: br label [[RETURN]] -; IS__CGSCC_NPM: return: -; IS__CGSCC_NPM-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[RETVAL]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test-ashr +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: chk65: +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] +; NOT_TUNIT_NPM: chk0: +; NOT_TUNIT_NPM-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] +; NOT_TUNIT_NPM: bb_if: +; NOT_TUNIT_NPM-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 +; NOT_TUNIT_NPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] +; NOT_TUNIT_NPM: bb_then: +; NOT_TUNIT_NPM-NEXT: [[DOT:%.*]] = select i1 true, i32 3, i32 2 +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] +; NOT_TUNIT_NPM-NEXT: ret i32 [[RETVAL]] ; chk65: %cmp = icmp sgt i32 %c, 65 @@ -112,7 +69,7 @@ ret i32 %retval } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/memory_locations.ll b/llvm/test/Transforms/Attributor/memory_locations.ll --- a/llvm/test/Transforms/Attributor/memory_locations.ll +++ b/llvm/test/Transforms/Attributor/memory_locations.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=13 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=13 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" @@ -208,19 +206,19 @@ } define dso_local i8* @internal_argmem_only_rec(i32* %arg) { -; IS__TUNIT____: Function Attrs: inaccessiblemem_or_argmemonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@internal_argmem_only_rec -; IS__TUNIT____-SAME: (i32* nocapture nofree [[ARG:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call noalias i8* @internal_argmem_only_rec_1(i32* nocapture nofree align 4 [[ARG]]) -; IS__TUNIT____-NEXT: ret i8* [[CALL]] -; -; IS__CGSCC____: Function Attrs: inaccessiblemem_or_argmemonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@internal_argmem_only_rec -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call noalias i8* @internal_argmem_only_rec_1(i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG]]) -; IS__CGSCC____-NEXT: ret i8* [[CALL]] +; NOT_CGSCC_NPM: Function Attrs: inaccessiblemem_or_argmemonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@internal_argmem_only_rec +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree [[ARG:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call noalias i8* @internal_argmem_only_rec_1(i32* nocapture nofree align 4 [[ARG]]) +; NOT_CGSCC_NPM-NEXT: ret i8* [[CALL]] +; +; NOT_TUNIT_NPM: Function Attrs: inaccessiblemem_or_argmemonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@internal_argmem_only_rec +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call noalias i8* @internal_argmem_only_rec_1(i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG]]) +; NOT_TUNIT_NPM-NEXT: ret i8* [[CALL]] ; entry: %call = call i8* @internal_argmem_only_rec_1(i32* %arg) @@ -228,57 +226,57 @@ } define internal i8* @internal_argmem_only_rec_1(i32* %arg) { -; IS__TUNIT____: Function Attrs: inaccessiblemem_or_argmemonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@internal_argmem_only_rec_1 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TMP:%.*]] = load i32, i32* [[ARG]], align 4 -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP]], 0 -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32, i32* [[ARG]], align 4 -; IS__TUNIT____-NEXT: [[CMP1:%.*]] = icmp eq i32 [[TMP1]], 1 -; IS__TUNIT____-NEXT: br i1 [[CMP1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] -; IS__TUNIT____: if.then2: -; IS__TUNIT____-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 -1 -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call noalias i8* @internal_argmem_only_rec_2(i32* nocapture nofree nonnull align 4 dereferenceable(4) [[ADD_PTR]]) -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: if.end3: -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARG]], align 4 -; IS__TUNIT____-NEXT: [[CONV:%.*]] = sext i32 [[TMP2]] to i64 -; IS__TUNIT____-NEXT: [[CALL4:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i8* [ null, [[IF_THEN]] ], [ [[CALL]], [[IF_THEN2]] ], [ [[CALL4]], [[IF_END3]] ] -; IS__TUNIT____-NEXT: ret i8* [[RETVAL_0]] -; -; IS__CGSCC____: Function Attrs: inaccessiblemem_or_argmemonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@internal_argmem_only_rec_1 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP:%.*]] = load i32, i32* [[ARG]], align 4 -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP]], 0 -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = load i32, i32* [[ARG]], align 4 -; IS__CGSCC____-NEXT: [[CMP1:%.*]] = icmp eq i32 [[TMP1]], 1 -; IS__CGSCC____-NEXT: br i1 [[CMP1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] -; IS__CGSCC____: if.then2: -; IS__CGSCC____-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 -1 -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call noalias i8* @internal_argmem_only_rec_2(i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ADD_PTR]]) -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: if.end3: -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARG]], align 4 -; IS__CGSCC____-NEXT: [[CONV:%.*]] = sext i32 [[TMP2]] to i64 -; IS__CGSCC____-NEXT: [[CALL4:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i8* [ null, [[IF_THEN]] ], [ [[CALL]], [[IF_THEN2]] ], [ [[CALL4]], [[IF_END3]] ] -; IS__CGSCC____-NEXT: ret i8* [[RETVAL_0]] +; NOT_CGSCC_NPM: Function Attrs: inaccessiblemem_or_argmemonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@internal_argmem_only_rec_1 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = load i32, i32* [[ARG]], align 4 +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[ARG]], align 4 +; NOT_CGSCC_NPM-NEXT: [[CMP1:%.*]] = icmp eq i32 [[TMP1]], 1 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] +; NOT_CGSCC_NPM: if.then2: +; NOT_CGSCC_NPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 -1 +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call noalias i8* @internal_argmem_only_rec_2(i32* nocapture nofree nonnull align 4 dereferenceable(4) [[ADD_PTR]]) +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: if.end3: +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARG]], align 4 +; NOT_CGSCC_NPM-NEXT: [[CONV:%.*]] = sext i32 [[TMP2]] to i64 +; NOT_CGSCC_NPM-NEXT: [[CALL4:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i8* [ null, [[IF_THEN]] ], [ [[CALL]], [[IF_THEN2]] ], [ [[CALL4]], [[IF_END3]] ] +; NOT_CGSCC_NPM-NEXT: ret i8* [[RETVAL_0]] +; +; NOT_TUNIT_NPM: Function Attrs: inaccessiblemem_or_argmemonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@internal_argmem_only_rec_1 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = load i32, i32* [[ARG]], align 4 +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[ARG]], align 4 +; NOT_TUNIT_NPM-NEXT: [[CMP1:%.*]] = icmp eq i32 [[TMP1]], 1 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] +; NOT_TUNIT_NPM: if.then2: +; NOT_TUNIT_NPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 -1 +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call noalias i8* @internal_argmem_only_rec_2(i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ADD_PTR]]) +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: if.end3: +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARG]], align 4 +; NOT_TUNIT_NPM-NEXT: [[CONV:%.*]] = sext i32 [[TMP2]] to i64 +; NOT_TUNIT_NPM-NEXT: [[CALL4:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: [[RETVAL_0:%.*]] = phi i8* [ null, [[IF_THEN]] ], [ [[CALL]], [[IF_THEN2]] ], [ [[CALL4]], [[IF_END3]] ] +; NOT_TUNIT_NPM-NEXT: ret i8* [[RETVAL_0]] ; entry: %tmp = load i32, i32* %arg, align 4 @@ -417,15 +415,15 @@ } define void @callerE(i8* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@callerE -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callerE +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@callerE -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callerE +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret void ; call void @llvm.lifetime.start.p0i8(i64 4, i8* %arg) ret void @@ -433,82 +431,82 @@ define void @write_global() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@write_global -; IS__TUNIT____-SAME: () #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: store i32 0, i32* @G, align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_global -; IS__CGSCC____-SAME: () #[[ATTR6:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 0, i32* @G, align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@write_global +; NOT_CGSCC_NPM-SAME: () #[[ATTR6:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* @G, align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@write_global +; NOT_TUNIT_NPM-SAME: () #[[ATTR6:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* @G, align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32 0, i32* @G, align 4 ret void } define void @write_global_via_arg(i32* %GPtr) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@write_global_via_arg -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[GPTR:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__TUNIT____-NEXT: store i32 0, i32* [[GPTR]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_global_via_arg -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[GPTR:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 0, i32* [[GPTR]], align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@write_global_via_arg +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[GPTR:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[GPTR]], align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@write_global_via_arg +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[GPTR:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[GPTR]], align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32 0, i32* %GPtr, align 4 ret void } define internal void @write_global_via_arg_internal(i32* %GPtr) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@write_global_via_arg_internal -; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: store i32 0, i32* @G, align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_global_via_arg_internal -; IS__CGSCC____-SAME: () #[[ATTR6]] { -; IS__CGSCC____-NEXT: store i32 0, i32* @G, align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@write_global_via_arg_internal +; NOT_CGSCC_NPM-SAME: () #[[ATTR6]] { +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* @G, align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@write_global_via_arg_internal +; NOT_TUNIT_NPM-SAME: () #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* @G, align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32 0, i32* %GPtr, align 4 ret void } define void @writeonly_global() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@writeonly_global -; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: call void @write_global() #[[ATTR6]] -; 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() #[[ATTR10:[0-9]+]] -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@writeonly_global +; NOT_CGSCC_NPM-SAME: () #[[ATTR6]] { +; NOT_CGSCC_NPM-NEXT: call void @write_global() #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@writeonly_global +; NOT_TUNIT_NPM-SAME: () #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: call void @write_global() #[[ATTR10:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @write_global() ret void } define void @writeonly_global_via_arg() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@writeonly_global_via_arg -; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: call void @write_global_via_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR6]] -; IS__TUNIT____-NEXT: 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) #[[ATTR10]] -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@writeonly_global_via_arg +; NOT_CGSCC_NPM-SAME: () #[[ATTR6]] { +; NOT_CGSCC_NPM-NEXT: call void @write_global_via_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@writeonly_global_via_arg +; NOT_TUNIT_NPM-SAME: () #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: call void @write_global_via_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR10]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @write_global_via_arg(i32* @G) ret void @@ -516,46 +514,46 @@ define void @writeonly_global_via_arg_internal() { ; -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@writeonly_global_via_arg_internal -; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: call void @write_global_via_arg_internal() #[[ATTR6]] -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@writeonly_global_via_arg_internal +; NOT_CGSCC_NPM-SAME: () #[[ATTR6]] { +; NOT_CGSCC_NPM-NEXT: call void @write_global_via_arg_internal() #[[ATTR6]] +; NOT_CGSCC_NPM-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() #[[ATTR10]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@writeonly_global_via_arg_internal +; NOT_TUNIT_NPM-SAME: () #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: call void @write_global_via_arg_internal() #[[ATTR10]] +; NOT_TUNIT_NPM-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) #[[ATTR10:[0-9]+]], !range [[RNG0:![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) #[[ATTR11:[0-9]+]], !range [[RNG0:![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 +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_not_readnone +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR10:[0-9]+]], !range [[RNG0:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i8 1 +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: store i8 1, i8* [[PTR]], align 1 +; NOT_CGSCC_NPM-NEXT: ret i8 0 +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@recursive_not_readnone +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11:[0-9]+]], !range [[RNG0:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i8 1 +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: store i8 1, i8* [[PTR]], align 1 +; NOT_TUNIT_NPM-NEXT: ret i8 0 ; %alloc = alloca i8 br i1 %c, label %t, label %f @@ -569,29 +567,29 @@ } define internal i8 @recursive_not_readnone_internal(i8* %ptr, i1 %c) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_not_readnone_internal -; IS__TUNIT____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { -; IS__TUNIT____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR10]], !range [[RNG0]] -; 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_internal -; IS__CGSCC____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { -; IS__CGSCC____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]], !range [[RNG0]] -; 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 +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_not_readnone_internal +; NOT_CGSCC_NPM-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; NOT_CGSCC_NPM-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR10]], !range [[RNG0]] +; NOT_CGSCC_NPM-NEXT: ret i8 1 +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: store i8 1, i8* [[PTR]], align 1 +; NOT_CGSCC_NPM-NEXT: ret i8 0 +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@recursive_not_readnone_internal +; NOT_TUNIT_NPM-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; NOT_TUNIT_NPM-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]], !range [[RNG0]] +; NOT_TUNIT_NPM-NEXT: ret i8 1 +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: store i8 1, i8* [[PTR]], align 1 +; NOT_TUNIT_NPM-NEXT: ret i8 0 ; %alloc = alloca i8 br i1 %c, label %t, label %f @@ -605,19 +603,19 @@ } define i8 @readnone_caller(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@readnone_caller -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = alloca i8, align 1 -; IS__TUNIT____-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 [[C]]) #[[ATTR10]], !range [[RNG0]] -; IS__TUNIT____-NEXT: ret i8 [[R]] -; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@readnone_caller -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = alloca i8, align 1 -; IS__CGSCC____-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 [[C]]) #[[ATTR12:[0-9]+]], !range [[RNG0]] -; IS__CGSCC____-NEXT: ret i8 [[R]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@readnone_caller +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = alloca i8, align 1 +; NOT_CGSCC_NPM-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 [[C]]) #[[ATTR10]], !range [[RNG0]] +; NOT_CGSCC_NPM-NEXT: ret i8 [[R]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@readnone_caller +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = alloca i8, align 1 +; NOT_TUNIT_NPM-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 [[C]]) #[[ATTR12:[0-9]+]], !range [[RNG0]] +; NOT_TUNIT_NPM-NEXT: ret i8 [[R]] ; %a = alloca i8 %r = call i8 @recursive_not_readnone_internal(i8* %a, i1 %c) @@ -625,29 +623,29 @@ } define internal i8 @recursive_readnone_internal2(i8* %ptr, i1 %c) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_readnone_internal2 -; IS__TUNIT____-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { -; IS__TUNIT____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR10]], !range [[RNG0]] -; 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_readnone_internal2 -; IS__CGSCC____-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { -; IS__CGSCC____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]], !range [[RNG0]] -; 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 +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_readnone_internal2 +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; NOT_CGSCC_NPM-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR10]], !range [[RNG0]] +; NOT_CGSCC_NPM-NEXT: ret i8 1 +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: store i8 1, i8* [[PTR]], align 1 +; NOT_CGSCC_NPM-NEXT: ret i8 0 +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@recursive_readnone_internal2 +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; NOT_TUNIT_NPM-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]], !range [[RNG0]] +; NOT_TUNIT_NPM-NEXT: ret i8 1 +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: store i8 1, i8* [[PTR]], align 1 +; NOT_TUNIT_NPM-NEXT: ret i8 0 ; %alloc = alloca i8 br i1 %c, label %t, label %f @@ -661,46 +659,46 @@ } define i8 @readnone_caller2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@readnone_caller2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { -; IS__TUNIT____-NEXT: [[R:%.*]] = call noundef i8 @recursive_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR10]], !range [[RNG0]] -; IS__TUNIT____-NEXT: ret i8 [[R]] -; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@readnone_caller2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { -; IS__CGSCC____-NEXT: [[R:%.*]] = call noundef i8 @recursive_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR12]], !range [[RNG0]] -; IS__CGSCC____-NEXT: ret i8 [[R]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@readnone_caller2 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { +; NOT_CGSCC_NPM-NEXT: [[R:%.*]] = call noundef i8 @recursive_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR10]], !range [[RNG0]] +; NOT_CGSCC_NPM-NEXT: ret i8 [[R]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@readnone_caller2 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { +; NOT_TUNIT_NPM-NEXT: [[R:%.*]] = call noundef i8 @recursive_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR12]], !range [[RNG0]] +; NOT_TUNIT_NPM-NEXT: ret i8 [[R]] ; %r = call i8 @recursive_readnone_internal2(i8* undef, i1 %c) ret i8 %r } define internal i8 @recursive_not_readnone_internal3(i8* %ptr, i1 %c) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_not_readnone_internal3 -; IS__TUNIT____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { -; IS__TUNIT____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR10]], !range [[RNG0]] -; 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_internal3 -; IS__CGSCC____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { -; IS__CGSCC____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]], !range [[RNG0]] -; 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 +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_not_readnone_internal3 +; NOT_CGSCC_NPM-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; NOT_CGSCC_NPM-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR10]], !range [[RNG0]] +; NOT_CGSCC_NPM-NEXT: ret i8 1 +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: store i8 1, i8* [[PTR]], align 1 +; NOT_CGSCC_NPM-NEXT: ret i8 0 +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@recursive_not_readnone_internal3 +; NOT_TUNIT_NPM-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; NOT_TUNIT_NPM-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]], !range [[RNG0]] +; NOT_TUNIT_NPM-NEXT: ret i8 1 +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: store i8 1, i8* [[PTR]], align 1 +; NOT_TUNIT_NPM-NEXT: ret i8 0 ; %alloc = alloca i8 br i1 %c, label %t, label %f @@ -714,19 +712,19 @@ } define i8 @readnone_caller3(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@readnone_caller3 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { -; IS__TUNIT____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 -; IS__TUNIT____-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 [[C]]) #[[ATTR10]], !range [[RNG0]] -; IS__TUNIT____-NEXT: ret i8 [[R]] -; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@readnone_caller3 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { -; IS__CGSCC____-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 -; IS__CGSCC____-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 [[C]]) #[[ATTR12]], !range [[RNG0]] -; IS__CGSCC____-NEXT: ret i8 [[R]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@readnone_caller3 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { +; NOT_CGSCC_NPM-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; NOT_CGSCC_NPM-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 [[C]]) #[[ATTR10]], !range [[RNG0]] +; NOT_CGSCC_NPM-NEXT: ret i8 [[R]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@readnone_caller3 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { +; NOT_TUNIT_NPM-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; NOT_TUNIT_NPM-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 [[C]]) #[[ATTR12]], !range [[RNG0]] +; NOT_TUNIT_NPM-NEXT: ret i8 [[R]] ; %alloc = alloca i8 %r = call i8 @recursive_not_readnone_internal3(i8* %alloc, i1 %c) @@ -734,64 +732,64 @@ } define internal void @argmemonly_before_ipconstprop(i32* %p) argmemonly { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@argmemonly_before_ipconstprop -; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: store i32 0, i32* @G, align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@argmemonly_before_ipconstprop -; IS__CGSCC____-SAME: () #[[ATTR6]] { -; IS__CGSCC____-NEXT: store i32 0, i32* @G, align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@argmemonly_before_ipconstprop +; NOT_CGSCC_NPM-SAME: () #[[ATTR6]] { +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* @G, align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@argmemonly_before_ipconstprop +; NOT_TUNIT_NPM-SAME: () #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* @G, align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32 0, i32* %p ret void } define void @argmemonky_caller() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@argmemonky_caller -; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: call void @argmemonly_before_ipconstprop() #[[ATTR6]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@argmemonky_caller -; IS__CGSCC____-SAME: () #[[ATTR6]] { -; IS__CGSCC____-NEXT: call void @argmemonly_before_ipconstprop() #[[ATTR10]] -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@argmemonky_caller +; NOT_CGSCC_NPM-SAME: () #[[ATTR6]] { +; NOT_CGSCC_NPM-NEXT: call void @argmemonly_before_ipconstprop() #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@argmemonky_caller +; NOT_TUNIT_NPM-SAME: () #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: call void @argmemonly_before_ipconstprop() #[[ATTR10]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @argmemonly_before_ipconstprop(i32* @G) ret void } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { inaccessiblememonly } -; IS__TUNIT____: attributes #[[ATTR1]] = { inaccessiblemem_or_argmemonly } -; IS__TUNIT____: attributes #[[ATTR2]] = { readnone } -; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly } -; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR5]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR7]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR8]] = { argmemonly nofree nosync nounwind writeonly } -; IS__TUNIT____: attributes #[[ATTR9]] = { nofree nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR10]] = { nofree nosync nounwind writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { inaccessiblememonly } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { inaccessiblemem_or_argmemonly } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { argmemonly } +; NOT_CGSCC_NPM: attributes #[[ATTR4:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { argmemonly nofree nosync nounwind writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { nofree nosync nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR10]] = { nofree nosync nounwind writeonly } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { inaccessiblememonly } -; IS__CGSCC____: attributes #[[ATTR1]] = { inaccessiblemem_or_argmemonly } -; 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 #[[ATTR6]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR7]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR8]] = { argmemonly nofree nosync nounwind writeonly } -; IS__CGSCC____: attributes #[[ATTR9]] = { nofree nosync nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR10]] = { nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR11]] = { nofree nosync nounwind writeonly } -; IS__CGSCC____: attributes #[[ATTR12]] = { nounwind writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { inaccessiblememonly } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { inaccessiblemem_or_argmemonly } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly } +; NOT_TUNIT_NPM: attributes #[[ATTR4:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR7]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR8]] = { argmemonly nofree nosync nounwind writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR9]] = { nofree nosync nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR10]] = { nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR11]] = { nofree nosync nounwind writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR12]] = { nounwind writeonly } ;. ; CHECK: [[META0:![0-9]+]] = !{i8 0, i8 2} ;. diff --git a/llvm/test/Transforms/Attributor/misc.ll b/llvm/test/Transforms/Attributor/misc.ll --- a/llvm/test/Transforms/Attributor/misc.ll +++ b/llvm/test/Transforms/Attributor/misc.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=3 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -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 ; ; Mostly check we do not crash on these uses @@ -9,32 +7,32 @@ define internal void @internal(void (i8*)* %fp) { ; ; -; IS__TUNIT____-LABEL: define {{[^@]+}}@internal -; IS__TUNIT____-SAME: (void (i8*)* nonnull [[FP:%.*]]) { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: call void @foo(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1:[0-9]+]] -; IS__TUNIT____-NEXT: call void [[FP]](i8* bitcast (void (i32*)* @foo to i8*)) -; IS__TUNIT____-NEXT: call void @callback1(void (i32*)* noundef nonnull @foo) -; IS__TUNIT____-NEXT: call void @callback2(void (i8*)* noundef bitcast (void (i32*)* @foo to void (i8*)*)) -; IS__TUNIT____-NEXT: call void @callback2(void (i8*)* nonnull [[FP]]) -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8* -; IS__TUNIT____-NEXT: call void [[FP]](i8* [[TMP1]]) -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@internal +; NOT_CGSCC_NPM-SAME: (void (i8*)* nonnull [[FP:%.*]]) { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: call void @foo(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: call void [[FP]](i8* bitcast (void (i32*)* @foo to i8*)) +; NOT_CGSCC_NPM-NEXT: call void @callback1(void (i32*)* noundef nonnull @foo) +; NOT_CGSCC_NPM-NEXT: call void @callback2(void (i8*)* noundef bitcast (void (i32*)* @foo to void (i8*)*)) +; NOT_CGSCC_NPM-NEXT: call void @callback2(void (i8*)* nonnull [[FP]]) +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8* +; NOT_CGSCC_NPM-NEXT: call void [[FP]](i8* [[TMP1]]) +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@internal -; IS__CGSCC____-SAME: (void (i8*)* noundef nonnull [[FP:%.*]]) { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: [[TMP:%.*]] = bitcast i32* [[A]] to i8* -; IS__CGSCC____-NEXT: call void @foo(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1:[0-9]+]] -; IS__CGSCC____-NEXT: call void [[FP]](i8* bitcast (void (i32*)* @foo to i8*)) -; IS__CGSCC____-NEXT: call void @callback1(void (i32*)* noundef nonnull @foo) -; IS__CGSCC____-NEXT: call void @callback2(void (i8*)* noundef bitcast (void (i32*)* @foo to void (i8*)*)) -; IS__CGSCC____-NEXT: call void @callback2(void (i8*)* noundef nonnull [[FP]]) -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8* -; IS__CGSCC____-NEXT: call void [[FP]](i8* [[TMP1]]) -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@internal +; NOT_TUNIT_NPM-SAME: (void (i8*)* noundef nonnull [[FP:%.*]]) { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = bitcast i32* [[A]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @foo(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: call void [[FP]](i8* bitcast (void (i32*)* @foo to i8*)) +; NOT_TUNIT_NPM-NEXT: call void @callback1(void (i32*)* noundef nonnull @foo) +; NOT_TUNIT_NPM-NEXT: call void @callback2(void (i8*)* noundef bitcast (void (i32*)* @foo to void (i8*)*)) +; NOT_TUNIT_NPM-NEXT: call void @callback2(void (i8*)* noundef nonnull [[FP]]) +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8* +; NOT_TUNIT_NPM-NEXT: call void [[FP]](i8* [[TMP1]]) +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %a = alloca i32, align 4 @@ -52,33 +50,33 @@ define void @external(void (i8*)* %fp) { ; ; -; IS__TUNIT____-LABEL: define {{[^@]+}}@external -; IS__TUNIT____-SAME: (void (i8*)* [[FP:%.*]]) { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: call void @foo(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: call void @callback1(void (i32*)* noundef nonnull @foo) -; IS__TUNIT____-NEXT: call void @callback2(void (i8*)* noundef bitcast (void (i32*)* @foo to void (i8*)*)) -; IS__TUNIT____-NEXT: call void @callback2(void (i8*)* [[FP]]) -; IS__TUNIT____-NEXT: call void [[FP]](i8* bitcast (void (i32*)* @foo to i8*)) -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8* -; IS__TUNIT____-NEXT: call void [[FP]](i8* [[TMP1]]) -; IS__TUNIT____-NEXT: call void @internal(void (i8*)* nonnull [[FP]]) -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@external +; NOT_CGSCC_NPM-SAME: (void (i8*)* [[FP:%.*]]) { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: call void @foo(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1]] +; NOT_CGSCC_NPM-NEXT: call void @callback1(void (i32*)* noundef nonnull @foo) +; NOT_CGSCC_NPM-NEXT: call void @callback2(void (i8*)* noundef bitcast (void (i32*)* @foo to void (i8*)*)) +; NOT_CGSCC_NPM-NEXT: call void @callback2(void (i8*)* [[FP]]) +; NOT_CGSCC_NPM-NEXT: call void [[FP]](i8* bitcast (void (i32*)* @foo to i8*)) +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8* +; NOT_CGSCC_NPM-NEXT: call void [[FP]](i8* [[TMP1]]) +; NOT_CGSCC_NPM-NEXT: call void @internal(void (i8*)* nonnull [[FP]]) +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@external -; IS__CGSCC____-SAME: (void (i8*)* [[FP:%.*]]) { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: call void @foo(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1]] -; IS__CGSCC____-NEXT: call void @callback1(void (i32*)* noundef nonnull @foo) -; IS__CGSCC____-NEXT: call void @callback2(void (i8*)* noundef bitcast (void (i32*)* @foo to void (i8*)*)) -; IS__CGSCC____-NEXT: call void @callback2(void (i8*)* [[FP]]) -; IS__CGSCC____-NEXT: call void [[FP]](i8* bitcast (void (i32*)* @foo to i8*)) -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8* -; IS__CGSCC____-NEXT: call void [[FP]](i8* [[TMP1]]) -; IS__CGSCC____-NEXT: call void @internal(void (i8*)* noundef nonnull [[FP]]) -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@external +; NOT_TUNIT_NPM-SAME: (void (i8*)* [[FP:%.*]]) { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: call void @foo(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1]] +; NOT_TUNIT_NPM-NEXT: call void @callback1(void (i32*)* noundef nonnull @foo) +; NOT_TUNIT_NPM-NEXT: call void @callback2(void (i8*)* noundef bitcast (void (i32*)* @foo to void (i8*)*)) +; NOT_TUNIT_NPM-NEXT: call void @callback2(void (i8*)* [[FP]]) +; NOT_TUNIT_NPM-NEXT: call void [[FP]](i8* bitcast (void (i32*)* @foo to i8*)) +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8* +; NOT_TUNIT_NPM-NEXT: call void [[FP]](i8* [[TMP1]]) +; NOT_TUNIT_NPM-NEXT: call void @internal(void (i8*)* noundef nonnull [[FP]]) +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %a = alloca i32, align 4 @@ -96,19 +94,19 @@ define internal void @foo(i32* %a) { ; -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[A]], align 4 +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[A]], align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; entry: store i32 0, i32* %a @@ -118,9 +116,9 @@ declare void @callback1(void (i32*)*) declare void @callback2(void (i8*)*) ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn writeonly } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR1]] = { nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nounwind willreturn writeonly } ;. diff --git a/llvm/test/Transforms/Attributor/misc_crash.ll b/llvm/test/Transforms/Attributor/misc_crash.ll --- a/llvm/test/Transforms/Attributor/misc_crash.ll +++ b/llvm/test/Transforms/Attributor/misc_crash.ll @@ -1,5 +1,4 @@ ; 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 -S %s | FileCheck %s ; RUN: opt -passes=attributor -S %s | FileCheck %s @var1 = internal global [1 x i32] undef diff --git a/llvm/test/Transforms/Attributor/noalias.ll b/llvm/test/Transforms/Attributor/noalias.ll --- a/llvm/test/Transforms/Attributor/noalias.ll +++ b/llvm/test/Transforms/Attributor/noalias.ll @@ -1,8 +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 ; TODO: The old pass manager cgscc run is disabled as it causes a crash on windows which is under investigation: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/25479/steps/test-check-all/logs/FAIL%3A%20LLVM%3A%3Anoalias.ll -; 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 1 - negative. @@ -51,10 +49,10 @@ ; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree readnone [[A:%.*]]) #[[ATTR0:[0-9]+]] { ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nocapture -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@nocapture +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree readnone [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret void ; ret void } @@ -154,10 +152,10 @@ ; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { ; NOT_CGSCC_NPM-NEXT: ret i8** @G ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@getter -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i8** @G +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@getter +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i8** @G ; ret i8** @G } @@ -169,10 +167,10 @@ ; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { ; NOT_CGSCC_NPM-NEXT: ret i8** @G ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@calle1 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i8** @G +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@calle1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i8** @G ; %1 = call i8** @getter() ret i8** %1 @@ -414,27 +412,16 @@ } define void @test12_4(){ -; IS________OPM-LABEL: define {{[^@]+}}@test12_4() { -; IS________OPM-NEXT: [[A:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: [[B:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: [[A_0:%.*]] = getelementptr i8, i8* [[A]], i64 0 -; IS________OPM-NEXT: [[A_1:%.*]] = getelementptr i8, i8* [[A]], i64 1 -; IS________OPM-NEXT: [[B_0:%.*]] = getelementptr i8, i8* [[B]], i64 0 -; IS________OPM-NEXT: tail call void @two_args(i8* nocapture [[A]], i8* nocapture [[B]]) -; IS________OPM-NEXT: tail call void @two_args(i8* nocapture [[A]], i8* nocapture [[A_0]]) -; IS________OPM-NEXT: tail call void @two_args(i8* nocapture [[A]], i8* nocapture [[A_1]]) -; IS________OPM-NEXT: tail call void @two_args(i8* nocapture [[A_0]], i8* nocapture [[B_0]]) -; IS________OPM-NEXT: ret void -; -; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@test12_4() { -; NOT_TUNIT_OPM-NEXT: [[A:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; NOT_TUNIT_OPM-NEXT: [[B:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; NOT_TUNIT_OPM-NEXT: [[A_1:%.*]] = getelementptr i8, i8* [[A]], i64 1 -; NOT_TUNIT_OPM-NEXT: tail call void @two_args(i8* noalias nocapture [[A]], i8* noalias nocapture [[B]]) -; NOT_TUNIT_OPM-NEXT: tail call void @two_args(i8* nocapture [[A]], i8* nocapture [[A]]) -; NOT_TUNIT_OPM-NEXT: tail call void @two_args(i8* nocapture [[A]], i8* nocapture [[A_1]]) -; NOT_TUNIT_OPM-NEXT: tail call void @two_args(i8* nocapture [[A]], i8* nocapture [[B]]) -; NOT_TUNIT_OPM-NEXT: ret void +; +; CHECK-LABEL: define {{[^@]+}}@test12_4() { +; CHECK-NEXT: [[A:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) +; CHECK-NEXT: [[B:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) +; CHECK-NEXT: [[A_1:%.*]] = getelementptr i8, i8* [[A]], i64 1 +; CHECK-NEXT: tail call void @two_args(i8* noalias nocapture [[A]], i8* noalias nocapture [[B]]) +; CHECK-NEXT: tail call void @two_args(i8* nocapture [[A]], i8* nocapture [[A]]) +; CHECK-NEXT: tail call void @two_args(i8* nocapture [[A]], i8* nocapture [[A_1]]) +; CHECK-NEXT: tail call void @two_args(i8* nocapture [[A]], i8* nocapture [[B]]) +; CHECK-NEXT: ret void ; %A = tail call noalias i8* @malloc(i64 4) %B = tail call noalias i8* @malloc(i64 4) @@ -465,24 +452,12 @@ } define void @test13_use_noalias(){ -; IS________OPM-LABEL: define {{[^@]+}}@test13_use_noalias() { -; IS________OPM-NEXT: [[M1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: [[C1:%.*]] = bitcast i8* [[M1]] to i16* -; IS________OPM-NEXT: [[C2:%.*]] = bitcast i16* [[C1]] to i8* -; IS________OPM-NEXT: call void @use_i8_internal(i8* noalias nocapture [[C2]]) -; IS________OPM-NEXT: ret void -; -; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@test13_use_noalias() { -; NOT_TUNIT_OPM-NEXT: [[M1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; NOT_TUNIT_OPM-NEXT: call void @use_i8_internal(i8* noalias nocapture [[M1]]) -; NOT_TUNIT_OPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13_use_noalias() -; IS__CGSCC_OPM-NEXT: [[M1:%.*]] = tail call noalias i8* @malloc(i64 4) -; IS__CGSCC_OPM-NEXT: [[C1:%.*]] = bitcast i8* [[M1]] to i16* -; IS__CGSCC_OPM-NEXT: [[C2:%.*]] = bitcast i16* [[C1]] to i8* -; IS__CGSCC_OPM-NEXT: call void @use_i8_internal(i8* noalias [[C2]]) -; IS__CGSCC_OPM-NEXT: ret void +; +; CHECK-LABEL: define {{[^@]+}}@test13_use_noalias() { +; CHECK-NEXT: [[M1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) +; CHECK-NEXT: call void @use_i8_internal(i8* noalias nocapture [[M1]]) +; CHECK-NEXT: ret void +; %m1 = tail call noalias i8* @malloc(i64 4) %c1 = bitcast i8* %m1 to i16* %c2 = bitcast i16* %c1 to i8* @@ -491,20 +466,12 @@ } define void @test13_use_alias(){ -; IS________OPM-LABEL: define {{[^@]+}}@test13_use_alias() { -; IS________OPM-NEXT: [[M1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: [[C1:%.*]] = bitcast i8* [[M1]] to i16* -; IS________OPM-NEXT: [[C2A:%.*]] = bitcast i16* [[C1]] to i8* -; IS________OPM-NEXT: [[C2B:%.*]] = bitcast i16* [[C1]] to i8* -; IS________OPM-NEXT: call void @use_i8_internal(i8* nocapture [[C2A]]) -; IS________OPM-NEXT: call void @use_i8_internal(i8* nocapture [[C2B]]) -; IS________OPM-NEXT: ret void -; -; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@test13_use_alias() { -; NOT_TUNIT_OPM-NEXT: [[M1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; NOT_TUNIT_OPM-NEXT: call void @use_i8_internal(i8* nocapture [[M1]]) -; NOT_TUNIT_OPM-NEXT: call void @use_i8_internal(i8* nocapture [[M1]]) -; NOT_TUNIT_OPM-NEXT: ret void +; +; CHECK-LABEL: define {{[^@]+}}@test13_use_alias() { +; CHECK-NEXT: [[M1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) +; CHECK-NEXT: call void @use_i8_internal(i8* nocapture [[M1]]) +; CHECK-NEXT: call void @use_i8_internal(i8* nocapture [[M1]]) +; CHECK-NEXT: ret void ; %m1 = tail call noalias i8* @malloc(i64 4) %c1 = bitcast i8* %m1 to i16* @@ -523,11 +490,11 @@ ; NOT_CGSCC_NPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[ARG]] to i32 ; NOT_CGSCC_NPM-NEXT: ret i32 [[P2I]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@p2i -; IS__CGSCC____-SAME: (i32* noalias nofree readnone [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[P2I:%.*]] = ptrtoint i32* [[ARG]] to i32 -; IS__CGSCC____-NEXT: ret i32 [[P2I]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@p2i +; NOT_TUNIT_NPM-SAME: (i32* noalias nofree readnone [[ARG:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[ARG]] to i32 +; NOT_TUNIT_NPM-NEXT: ret i32 [[P2I]] ; %p2i = ptrtoint i32* %arg to i32 ret i32 %p2i @@ -543,14 +510,14 @@ ; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32 @ret(i32* nocapture nofree readonly align 4 [[BC]]) #[[ATTR4]] ; NOT_CGSCC_NPM-NEXT: ret i32 [[CALL]] ; -; 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]]) #[[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]]) #[[ATTR11:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 [[CALL]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@i2p +; NOT_TUNIT_NPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = call i32 @p2i(i32* noalias nofree readnone [[ARG]]) #[[ATTR10:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[I2P:%.*]] = inttoptr i32 [[C]] to i8* +; NOT_TUNIT_NPM-NEXT: [[BC:%.*]] = bitcast i8* [[I2P]] to i32* +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32 @ret(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[BC]]) #[[ATTR11:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[CALL]] ; %c = call i32 @p2i(i32* %arg) %i2p = inttoptr i32 %c to i8* @@ -565,11 +532,11 @@ ; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[ARG]], align 4 ; NOT_CGSCC_NPM-NEXT: ret i32 [[L]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* [[ARG]], align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ret +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* [[ARG]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 [[L]] ; %l = load i32, i32* %arg ret i32 %l @@ -597,17 +564,17 @@ ; 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]] +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@strtox +; NOT_TUNIT_NPM-SAME: (i8* [[S:%.*]]) unnamed_addr { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8 +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = bitcast %struct._IO_FILE* [[F]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) #[[ATTR12:[0-9]+]] +; NOT_TUNIT_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_TUNIT_NPM-NEXT: call void @__shlim(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0) +; NOT_TUNIT_NPM-NEXT: [[CALL1:%.*]] = call double @__floatscan(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1) +; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) +; NOT_TUNIT_NPM-NEXT: ret double [[CALL1]] ; entry: %f = alloca %struct._IO_FILE, align 8 @@ -661,11 +628,11 @@ ; NOT_CGSCC_NPM-NEXT: store i32* [[P]], i32** @alias_of_p, align 8 ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@make_alias -; IS__CGSCC____-SAME: (i32* nofree writeonly [[P:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32* [[P]], i32** @alias_of_p, align 8 -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@make_alias +; NOT_TUNIT_NPM-SAME: (i32* nofree writeonly [[P:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: store i32* [[P]], i32** @alias_of_p, align 8 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32* %p, i32** @alias_of_p ret void @@ -678,11 +645,11 @@ ; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[P]], align 4 ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@only_store -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 0, i32* [[P]], align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@only_store +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[P]], align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32 0, i32* %p ret void @@ -701,17 +668,17 @@ ; NOT_CGSCC_NPM-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR7]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test15_caller -; IS__CGSCC____-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { -; 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]]) #[[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]]) #[[ATTR13]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test15_caller +; NOT_TUNIT_NPM-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; NOT_TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: tail call void @only_store(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: br label [[IF_END]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR13]] +; NOT_TUNIT_NPM-NEXT: ret void ; %tobool = icmp eq i32 %c, 0 br i1 %tobool, label %if.end, label %if.then @@ -764,23 +731,23 @@ ; NOT_CGSCC_NPM: if.end3: ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test16_sub -; IS__CGSCC____-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C1:%.*]], i32 [[C2:%.*]]) #[[ATTR7]] { -; 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]]) #[[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]]) #[[ATTR13]] -; IS__CGSCC____-NEXT: br label [[IF_END3]] -; IS__CGSCC____: if.end3: -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test16_sub +; NOT_TUNIT_NPM-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C1:%.*]], i32 [[C2:%.*]]) #[[ATTR7]] { +; NOT_TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C1]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: tail call void @only_store(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; NOT_TUNIT_NPM-NEXT: tail call void @make_alias(i32* nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; NOT_TUNIT_NPM-NEXT: br label [[IF_END]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C2]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] +; NOT_TUNIT_NPM: if.then2: +; NOT_TUNIT_NPM-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; NOT_TUNIT_NPM-NEXT: br label [[IF_END3]] +; NOT_TUNIT_NPM: if.end3: +; NOT_TUNIT_NPM-NEXT: ret void ; %tobool = icmp eq i32 %c1, 0 br i1 %tobool, label %if.end, label %if.then @@ -809,11 +776,11 @@ ; NOT_CGSCC_NPM-NEXT: tail call void @test16_sub(i32* noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR7]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test16_caller -; IS__CGSCC____-SAME: (i32* nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { -; IS__CGSCC____-NEXT: tail call void @test16_sub(i32* noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR13]] -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test16_caller +; NOT_TUNIT_NPM-SAME: (i32* nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; NOT_TUNIT_NPM-NEXT: tail call void @test16_sub(i32* noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR13]] +; NOT_TUNIT_NPM-NEXT: ret void ; tail call void @test16_sub(i32* %p, i32 %c, i32 %c) ret void @@ -854,20 +821,20 @@ ; NOT_CGSCC_NPM: l3: ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test17_caller -; IS__CGSCC____-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { -; IS__CGSCC____-NEXT: entry: -; 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]]) #[[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]]) #[[ATTR13]] -; IS__CGSCC____-NEXT: br label [[L3]] -; IS__CGSCC____: l3: -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test17_caller +; NOT_TUNIT_NPM-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]] +; NOT_TUNIT_NPM: l1: +; NOT_TUNIT_NPM-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR13]] +; NOT_TUNIT_NPM-NEXT: br label [[L3:%.*]] +; NOT_TUNIT_NPM: l2: +; NOT_TUNIT_NPM-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; NOT_TUNIT_NPM-NEXT: br label [[L3]] +; NOT_TUNIT_NPM: l3: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %tobool = icmp eq i32 %c, 0 @@ -902,10 +869,10 @@ ; NOT_CGSCC_NPM-SAME: () #[[ATTR9:[0-9]+]] { ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@noreturn -; IS__CGSCC____-SAME: () #[[ATTR9:[0-9]+]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@noreturn +; NOT_TUNIT_NPM-SAME: () #[[ATTR9:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; call void @noreturn() ret void @@ -925,18 +892,18 @@ ; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR7]] ; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test18_caller -; IS__CGSCC____-SAME: (i32* noalias nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { -; IS__CGSCC____-NEXT: entry: -; 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]]) #[[ATTR13]] -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: l2: -; 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 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test18_caller +; NOT_TUNIT_NPM-SAME: (i32* noalias nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]] +; NOT_TUNIT_NPM: l1: +; NOT_TUNIT_NPM-NEXT: tail call void @make_alias(i32* nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: l2: +; NOT_TUNIT_NPM-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %tobool = icmp eq i32 %c, 0 @@ -964,18 +931,18 @@ ; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { nofree noreturn nosync nounwind readnone willreturn } ; NOT_CGSCC_NPM: attributes #[[ATTR10]] = { willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nounwind uwtable } -; IS__CGSCC____: attributes #[[ATTR2]] = { nounwind } -; IS__CGSCC____: attributes #[[ATTR3]] = { nounwind ssp uwtable } -; IS__CGSCC____: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; 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]] = { nofree norecurse noreturn 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 } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nounwind uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { nounwind ssp uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR6:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR8]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR9]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR10]] = { readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR11]] = { readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR12]] = { willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR13]] = { nounwind willreturn writeonly } ;. diff --git a/llvm/test/Transforms/Attributor/nocapture-1.ll b/llvm/test/Transforms/Attributor/nocapture-1.ll --- a/llvm/test/Transforms/Attributor/nocapture-1.ll +++ b/llvm/test/Transforms/Attributor/nocapture-1.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM @g = global i32* null ; [#uses=1] @@ -13,78 +11,78 @@ ; CHECK: @[[G3:[a-zA-Z0-9_$"\\.-]+]] = global i8* null ;. define i32* @c1(i32* %q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@c1 -; IS__TUNIT____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[Q:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32* [[Q]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@c1 +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[Q:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i32* [[Q]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@c1 -; IS__CGSCC____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[Q:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32* [[Q]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@c1 +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[Q:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret i32* [[Q]] ; ret i32* %q } ; It would also be acceptable to mark %q as readnone. Update @c3 too. define void @c2(i32* %q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@c2 -; IS__TUNIT____-SAME: (i32* nofree writeonly [[Q:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: store i32* [[Q]], i32** @g, align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@c2 -; IS__CGSCC____-SAME: (i32* nofree writeonly [[Q:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32* [[Q]], i32** @g, align 8 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@c2 +; NOT_CGSCC_NPM-SAME: (i32* nofree writeonly [[Q:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: store i32* [[Q]], i32** @g, align 8 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@c2 +; NOT_TUNIT_NPM-SAME: (i32* nofree writeonly [[Q:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: store i32* [[Q]], i32** @g, align 8 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32* %q, i32** @g ret void } define void @c3(i32* %q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@c3 -; IS__TUNIT____-SAME: (i32* nofree writeonly [[Q:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: call void @c2(i32* nofree writeonly [[Q]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@c3 -; IS__CGSCC____-SAME: (i32* nofree writeonly [[Q:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: call void @c2(i32* nofree writeonly [[Q]]) #[[ATTR19:[0-9]+]] -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@c3 +; NOT_CGSCC_NPM-SAME: (i32* nofree writeonly [[Q:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: call void @c2(i32* nofree writeonly [[Q]]) #[[ATTR1]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@c3 +; NOT_TUNIT_NPM-SAME: (i32* nofree writeonly [[Q:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: call void @c2(i32* nofree writeonly [[Q]]) #[[ATTR19:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @c2(i32* %q) ret void } define i1 @c4(i32* %q, i32 %bitno) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@c4 -; IS__TUNIT____-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] -; IS__TUNIT____-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 -; IS__TUNIT____-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] -; IS__TUNIT____: l0: -; IS__TUNIT____-NEXT: ret i1 false -; IS__TUNIT____: l1: -; IS__TUNIT____-NEXT: ret i1 true -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@c4 -; IS__CGSCC____-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] -; IS__CGSCC____-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 -; IS__CGSCC____-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] -; IS__CGSCC____: l0: -; IS__CGSCC____-NEXT: ret i1 false -; IS__CGSCC____: l1: -; IS__CGSCC____-NEXT: ret i1 true +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@c4 +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; NOT_CGSCC_NPM-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 +; NOT_CGSCC_NPM-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] +; NOT_CGSCC_NPM: l0: +; NOT_CGSCC_NPM-NEXT: ret i1 false +; NOT_CGSCC_NPM: l1: +; NOT_CGSCC_NPM-NEXT: ret i1 true +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@c4 +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; NOT_TUNIT_NPM-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 +; NOT_TUNIT_NPM-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] +; NOT_TUNIT_NPM: l0: +; NOT_TUNIT_NPM-NEXT: ret i1 false +; NOT_TUNIT_NPM: l1: +; NOT_TUNIT_NPM-NEXT: ret i1 true ; %tmp = ptrtoint i32* %q to i32 %tmp2 = lshr i32 %tmp, %bitno @@ -98,29 +96,29 @@ ; c4b is c4 but without the escaping part define i1 @c4b(i32* %q, i32 %bitno) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@c4b -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] -; IS__TUNIT____-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 -; IS__TUNIT____-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] -; IS__TUNIT____: l0: -; IS__TUNIT____-NEXT: ret i1 false -; IS__TUNIT____: l1: -; IS__TUNIT____-NEXT: ret i1 false -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@c4b -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] -; IS__CGSCC____-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 -; IS__CGSCC____-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] -; IS__CGSCC____: l0: -; IS__CGSCC____-NEXT: ret i1 false -; IS__CGSCC____: l1: -; IS__CGSCC____-NEXT: ret i1 false +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@c4b +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; NOT_CGSCC_NPM-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 +; NOT_CGSCC_NPM-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] +; NOT_CGSCC_NPM: l0: +; NOT_CGSCC_NPM-NEXT: ret i1 false +; NOT_CGSCC_NPM: l1: +; NOT_CGSCC_NPM-NEXT: ret i1 false +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@c4b +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; NOT_TUNIT_NPM-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 +; NOT_TUNIT_NPM-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] +; NOT_TUNIT_NPM: l0: +; NOT_TUNIT_NPM-NEXT: ret i1 false +; NOT_TUNIT_NPM: l1: +; NOT_TUNIT_NPM-NEXT: ret i1 false ; %tmp = ptrtoint i32* %q to i32 %tmp2 = lshr i32 %tmp, %bitno @@ -135,25 +133,25 @@ @lookup_table = global [2 x i1] [ i1 0, i1 1 ] define i1 @c5(i32* %q, i32 %bitno) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@c5 -; IS__TUNIT____-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] -; IS__TUNIT____-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 -; IS__TUNIT____-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] -; IS__TUNIT____-NEXT: [[VAL:%.*]] = load i1, i1* [[LOOKUP]], align 1 -; IS__TUNIT____-NEXT: ret i1 [[VAL]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@c5 -; IS__CGSCC____-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] -; IS__CGSCC____-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 -; IS__CGSCC____-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] -; IS__CGSCC____-NEXT: [[VAL:%.*]] = load i1, i1* [[LOOKUP]], align 1 -; IS__CGSCC____-NEXT: ret i1 [[VAL]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@c5 +; NOT_CGSCC_NPM-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; NOT_CGSCC_NPM-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 +; NOT_CGSCC_NPM-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] +; NOT_CGSCC_NPM-NEXT: [[VAL:%.*]] = load i1, i1* [[LOOKUP]], align 1 +; NOT_CGSCC_NPM-NEXT: ret i1 [[VAL]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@c5 +; NOT_TUNIT_NPM-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; NOT_TUNIT_NPM-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 +; NOT_TUNIT_NPM-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] +; NOT_TUNIT_NPM-NEXT: [[VAL:%.*]] = load i1, i1* [[LOOKUP]], align 1 +; NOT_TUNIT_NPM-NEXT: ret i1 [[VAL]] ; %tmp = ptrtoint i32* %q to i32 %tmp2 = lshr i32 %tmp, %bitno @@ -192,23 +190,23 @@ declare i32 @__gxx_personality_v0(...) define i1* @lookup_bit(i32* %q, i32 %bitno) readnone nounwind { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@lookup_bit -; IS__TUNIT____-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] -; IS__TUNIT____-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 -; IS__TUNIT____-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] -; IS__TUNIT____-NEXT: ret i1* [[LOOKUP]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@lookup_bit -; IS__CGSCC____-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] -; IS__CGSCC____-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 -; IS__CGSCC____-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] -; IS__CGSCC____-NEXT: ret i1* [[LOOKUP]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@lookup_bit +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; NOT_CGSCC_NPM-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 +; NOT_CGSCC_NPM-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] +; NOT_CGSCC_NPM-NEXT: ret i1* [[LOOKUP]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@lookup_bit +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; NOT_TUNIT_NPM-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 +; NOT_TUNIT_NPM-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] +; NOT_TUNIT_NPM-NEXT: ret i1* [[LOOKUP]] ; %tmp = ptrtoint i32* %q to i32 %tmp2 = lshr i32 %tmp, %bitno @@ -218,19 +216,19 @@ } define i1 @c7(i32* %q, i32 %bitno) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@c7 -; IS__TUNIT____-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: [[PTR:%.*]] = call i1* @lookup_bit(i32* noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR17:[0-9]+]] -; IS__TUNIT____-NEXT: [[VAL:%.*]] = load i1, i1* [[PTR]], align 1 -; IS__TUNIT____-NEXT: ret i1 [[VAL]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@c7 -; IS__CGSCC____-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: [[PTR:%.*]] = call i1* @lookup_bit(i32* noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR20:[0-9]+]] -; IS__CGSCC____-NEXT: [[VAL:%.*]] = load i1, i1* [[PTR]], align 1 -; IS__CGSCC____-NEXT: ret i1 [[VAL]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@c7 +; NOT_CGSCC_NPM-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = call i1* @lookup_bit(i32* noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR17:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[VAL:%.*]] = load i1, i1* [[PTR]], align 1 +; NOT_CGSCC_NPM-NEXT: ret i1 [[VAL]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@c7 +; NOT_TUNIT_NPM-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = call i1* @lookup_bit(i32* noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR20:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[VAL:%.*]] = load i1, i1* [[PTR]], align 1 +; NOT_TUNIT_NPM-NEXT: ret i1 [[VAL]] ; %ptr = call i1* @lookup_bit(i32* %q, i32 %bitno) %val = load i1, i1* %ptr @@ -239,31 +237,31 @@ define i32 @nc1(i32* %q, i32* %p, i1 %b) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@nc1 -; IS__TUNIT____-SAME: (i32* nofree [[Q:%.*]], i32* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__TUNIT____-NEXT: e: -; IS__TUNIT____-NEXT: br label [[L:%.*]] -; IS__TUNIT____: l: -; IS__TUNIT____-NEXT: [[Y:%.*]] = phi i32* [ [[Q]], [[E:%.*]] ] -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = select i1 [[B]], i32* [[P]], i32* [[Y]] -; IS__TUNIT____-NEXT: [[VAL:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS__TUNIT____-NEXT: store i32 0, i32* [[P]], align 4 -; IS__TUNIT____-NEXT: store i32* [[Y]], i32** @g, align 8 -; IS__TUNIT____-NEXT: ret i32 [[VAL]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nc1 -; IS__CGSCC____-SAME: (i32* nofree [[Q:%.*]], i32* nocapture nofree align 4 [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC____-NEXT: e: -; IS__CGSCC____-NEXT: br label [[L:%.*]] -; IS__CGSCC____: l: -; IS__CGSCC____-NEXT: [[Y:%.*]] = phi i32* [ [[Q]], [[E:%.*]] ] -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = select i1 [[B]], i32* [[P]], i32* [[Y]] -; IS__CGSCC____-NEXT: [[VAL:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS__CGSCC____-NEXT: store i32 0, i32* [[P]], align 4 -; IS__CGSCC____-NEXT: store i32* [[Y]], i32** @g, align 8 -; IS__CGSCC____-NEXT: ret i32 [[VAL]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nc1 +; NOT_CGSCC_NPM-SAME: (i32* nofree [[Q:%.*]], i32* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: e: +; NOT_CGSCC_NPM-NEXT: br label [[L:%.*]] +; NOT_CGSCC_NPM: l: +; NOT_CGSCC_NPM-NEXT: [[Y:%.*]] = phi i32* [ [[Q]], [[E:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = select i1 [[B]], i32* [[P]], i32* [[Y]] +; NOT_CGSCC_NPM-NEXT: [[VAL:%.*]] = load i32, i32* [[TMP2]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[P]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32* [[Y]], i32** @g, align 8 +; NOT_CGSCC_NPM-NEXT: ret i32 [[VAL]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@nc1 +; NOT_TUNIT_NPM-SAME: (i32* nofree [[Q:%.*]], i32* nocapture nofree align 4 [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: e: +; NOT_TUNIT_NPM-NEXT: br label [[L:%.*]] +; NOT_TUNIT_NPM: l: +; NOT_TUNIT_NPM-NEXT: [[Y:%.*]] = phi i32* [ [[Q]], [[E:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = select i1 [[B]], i32* [[P]], i32* [[Y]] +; NOT_TUNIT_NPM-NEXT: [[VAL:%.*]] = load i32, i32* [[TMP2]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[P]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32* [[Y]], i32** @g, align 8 +; NOT_TUNIT_NPM-NEXT: ret i32 [[VAL]] ; e: br label %l @@ -279,35 +277,35 @@ } define i32 @nc1_addrspace(i32* %q, i32 addrspace(1)* %p, i1 %b) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@nc1_addrspace -; IS__TUNIT____-SAME: (i32* nofree [[Q:%.*]], i32 addrspace(1)* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5]] { -; IS__TUNIT____-NEXT: e: -; IS__TUNIT____-NEXT: br label [[L:%.*]] -; IS__TUNIT____: l: -; IS__TUNIT____-NEXT: [[X:%.*]] = phi i32 addrspace(1)* [ [[P]], [[E:%.*]] ] -; IS__TUNIT____-NEXT: [[Y:%.*]] = phi i32* [ [[Q]], [[E]] ] -; IS__TUNIT____-NEXT: [[TMP:%.*]] = addrspacecast i32 addrspace(1)* [[X]] to i32* -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = select i1 [[B]], i32* [[TMP]], i32* [[Y]] -; IS__TUNIT____-NEXT: [[VAL:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS__TUNIT____-NEXT: store i32 0, i32* [[TMP]], align 4 -; IS__TUNIT____-NEXT: store i32* [[Y]], i32** @g, align 8 -; IS__TUNIT____-NEXT: ret i32 [[VAL]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nc1_addrspace -; IS__CGSCC____-SAME: (i32* nofree [[Q:%.*]], i32 addrspace(1)* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5]] { -; IS__CGSCC____-NEXT: e: -; IS__CGSCC____-NEXT: br label [[L:%.*]] -; IS__CGSCC____: l: -; IS__CGSCC____-NEXT: [[X:%.*]] = phi i32 addrspace(1)* [ [[P]], [[E:%.*]] ] -; IS__CGSCC____-NEXT: [[Y:%.*]] = phi i32* [ [[Q]], [[E]] ] -; IS__CGSCC____-NEXT: [[TMP:%.*]] = addrspacecast i32 addrspace(1)* [[X]] to i32* -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = select i1 [[B]], i32* [[TMP]], i32* [[Y]] -; IS__CGSCC____-NEXT: [[VAL:%.*]] = load i32, i32* [[TMP2]], align 4 -; IS__CGSCC____-NEXT: store i32 0, i32* [[TMP]], align 4 -; IS__CGSCC____-NEXT: store i32* [[Y]], i32** @g, align 8 -; IS__CGSCC____-NEXT: ret i32 [[VAL]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nc1_addrspace +; NOT_CGSCC_NPM-SAME: (i32* nofree [[Q:%.*]], i32 addrspace(1)* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5]] { +; NOT_CGSCC_NPM-NEXT: e: +; NOT_CGSCC_NPM-NEXT: br label [[L:%.*]] +; NOT_CGSCC_NPM: l: +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = phi i32 addrspace(1)* [ [[P]], [[E:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[Y:%.*]] = phi i32* [ [[Q]], [[E]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = addrspacecast i32 addrspace(1)* [[X]] to i32* +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = select i1 [[B]], i32* [[TMP]], i32* [[Y]] +; NOT_CGSCC_NPM-NEXT: [[VAL:%.*]] = load i32, i32* [[TMP2]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[TMP]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32* [[Y]], i32** @g, align 8 +; NOT_CGSCC_NPM-NEXT: ret i32 [[VAL]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@nc1_addrspace +; NOT_TUNIT_NPM-SAME: (i32* nofree [[Q:%.*]], i32 addrspace(1)* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5]] { +; NOT_TUNIT_NPM-NEXT: e: +; NOT_TUNIT_NPM-NEXT: br label [[L:%.*]] +; NOT_TUNIT_NPM: l: +; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = phi i32 addrspace(1)* [ [[P]], [[E:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[Y:%.*]] = phi i32* [ [[Q]], [[E]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = addrspacecast i32 addrspace(1)* [[X]] to i32* +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = select i1 [[B]], i32* [[TMP]], i32* [[Y]] +; NOT_TUNIT_NPM-NEXT: [[VAL:%.*]] = load i32, i32* [[TMP2]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[TMP]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32* [[Y]], i32** @g, align 8 +; NOT_TUNIT_NPM-NEXT: ret i32 [[VAL]] ; e: br label %l @@ -323,17 +321,17 @@ } define void @nc2(i32* %p, i32* %q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@nc2 -; IS__TUNIT____-SAME: (i32* nocapture nofree [[P:%.*]], i32* nofree [[Q:%.*]]) #[[ATTR5]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = call i32 @nc1(i32* nofree [[Q]], i32* nocapture nofree [[P]], i1 noundef false) #[[ATTR5]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nc2 -; IS__CGSCC____-SAME: (i32* nocapture nofree align 4 [[P:%.*]], i32* nofree [[Q:%.*]]) #[[ATTR5]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = call i32 @nc1(i32* nofree [[Q]], i32* nocapture nofree align 4 [[P]], i1 noundef false) #[[ATTR16:[0-9]+]] -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nc2 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree [[P:%.*]], i32* nofree [[Q:%.*]]) #[[ATTR5]] { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i32 @nc1(i32* nofree [[Q]], i32* nocapture nofree [[P]], i1 noundef false) #[[ATTR5]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@nc2 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree align 4 [[P:%.*]], i32* nofree [[Q:%.*]]) #[[ATTR5]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = call i32 @nc1(i32* nofree [[Q]], i32* nocapture nofree align 4 [[P]], i1 noundef false) #[[ATTR16:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret void ; %1 = call i32 @nc1(i32* %q, i32* %p, i1 0) ; [#uses=0] ret void @@ -354,17 +352,17 @@ ; FIXME: readonly and nocapture missing on the pointer. declare void @external(i8* readonly) nounwind argmemonly define void @nc4(i8* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@nc4 -; IS__TUNIT____-SAME: (i8* [[P:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: call void @external(i8* readonly [[P]]) #[[ATTR18:[0-9]+]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@nc4 -; IS__CGSCC____-SAME: (i8* [[P:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC____-NEXT: call void @external(i8* readonly [[P]]) #[[ATTR21:[0-9]+]] -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nc4 +; NOT_CGSCC_NPM-SAME: (i8* [[P:%.*]]) #[[ATTR6:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: call void @external(i8* readonly [[P]]) #[[ATTR18:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@nc4 +; NOT_TUNIT_NPM-SAME: (i8* [[P:%.*]]) #[[ATTR6:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: call void @external(i8* readonly [[P]]) #[[ATTR21:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @external(i8* %p) ret void @@ -396,27 +394,17 @@ } define i8* @test1_2(i8* %x1_2, i8* %y1_2, i1 %c) { -; IS________OPM: Function Attrs: nofree nosync nounwind writeonly -; IS________OPM-LABEL: define {{[^@]+}}@test1_2 -; IS________OPM-SAME: (i8* nocapture nofree readnone [[X1_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 [[C:%.*]]) #[[ATTR7]] { -; IS________OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS________OPM: t: -; IS________OPM-NEXT: call void @test1_1(i8* noalias nocapture nofree readnone undef, i8* noalias nocapture nofree readnone [[Y1_2]], i1 [[C]]) #[[ATTR7]] -; IS________OPM-NEXT: store i32* null, i32** @g, align 8 -; IS________OPM-NEXT: br label [[F]] -; IS________OPM: f: -; IS________OPM-NEXT: ret i8* [[Y1_2]] -; -; IS________NPM: Function Attrs: nofree nosync nounwind writeonly -; IS________NPM-LABEL: define {{[^@]+}}@test1_2 -; IS________NPM-SAME: (i8* nocapture nofree readnone [[X1_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 [[C:%.*]]) #[[ATTR7]] { -; IS________NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS________NPM: t: -; IS________NPM-NEXT: call void @test1_1(i8* noalias nocapture nofree readnone undef, i8* noalias nocapture nofree readnone [[Y1_2]], i1 noundef [[C]]) #[[ATTR7]] -; IS________NPM-NEXT: store i32* null, i32** @g, align 8 -; IS________NPM-NEXT: br label [[F]] -; IS________NPM: f: -; IS________NPM-NEXT: ret i8* [[Y1_2]] +; +; CHECK: Function Attrs: nofree nosync nounwind writeonly +; CHECK-LABEL: define {{[^@]+}}@test1_2 +; CHECK-SAME: (i8* nocapture nofree readnone [[X1_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 [[C:%.*]]) #[[ATTR7]] { +; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CHECK: t: +; CHECK-NEXT: call void @test1_1(i8* noalias nocapture nofree readnone undef, i8* noalias nocapture nofree readnone [[Y1_2]], i1 noundef [[C]]) #[[ATTR7]] +; CHECK-NEXT: store i32* null, i32** @g, align 8 +; CHECK-NEXT: br label [[F]] +; CHECK: f: +; CHECK-NEXT: ret i8* [[Y1_2]] ; br i1 %c, label %t, label %f t: @@ -428,15 +416,15 @@ } define void @test2(i8* %x2) { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[X2:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree readnone [[X2:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[X2:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree readnone [[X2:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; call void @test2(i8* %x2) store i32* null, i32** @g @@ -444,15 +432,15 @@ } define void @test3(i8* %x3, i8* %y3, i8* %z3) { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test3 -; IS__TUNIT____-SAME: (i8* nocapture nofree readnone [[X3:%.*]], i8* nocapture nofree readnone [[Y3:%.*]], i8* nocapture nofree readnone [[Z3:%.*]]) #[[ATTR8]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test3 +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree readnone [[X3:%.*]], i8* nocapture nofree readnone [[Y3:%.*]], i8* nocapture nofree readnone [[Z3:%.*]]) #[[ATTR8]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test3 -; IS__CGSCC____-SAME: (i8* nocapture nofree readnone [[X3:%.*]], i8* nocapture nofree readnone [[Y3:%.*]], i8* nocapture nofree readnone [[Z3:%.*]]) #[[ATTR8]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test3 +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree readnone [[X3:%.*]], i8* nocapture nofree readnone [[Y3:%.*]], i8* nocapture nofree readnone [[Z3:%.*]]) #[[ATTR8]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; call void @test3(i8* %z3, i8* %y3, i8* %x3) store i32* null, i32** @g @@ -473,27 +461,17 @@ } define i8* @test4_2(i8* %x4_2, i8* %y4_2, i8* %z4_2, i1 %c) { -; IS________OPM: Function Attrs: nofree nosync nounwind writeonly -; IS________OPM-LABEL: define {{[^@]+}}@test4_2 -; IS________OPM-SAME: (i8* nocapture nofree readnone [[X4_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], i8* nocapture nofree readnone [[Z4_2:%.*]], i1 [[C:%.*]]) #[[ATTR7]] { -; IS________OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS________OPM: t: -; IS________OPM-NEXT: call void @test4_1(i8* noalias nocapture nofree noundef readnone align 4294967296 null, i1 [[C]]) #[[ATTR7]] -; IS________OPM-NEXT: store i32* null, i32** @g, align 8 -; IS________OPM-NEXT: br label [[F]] -; IS________OPM: f: -; IS________OPM-NEXT: ret i8* [[Y4_2]] -; -; IS________NPM: Function Attrs: nofree nosync nounwind writeonly -; IS________NPM-LABEL: define {{[^@]+}}@test4_2 -; IS________NPM-SAME: (i8* nocapture nofree readnone [[X4_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], i8* nocapture nofree readnone [[Z4_2:%.*]], i1 [[C:%.*]]) #[[ATTR7]] { -; IS________NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS________NPM: t: -; IS________NPM-NEXT: call void @test4_1(i8* noalias nocapture nofree noundef readnone align 4294967296 null, i1 noundef [[C]]) #[[ATTR7]] -; IS________NPM-NEXT: store i32* null, i32** @g, align 8 -; IS________NPM-NEXT: br label [[F]] -; IS________NPM: f: -; IS________NPM-NEXT: ret i8* [[Y4_2]] +; +; CHECK: Function Attrs: nofree nosync nounwind writeonly +; CHECK-LABEL: define {{[^@]+}}@test4_2 +; CHECK-SAME: (i8* nocapture nofree readnone [[X4_2:%.*]], i8* nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], i8* nocapture nofree readnone [[Z4_2:%.*]], i1 [[C:%.*]]) #[[ATTR7]] { +; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CHECK: t: +; CHECK-NEXT: call void @test4_1(i8* noalias nocapture nofree noundef readnone align 4294967296 null, i1 noundef [[C]]) #[[ATTR7]] +; CHECK-NEXT: store i32* null, i32** @g, align 8 +; CHECK-NEXT: br label [[F]] +; CHECK: f: +; CHECK-NEXT: ret i8* [[Y4_2]] ; br i1 %c, label %t, label %f t: @@ -533,72 +511,72 @@ } define void @test_cmpxchg(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_cmpxchg -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = cmpxchg i32* [[P]], i32 0, i32 1 acquire monotonic, align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_cmpxchg -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = cmpxchg i32* [[P]], i32 0, i32 1 acquire monotonic, align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_cmpxchg +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR9:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = cmpxchg i32* [[P]], i32 0, i32 1 acquire monotonic, align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_cmpxchg +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR9:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = cmpxchg i32* [[P]], i32 0, i32 1 acquire monotonic, align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; cmpxchg i32* %p, i32 0, i32 1 acquire monotonic ret void } define void @test_cmpxchg_ptr(i32** %p, i32* %q) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_cmpxchg_ptr -; IS__TUNIT____-SAME: (i32** nocapture nofree noundef nonnull dereferenceable(8) [[P:%.*]], i32* nofree [[Q:%.*]]) #[[ATTR9]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = cmpxchg i32** [[P]], i32* null, i32* [[Q]] acquire monotonic, align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_cmpxchg_ptr -; IS__CGSCC____-SAME: (i32** nocapture nofree noundef nonnull dereferenceable(8) [[P:%.*]], i32* nofree [[Q:%.*]]) #[[ATTR9]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = cmpxchg i32** [[P]], i32* null, i32* [[Q]] acquire monotonic, align 8 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_cmpxchg_ptr +; NOT_CGSCC_NPM-SAME: (i32** nocapture nofree noundef nonnull dereferenceable(8) [[P:%.*]], i32* nofree [[Q:%.*]]) #[[ATTR9]] { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = cmpxchg i32** [[P]], i32* null, i32* [[Q]] acquire monotonic, align 8 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_cmpxchg_ptr +; NOT_TUNIT_NPM-SAME: (i32** nocapture nofree noundef nonnull dereferenceable(8) [[P:%.*]], i32* nofree [[Q:%.*]]) #[[ATTR9]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = cmpxchg i32** [[P]], i32* null, i32* [[Q]] acquire monotonic, align 8 +; NOT_TUNIT_NPM-NEXT: ret void ; cmpxchg i32** %p, i32* null, i32* %q acquire monotonic ret void } define void @test_atomicrmw(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_atomicrmw -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR9]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = atomicrmw add i32* [[P]], i32 1 seq_cst, align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_atomicrmw -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR9]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = atomicrmw add i32* [[P]], i32 1 seq_cst, align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_atomicrmw +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR9]] { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = atomicrmw add i32* [[P]], i32 1 seq_cst, align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_atomicrmw +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR9]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = atomicrmw add i32* [[P]], i32 1 seq_cst, align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; atomicrmw add i32* %p, i32 1 seq_cst ret void } define void @test_volatile(i32* %x) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_volatile -; IS__TUNIT____-SAME: (i32* nofree align 4 [[X:%.*]]) #[[ATTR9]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[GEP:%.*]] = getelementptr i32, i32* [[X]], i64 1 -; IS__TUNIT____-NEXT: store volatile i32 0, i32* [[GEP]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_volatile -; IS__CGSCC____-SAME: (i32* nofree align 4 [[X:%.*]]) #[[ATTR9]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[GEP:%.*]] = getelementptr i32, i32* [[X]], i64 1 -; IS__CGSCC____-NEXT: store volatile i32 0, i32* [[GEP]], align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_volatile +; NOT_CGSCC_NPM-SAME: (i32* nofree align 4 [[X:%.*]]) #[[ATTR9]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[GEP:%.*]] = getelementptr i32, i32* [[X]], i64 1 +; NOT_CGSCC_NPM-NEXT: store volatile i32 0, i32* [[GEP]], align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_volatile +; NOT_TUNIT_NPM-SAME: (i32* nofree align 4 [[X:%.*]]) #[[ATTR9]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[GEP:%.*]] = getelementptr i32, i32* [[X]], i64 1 +; NOT_TUNIT_NPM-NEXT: store volatile i32 0, i32* [[GEP]], align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %gep = getelementptr i32, i32* %x, i64 1 @@ -607,21 +585,21 @@ } define void @nocaptureLaunder(i8* %p) { -; IS__TUNIT____: Function Attrs: inaccessiblemem_or_argmemonly nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@nocaptureLaunder -; IS__TUNIT____-SAME: (i8* nocapture nofree [[P:%.*]]) #[[ATTR10:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[B:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nofree [[P]]) #[[ATTR19:[0-9]+]] -; IS__TUNIT____-NEXT: store i8 42, i8* [[B]], align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: inaccessiblemem_or_argmemonly nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nocaptureLaunder -; IS__CGSCC____-SAME: (i8* nocapture nofree [[P:%.*]]) #[[ATTR10:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[B:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nofree [[P]]) #[[ATTR22:[0-9]+]] -; IS__CGSCC____-NEXT: store i8 42, i8* [[B]], align 1 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: inaccessiblemem_or_argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nocaptureLaunder +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nofree [[P]]) #[[ATTR19:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: store i8 42, i8* [[B]], align 1 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: inaccessiblemem_or_argmemonly nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@nocaptureLaunder +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nofree [[P]]) #[[ATTR22:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: store i8 42, i8* [[B]], align 1 +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %b = call i8* @llvm.launder.invariant.group.p0i8(i8* %p) @@ -631,19 +609,19 @@ @g2 = global i8* null define void @captureLaunder(i8* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@captureLaunder -; IS__TUNIT____-SAME: (i8* nofree [[P:%.*]]) #[[ATTR5]] { -; IS__TUNIT____-NEXT: [[B:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nofree [[P]]) #[[ATTR19]] -; IS__TUNIT____-NEXT: store i8* [[B]], i8** @g2, align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@captureLaunder -; IS__CGSCC____-SAME: (i8* nofree [[P:%.*]]) #[[ATTR11:[0-9]+]] { -; IS__CGSCC____-NEXT: [[B:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nofree [[P]]) #[[ATTR22]] -; IS__CGSCC____-NEXT: store i8* [[B]], i8** @g2, align 8 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@captureLaunder +; NOT_CGSCC_NPM-SAME: (i8* nofree [[P:%.*]]) #[[ATTR5]] { +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nofree [[P]]) #[[ATTR19]] +; NOT_CGSCC_NPM-NEXT: store i8* [[B]], i8** @g2, align 8 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@captureLaunder +; NOT_TUNIT_NPM-SAME: (i8* nofree [[P:%.*]]) #[[ATTR11:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nofree [[P]]) #[[ATTR22]] +; NOT_TUNIT_NPM-NEXT: store i8* [[B]], i8** @g2, align 8 +; NOT_TUNIT_NPM-NEXT: ret void ; %b = call i8* @llvm.launder.invariant.group.p0i8(i8* %p) store i8* %b, i8** @g2 @@ -651,21 +629,21 @@ } define void @nocaptureStrip(i8* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@nocaptureStrip -; IS__TUNIT____-SAME: (i8* nocapture nofree writeonly [[P:%.*]]) #[[ATTR11:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[B:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* noalias nofree readnone [[P]]) #[[ATTR20:[0-9]+]] -; IS__TUNIT____-NEXT: store i8 42, i8* [[B]], align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@nocaptureStrip -; IS__CGSCC____-SAME: (i8* nocapture nofree writeonly [[P:%.*]]) #[[ATTR12:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[B:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* noalias nofree readnone [[P]]) #[[ATTR20]] -; IS__CGSCC____-NEXT: store i8 42, i8* [[B]], align 1 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nocaptureStrip +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree writeonly [[P:%.*]]) #[[ATTR11:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* noalias nofree readnone [[P]]) #[[ATTR20:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: store i8 42, i8* [[B]], align 1 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@nocaptureStrip +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree writeonly [[P:%.*]]) #[[ATTR12:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* noalias nofree readnone [[P]]) #[[ATTR20]] +; NOT_TUNIT_NPM-NEXT: store i8 42, i8* [[B]], align 1 +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %b = call i8* @llvm.strip.invariant.group.p0i8(i8* %p) @@ -675,19 +653,19 @@ @g3 = global i8* null define void @captureStrip(i8* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@captureStrip -; IS__TUNIT____-SAME: (i8* nofree writeonly [[P:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[B:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* noalias nofree readnone [[P]]) #[[ATTR20]] -; IS__TUNIT____-NEXT: store i8* [[B]], i8** @g3, align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@captureStrip -; IS__CGSCC____-SAME: (i8* nofree writeonly [[P:%.*]]) #[[ATTR13:[0-9]+]] { -; IS__CGSCC____-NEXT: [[B:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* noalias nofree readnone [[P]]) #[[ATTR20]] -; IS__CGSCC____-NEXT: store i8* [[B]], i8** @g3, align 8 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@captureStrip +; NOT_CGSCC_NPM-SAME: (i8* nofree writeonly [[P:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* noalias nofree readnone [[P]]) #[[ATTR20]] +; NOT_CGSCC_NPM-NEXT: store i8* [[B]], i8** @g3, align 8 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@captureStrip +; NOT_TUNIT_NPM-SAME: (i8* nofree writeonly [[P:%.*]]) #[[ATTR13:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* noalias nofree readnone [[P]]) #[[ATTR20]] +; NOT_TUNIT_NPM-NEXT: store i8* [[B]], i8** @g3, align 8 +; NOT_TUNIT_NPM-NEXT: ret void ; %b = call i8* @llvm.strip.invariant.group.p0i8(i8* %p) store i8* %b, i8** @g3 @@ -695,49 +673,49 @@ } define i1 @captureICmp(i32* %x) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@captureICmp -; IS__TUNIT____-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = icmp eq i32* [[X]], null -; IS__TUNIT____-NEXT: ret i1 [[TMP1]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@captureICmp -; IS__CGSCC____-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = icmp eq i32* [[X]], null -; IS__CGSCC____-NEXT: ret i1 [[TMP1]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@captureICmp +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = icmp eq i32* [[X]], null +; NOT_CGSCC_NPM-NEXT: ret i1 [[TMP1]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@captureICmp +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = icmp eq i32* [[X]], null +; NOT_TUNIT_NPM-NEXT: ret i1 [[TMP1]] ; %1 = icmp eq i32* %x, null ret i1 %1 } define i1 @captureICmpRev(i32* %x) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@captureICmpRev -; IS__TUNIT____-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = icmp eq i32* null, [[X]] -; IS__TUNIT____-NEXT: ret i1 [[TMP1]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@captureICmpRev -; IS__CGSCC____-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = icmp eq i32* null, [[X]] -; IS__CGSCC____-NEXT: ret i1 [[TMP1]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@captureICmpRev +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = icmp eq i32* null, [[X]] +; NOT_CGSCC_NPM-NEXT: ret i1 [[TMP1]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@captureICmpRev +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = icmp eq i32* null, [[X]] +; NOT_TUNIT_NPM-NEXT: ret i1 [[TMP1]] ; %1 = icmp eq i32* null, %x ret i1 %1 } define i1 @nocaptureInboundsGEPICmp(i32* %x) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmp -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i1 false +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmp +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i1 false ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmp -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 false +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmp +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i1 false ; %1 = getelementptr inbounds i32, i32* %x, i32 5 %2 = bitcast i32* %1 to i8* @@ -746,15 +724,15 @@ } define i1 @nocaptureInboundsGEPICmpRev(i32* %x) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmpRev -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i1 true +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmpRev +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i1 true ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmpRev -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 true +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmpRev +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i1 true ; %1 = getelementptr inbounds i32, i32* %x, i32 5 %2 = bitcast i32* %1 to i8* @@ -763,19 +741,19 @@ } define i1 @nocaptureDereferenceableOrNullICmp(i32* dereferenceable_or_null(4) %x) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@nocaptureDereferenceableOrNullICmp -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null -; IS__TUNIT____-NEXT: ret i1 [[TMP2]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nocaptureDereferenceableOrNullICmp -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null -; IS__CGSCC____-NEXT: ret i1 [[TMP2]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nocaptureDereferenceableOrNullICmp +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null +; NOT_CGSCC_NPM-NEXT: ret i1 [[TMP2]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@nocaptureDereferenceableOrNullICmp +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null +; NOT_TUNIT_NPM-NEXT: ret i1 [[TMP2]] ; %1 = bitcast i32* %x to i8* %2 = icmp eq i8* %1, null @@ -783,19 +761,19 @@ } define i1 @captureDereferenceableOrNullICmp(i32* dereferenceable_or_null(4) %x) null_pointer_is_valid { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind null_pointer_is_valid readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@captureDereferenceableOrNullICmp -; IS__TUNIT____-SAME: (i32* nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR12:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null -; IS__TUNIT____-NEXT: ret i1 [[TMP2]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@captureDereferenceableOrNullICmp -; IS__CGSCC____-SAME: (i32* nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR14:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null -; IS__CGSCC____-NEXT: ret i1 [[TMP2]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind null_pointer_is_valid readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@captureDereferenceableOrNullICmp +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR12:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null +; NOT_CGSCC_NPM-NEXT: ret i1 [[TMP2]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@captureDereferenceableOrNullICmp +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR14:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null +; NOT_TUNIT_NPM-NEXT: ret i1 [[TMP2]] ; %1 = bitcast i32* %x to i8* %2 = icmp eq i8* %1, null @@ -848,17 +826,17 @@ ; FIXME: Both pointers should be nocapture define void @ptr_uses(i8* %ptr, i8* %wptr) { -; IS__TUNIT____: Function Attrs: nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ptr_uses -; IS__TUNIT____-SAME: (i8* [[PTR:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[WPTR:%.*]]) #[[ATTR14:[0-9]+]] { -; IS__TUNIT____-NEXT: store i8 0, i8* [[WPTR]], align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ptr_uses -; IS__CGSCC____-SAME: (i8* [[PTR:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[WPTR:%.*]]) #[[ATTR16]] { -; IS__CGSCC____-NEXT: store i8 0, i8* [[WPTR]], align 1 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ptr_uses +; NOT_CGSCC_NPM-SAME: (i8* [[PTR:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[WPTR:%.*]]) #[[ATTR14:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: store i8 0, i8* [[WPTR]], align 1 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ptr_uses +; NOT_TUNIT_NPM-SAME: (i8* [[PTR:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[WPTR:%.*]]) #[[ATTR16]] { +; NOT_TUNIT_NPM-NEXT: store i8 0, i8* [[WPTR]], align 1 +; NOT_TUNIT_NPM-NEXT: ret void ; %call_ptr = call i8* @maybe_returned_ptr(i8* %ptr) %call_val = call i8 @maybe_returned_val(i8* %call_ptr) @@ -870,49 +848,49 @@ declare i8* @llvm.launder.invariant.group.p0i8(i8*) declare i8* @llvm.strip.invariant.group.p0i8(i8*) ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR3]] = { readonly } -; IS__TUNIT____: attributes #[[ATTR4]] = { nounwind readonly } -; IS__TUNIT____: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR6]] = { argmemonly nounwind } -; IS__TUNIT____: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly } -; IS__TUNIT____: attributes #[[ATTR8]] = { nofree noreturn nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR9]] = { argmemonly nofree nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR10]] = { inaccessiblemem_or_argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR11]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR12]] = { nofree nosync nounwind null_pointer_is_valid readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR13:[0-9]+]] = { nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR14]] = { nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR15:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind speculatable willreturn } -; IS__TUNIT____: attributes #[[ATTR16:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__TUNIT____: attributes #[[ATTR17]] = { nofree nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR18]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR19]] = { willreturn } -; IS__TUNIT____: attributes #[[ATTR20]] = { readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { readonly } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nounwind readonly } +; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { argmemonly nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { nofree noreturn nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { argmemonly nofree nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR10]] = { inaccessiblemem_or_argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR11]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR12]] = { nofree nosync nounwind null_pointer_is_valid readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR13:[0-9]+]] = { nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR14]] = { nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR15:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind speculatable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR16:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR17]] = { nofree nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR18]] = { nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR19]] = { willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR20]] = { readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR3]] = { readonly } -; IS__CGSCC____: attributes #[[ATTR4]] = { nounwind readonly } -; IS__CGSCC____: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR6]] = { argmemonly nounwind } -; IS__CGSCC____: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly } -; IS__CGSCC____: attributes #[[ATTR8]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR9]] = { argmemonly nofree norecurse nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR10]] = { inaccessiblemem_or_argmemonly nofree nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR11]] = { nofree nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR12]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR13]] = { nofree nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR14]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR15:[0-9]+]] = { nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR16]] = { nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR17:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind speculatable willreturn } -; IS__CGSCC____: attributes #[[ATTR18:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__CGSCC____: attributes #[[ATTR19]] = { nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR20]] = { readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR21]] = { nounwind } -; IS__CGSCC____: attributes #[[ATTR22]] = { willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { readonly } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { nounwind readonly } +; NOT_TUNIT_NPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR6]] = { argmemonly nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR8]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR9]] = { argmemonly nofree norecurse nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR10]] = { inaccessiblemem_or_argmemonly nofree nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR11]] = { nofree nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR12]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR13]] = { nofree nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR14]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR15:[0-9]+]] = { nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR16]] = { nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR17:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind speculatable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR18:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR19]] = { nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR20]] = { readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR21]] = { nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR22]] = { willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/nocapture-2.ll b/llvm/test/Transforms/Attributor/nocapture-2.ll --- a/llvm/test/Transforms/Attributor/nocapture-2.ll +++ b/llvm/test/Transforms/Attributor/nocapture-2.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=11 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=11 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ; ; Test cases specifically designed for the "no-capture" argument attribute. @@ -18,21 +16,21 @@ ; ; no-capture is missing on %p because it is not dereferenceable define i32 @is_null_return(i32* %p) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@is_null_return -; IS__TUNIT____-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null -; IS__TUNIT____-NEXT: [[CONV:%.*]] = zext i1 [[CMP]] to i32 -; IS__TUNIT____-NEXT: ret i32 [[CONV]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@is_null_return -; IS__CGSCC____-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null -; IS__CGSCC____-NEXT: [[CONV:%.*]] = zext i1 [[CMP]] to i32 -; IS__CGSCC____-NEXT: ret i32 [[CONV]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@is_null_return +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null +; NOT_CGSCC_NPM-NEXT: [[CONV:%.*]] = zext i1 [[CMP]] to i32 +; NOT_CGSCC_NPM-NEXT: ret i32 [[CONV]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@is_null_return +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null +; NOT_TUNIT_NPM-NEXT: [[CONV:%.*]] = zext i1 [[CMP]] to i32 +; NOT_TUNIT_NPM-NEXT: ret i32 [[CONV]] ; entry: %cmp = icmp eq i32* %p, null @@ -52,51 +50,51 @@ ; ; no-capture is missing on %p because it is not dereferenceable define i32 @is_null_control(i32* %p) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@is_null_control -; IS__TUNIT____-SAME: (i32* nofree [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: store i32 1, i32* [[RETVAL]], align 4 -; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: [[CMP1:%.*]] = icmp eq i32* null, [[P]] -; IS__TUNIT____-NEXT: br i1 [[CMP1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] -; IS__TUNIT____: if.then2: -; IS__TUNIT____-NEXT: store i32 1, i32* [[RETVAL]], align 4 -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: if.end3: -; IS__TUNIT____-NEXT: store i32 0, i32* [[RETVAL]], align 4 -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* [[RETVAL]], align 4 -; IS__TUNIT____-NEXT: ret i32 [[TMP0]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@is_null_control -; IS__CGSCC____-SAME: (i32* nofree [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: store i32 1, i32* [[RETVAL]], align 4 -; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[CMP1:%.*]] = icmp eq i32* null, [[P]] -; IS__CGSCC____-NEXT: br i1 [[CMP1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] -; IS__CGSCC____: if.then2: -; IS__CGSCC____-NEXT: store i32 1, i32* [[RETVAL]], align 4 -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: if.end3: -; IS__CGSCC____-NEXT: store i32 0, i32* [[RETVAL]], align 4 -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* [[RETVAL]], align 4 -; IS__CGSCC____-NEXT: ret i32 [[TMP0]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@is_null_control +; NOT_CGSCC_NPM-SAME: (i32* nofree [[P:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[RETVAL]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: [[CMP1:%.*]] = icmp eq i32* null, [[P]] +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] +; NOT_CGSCC_NPM: if.then2: +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[RETVAL]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: if.end3: +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[RETVAL]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[RETVAL]], align 4 +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP0]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@is_null_control +; NOT_TUNIT_NPM-SAME: (i32* nofree [[P:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[RETVAL]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: [[CMP1:%.*]] = icmp eq i32* null, [[P]] +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] +; NOT_TUNIT_NPM: if.then2: +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[RETVAL]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: if.end3: +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[RETVAL]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[RETVAL]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP0]] ; entry: %retval = alloca i32, align 4 @@ -132,17 +130,17 @@ ; } ; define double* @srec0(double* %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@srec0 -; IS__TUNIT____-SAME: (double* nocapture nofree readnone [[A:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@srec0 -; IS__CGSCC____-SAME: (double* nocapture nofree readnone [[A:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@srec0 +; NOT_CGSCC_NPM-SAME: (double* nocapture nofree readnone [[A:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@srec0 +; NOT_TUNIT_NPM-SAME: (double* nocapture nofree readnone [[A:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: %call = call double* @srec0(double* %a) @@ -163,17 +161,17 @@ ; Other arguments are possible here due to the no-return behavior. ; define i32* @srec16(i32* %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@srec16 -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[A:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@srec16 -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[A:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@srec16 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[A:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@srec16 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree readnone [[A:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: %call = call i32* @srec16(i32* %a) @@ -405,19 +403,19 @@ ; ; There should *not* be a no-capture attribute on %a define i64* @not_captured_but_returned_0(i64* %a) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@not_captured_but_returned_0 -; IS__TUNIT____-SAME: (i64* nofree noundef nonnull returned writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: store i64 0, i64* [[A]], align 8 -; IS__TUNIT____-NEXT: ret i64* [[A]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@not_captured_but_returned_0 -; IS__CGSCC____-SAME: (i64* nofree noundef nonnull returned writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: store i64 0, i64* [[A]], align 8 -; IS__CGSCC____-NEXT: ret i64* [[A]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@not_captured_but_returned_0 +; NOT_CGSCC_NPM-SAME: (i64* nofree noundef nonnull returned writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: store i64 0, i64* [[A]], align 8 +; NOT_CGSCC_NPM-NEXT: ret i64* [[A]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@not_captured_but_returned_0 +; NOT_TUNIT_NPM-SAME: (i64* nofree noundef nonnull returned writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: store i64 0, i64* [[A]], align 8 +; NOT_TUNIT_NPM-NEXT: ret i64* [[A]] ; entry: store i64 0, i64* %a, align 8 @@ -433,21 +431,21 @@ ; ; There should *not* be a no-capture attribute on %a define i64* @not_captured_but_returned_1(i64* %a) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@not_captured_but_returned_1 -; IS__TUNIT____-SAME: (i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i64, i64* [[A]], i64 1 -; IS__TUNIT____-NEXT: store i64 1, i64* [[ADD_PTR]], align 8 -; IS__TUNIT____-NEXT: ret i64* [[ADD_PTR]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@not_captured_but_returned_1 -; IS__CGSCC____-SAME: (i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i64, i64* [[A]], i64 1 -; IS__CGSCC____-NEXT: store i64 1, i64* [[ADD_PTR]], align 8 -; IS__CGSCC____-NEXT: ret i64* [[ADD_PTR]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@not_captured_but_returned_1 +; NOT_CGSCC_NPM-SAME: (i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i64, i64* [[A]], i64 1 +; NOT_CGSCC_NPM-NEXT: store i64 1, i64* [[ADD_PTR]], align 8 +; NOT_CGSCC_NPM-NEXT: ret i64* [[ADD_PTR]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@not_captured_but_returned_1 +; NOT_TUNIT_NPM-SAME: (i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i64, i64* [[A]], i64 1 +; NOT_TUNIT_NPM-NEXT: store i64 1, i64* [[ADD_PTR]], align 8 +; NOT_TUNIT_NPM-NEXT: ret i64* [[ADD_PTR]] ; entry: %add.ptr = getelementptr inbounds i64, i64* %a, i64 1 @@ -463,21 +461,21 @@ ; } ; define void @test_not_captured_but_returned_calls(i64* %a) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_not_captured_but_returned_calls -; 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]]) #[[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:%.*]]) #[[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]]) #[[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 +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_not_captured_but_returned_calls +; NOT_CGSCC_NPM-SAME: (i64* nocapture nofree writeonly align 8 [[A:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR9:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR9]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_not_captured_but_returned_calls +; NOT_TUNIT_NPM-SAME: (i64* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-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]+]] +; NOT_TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i64* @not_captured_but_returned_1(i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A]]) #[[ATTR9]] +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %call = call i64* @not_captured_but_returned_0(i64* %a) @@ -493,19 +491,19 @@ ; ; There should *not* be a no-capture attribute on %a define i64* @negative_test_not_captured_but_returned_call_0a(i64* %a) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0a -; IS__TUNIT____-SAME: (i64* nofree returned writeonly align 8 "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR9]] -; IS__TUNIT____-NEXT: 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:%.*]]) #[[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]]) #[[ATTR9]] -; IS__CGSCC____-NEXT: ret i64* [[A]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0a +; NOT_CGSCC_NPM-SAME: (i64* nofree returned writeonly align 8 "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR9]] +; NOT_CGSCC_NPM-NEXT: ret i64* [[A]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0a +; NOT_TUNIT_NPM-SAME: (i64* nofree noundef nonnull returned writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree noundef nonnull writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A]]) #[[ATTR9]] +; NOT_TUNIT_NPM-NEXT: ret i64* [[A]] ; entry: %call = call i64* @not_captured_but_returned_0(i64* %a) @@ -520,23 +518,23 @@ ; ; There should *not* be a no-capture attribute on %a define void @negative_test_not_captured_but_returned_call_0b(i64* %a) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0b -; 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]]) #[[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:%.*]]) #[[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]]) #[[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 +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0b +; NOT_CGSCC_NPM-SAME: (i64* nofree writeonly align 8 [[A:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR9]] +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[A]] to i64 +; NOT_CGSCC_NPM-NEXT: store i64 [[TMP0]], i64* [[A]], align 8 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0b +; NOT_TUNIT_NPM-SAME: (i64* nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree noundef nonnull writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A]]) #[[ATTR9]] +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[A]] to i64 +; NOT_TUNIT_NPM-NEXT: store i64 [[TMP0]], i64* [[A]], align 8 +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %call = call i64* @not_captured_but_returned_0(i64* %a) @@ -553,19 +551,19 @@ ; ; There should *not* be a no-capture attribute on %a define i64* @negative_test_not_captured_but_returned_call_1a(i64* %a) #0 { -; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1a -; IS__TUNIT____-SAME: (i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { -; IS__TUNIT____-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]]) #[[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:%.*]]) #[[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]]) #[[ATTR9]] -; IS__CGSCC____-NEXT: ret i64* [[CALL]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1a +; NOT_CGSCC_NPM-SAME: (i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-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]] +; NOT_CGSCC_NPM-NEXT: ret i64* [[CALL]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1a +; NOT_TUNIT_NPM-SAME: (i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-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]] +; NOT_TUNIT_NPM-NEXT: ret i64* [[CALL]] ; entry: %call = call i64* @not_captured_but_returned_1(i64* %a) @@ -580,23 +578,23 @@ ; ; There should *not* be a no-capture attribute on %a define void @negative_test_not_captured_but_returned_call_1b(i64* %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind uwtable willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1b -; 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]]) #[[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:%.*]]) #[[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]]) #[[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 +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind uwtable willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1b +; NOT_CGSCC_NPM-SAME: (i64* nofree writeonly align 8 [[A:%.*]]) #[[ATTR5:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call align 8 i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR9]] +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[CALL]] to i64 +; NOT_CGSCC_NPM-NEXT: store i64 [[TMP0]], i64* [[CALL]], align 8 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1b +; NOT_TUNIT_NPM-SAME: (i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A:%.*]]) #[[ATTR5:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-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]] +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[CALL]] to i64 +; NOT_TUNIT_NPM-NEXT: store i64 [[TMP0]], i64* [[CALL]], align 8 +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %call = call i64* @not_captured_but_returned_1(i64* %a) @@ -783,25 +781,25 @@ attributes #0 = { noinline nounwind uwtable } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR3]] = { noinline nounwind uwtable } -; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR5]] = { nofree noinline 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 } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { noinline nounwind uwtable } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { nofree noinline nosync nounwind uwtable willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { readonly } +; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { noinline nounwind readonly uwtable } +; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { nounwind readonly } +; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { nofree nosync nounwind willreturn writeonly } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { nofree 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 } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { noinline nounwind uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR5]] = { nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR6]] = { readonly } +; NOT_TUNIT_NPM: attributes #[[ATTR7]] = { noinline nounwind readonly uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR8]] = { nounwind readonly } +; NOT_TUNIT_NPM: attributes #[[ATTR9]] = { nounwind willreturn writeonly } ;. diff --git a/llvm/test/Transforms/Attributor/nodelete.ll b/llvm/test/Transforms/Attributor/nodelete.ll --- a/llvm/test/Transforms/Attributor/nodelete.ll +++ b/llvm/test/Transforms/Attributor/nodelete.ll @@ -1,25 +1,23 @@ ; 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=18 -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=18 -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 %"a" = type { i64 } %"b" = type { i8 } define hidden i64 @f1() align 2 { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@f1 -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] align 2 { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i64 undef +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] align 2 { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i64 undef ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] align 2 { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[REF_TMP:%.*]] = alloca [[A:%.*]], align 8 -; IS__CGSCC____-NEXT: ret i64 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] align 2 { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[REF_TMP:%.*]] = alloca [[A:%.*]], align 8 +; NOT_TUNIT_NPM-NEXT: ret i64 undef ; entry: %ref.tmp = alloca %"a", align 8 @@ -28,11 +26,11 @@ } define internal i64 @f2(%"a"* %this) align 2 { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@f2 -; IS__CGSCC____-SAME: () #[[ATTR0]] align 2 { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i64 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] align 2 { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i64 undef ; entry: %this.addr = alloca %"a"*, align 8 @@ -44,11 +42,11 @@ } define internal void @f3(%"b"* %this) align 2 { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@f3 -; IS__CGSCC____-SAME: () #[[ATTR0]] align 2 { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] align 2 { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %this.addr = alloca %"b"*, align 8 @@ -59,11 +57,11 @@ } define internal i1 @f4(%"b"* %this) align 2 { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@f4 -; IS__CGSCC____-SAME: () #[[ATTR0]] align 2 { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i1 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f4 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] align 2 { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i1 undef ; entry: %this.addr = alloca %"b"*, align 8 @@ -74,11 +72,11 @@ } define internal %"a"* @f5(%"b"* %this) align 2 { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@f5 -; IS__CGSCC____-SAME: () #[[ATTR0]] align 2 { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret %a* undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f5 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] align 2 { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret %a* undef ; entry: %this.addr = alloca %"b"*, align 8 @@ -88,7 +86,7 @@ ret %"a"* %0 } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/nofree.ll b/llvm/test/Transforms/Attributor/nofree.ll --- a/llvm/test/Transforms/Attributor/nofree.ll +++ b/llvm/test/Transforms/Attributor/nofree.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=3 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -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 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -17,15 +15,15 @@ ; TEST 1 (positive case) define void @only_return() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@only_return -; IS__TUNIT____-SAME: () #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@only_return +; NOT_CGSCC_NPM-SAME: () #[[ATTR3:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@only_return -; IS__CGSCC____-SAME: () #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@only_return +; NOT_TUNIT_NPM-SAME: () #[[ATTR3:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret void ; ret void } @@ -116,10 +114,10 @@ ; NOT_CGSCC_NPM-SAME: () #[[ATTR4:[0-9]+]] { ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__CGSCC_NPM-SAME: () #[[ATTR4:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@mutual_recursion1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR4:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; call void @mutual_recursion2() ret void @@ -131,10 +129,10 @@ ; NOT_CGSCC_NPM-SAME: () #[[ATTR4]] { ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__CGSCC_NPM-SAME: () #[[ATTR4]] { -; IS__CGSCC_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@mutual_recursion2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; call void @mutual_recursion1() ret void @@ -194,15 +192,15 @@ declare void @nofree_function() nofree readnone #0 define void @call_nofree_function() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@call_nofree_function -; IS__TUNIT____-SAME: () #[[ATTR3]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@call_nofree_function +; NOT_CGSCC_NPM-SAME: () #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_nofree_function -; IS__CGSCC____-SAME: () #[[ATTR3]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@call_nofree_function +; NOT_TUNIT_NPM-SAME: () #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: ret void ; tail call void @nofree_function() ret void @@ -252,32 +250,32 @@ declare float @llvm.floor.f32(float) define void @call_floor(float %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@call_floor -; IS__TUNIT____-SAME: (float [[A:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: ret void +; 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:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_floor -; IS__CGSCC____-SAME: (float [[A:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@call_floor +; NOT_TUNIT_NPM-SAME: (float [[A:%.*]]) #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: ret void ; tail call float @llvm.floor.f32(float %a) ret void } define float @call_floor2(float %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@call_floor2 -; IS__TUNIT____-SAME: (float [[A:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR11:[0-9]+]] -; IS__TUNIT____-NEXT: ret float [[C]] -; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_floor2 -; IS__CGSCC____-SAME: (float [[A:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR12:[0-9]+]] -; IS__CGSCC____-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:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR11:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret float [[C]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@call_floor2 +; NOT_TUNIT_NPM-SAME: (float [[A:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR12:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret float [[C]] ; %c = tail call float @llvm.floor.f32(float %a) ret float %c @@ -287,30 +285,30 @@ ; Check propagation. define void @f1() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@f1 -; IS__TUNIT____-SAME: () #[[ATTR3]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC____-SAME: () #[[ATTR3]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: ret void ; tail call void @nofree_function() ret void } define void @f2() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@f2 -; IS__TUNIT____-SAME: () #[[ATTR3]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR3]] { +; NOT_CGSCC_NPM-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 +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: ret void ; tail call void @f1() ret void @@ -318,21 +316,21 @@ ; TEST 12 NoFree argument - positive. define double @test12(double* nocapture readonly %a) { -; IS__TUNIT____: Function Attrs: nofree nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@test12 -; IS__TUNIT____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load double, double* [[A]], align 8 -; IS__TUNIT____-NEXT: [[CALL:%.*]] = tail call double @cos(double [[TMP0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: ret double [[CALL]] -; -; IS__CGSCC____: Function Attrs: nofree nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@test12 -; IS__CGSCC____-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load double, double* [[A]], align 8 -; IS__CGSCC____-NEXT: [[CALL:%.*]] = tail call double @cos(double [[TMP0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: ret double [[CALL]] +; NOT_CGSCC_NPM: Function Attrs: nofree nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test12 +; NOT_CGSCC_NPM-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load double, double* [[A]], align 8 +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = tail call double @cos(double [[TMP0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: ret double [[CALL]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test12 +; NOT_TUNIT_NPM-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load double, double* [[A]], align 8 +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = tail call double @cos(double [[TMP0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: ret double [[CALL]] ; entry: %0 = load double, double* %a, align 8 @@ -381,17 +379,17 @@ ; ATTRIBUTOR-NEXT: call void @unknown(i8* nofree [[ARG1]], i8* [[ARG2]], i8* nofree [[ARG3]], i8* [[ARG4]]) ; ATTRIBUTOR-NEXT: ret void ; -; IS__TUNIT____-LABEL: define {{[^@]+}}@nonnull_assume_pos -; IS__TUNIT____-SAME: (i8* nofree [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* nofree [[ARG3:%.*]], i8* [[ARG4:%.*]]) { -; IS__TUNIT____-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12:[0-9]+]] [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ] -; IS__TUNIT____-NEXT: call void @unknown(i8* nofree [[ARG1]], i8* [[ARG2]], i8* nofree [[ARG3]], i8* [[ARG4]]) -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_assume_pos +; NOT_CGSCC_NPM-SAME: (i8* nofree [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* nofree [[ARG3:%.*]], i8* [[ARG4:%.*]]) { +; NOT_CGSCC_NPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12:[0-9]+]] [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ] +; NOT_CGSCC_NPM-NEXT: call void @unknown(i8* nofree [[ARG1]], i8* [[ARG2]], i8* nofree [[ARG3]], i8* [[ARG4]]) +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@nonnull_assume_pos -; IS__CGSCC____-SAME: (i8* nofree [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* nofree [[ARG3:%.*]], i8* [[ARG4:%.*]]) { -; IS__CGSCC____-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR13:[0-9]+]] [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ] -; IS__CGSCC____-NEXT: call void @unknown(i8* nofree [[ARG1]], i8* [[ARG2]], i8* nofree [[ARG3]], i8* [[ARG4]]) -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@nonnull_assume_pos +; NOT_TUNIT_NPM-SAME: (i8* nofree [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* nofree [[ARG3:%.*]], i8* [[ARG4:%.*]]) { +; NOT_TUNIT_NPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR13:[0-9]+]] [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ] +; NOT_TUNIT_NPM-NEXT: call void @unknown(i8* nofree [[ARG1]], i8* [[ARG2]], i8* nofree [[ARG3]], i8* [[ARG4]]) +; NOT_TUNIT_NPM-NEXT: ret void ; call void @llvm.assume(i1 true) ["nofree"(i8* %arg1), "nofree"(i8* %arg3)] call void @unknown(i8* %arg1, i8* %arg2, i8* %arg3, i8* %arg4) @@ -469,47 +467,32 @@ attributes #1 = { nounwind } attributes #2 = { nobuiltin nounwind } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR1]] = { noinline nounwind uwtable } -; IS__TUNIT____: attributes #[[ATTR2]] = { nobuiltin nounwind } -; IS__TUNIT____: attributes #[[ATTR3]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR4]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR5:[0-9]+]] = { nofree noinline nounwind readnone uwtable } -; IS__TUNIT____: attributes #[[ATTR6:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__TUNIT____: attributes #[[ATTR7]] = { nofree nounwind } -; IS__TUNIT____: attributes #[[ATTR8:[0-9]+]] = { nobuiltin nofree nounwind } -; IS__TUNIT____: attributes #[[ATTR9:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR10:[0-9]+]] = { nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR11]] = { readnone willreturn } -; IS__TUNIT____: 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 nosync nounwind readnone uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nofree noinline noreturn 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_OPM: attributes #[[ATTR0]] = { nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { noinline nounwind uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nobuiltin nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR5:[0-9]+]] = { nofree noinline nounwind readnone uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR6:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR9:[0-9]+]] = { nobuiltin nofree nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR10:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR11:[0-9]+]] = { nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR12]] = { readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR13]] = { 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]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR5:[0-9]+]] = { nofree noinline nounwind readnone uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR6:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR8]] = { nofree nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR9:[0-9]+]] = { nobuiltin nofree nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR10:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR11:[0-9]+]] = { nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR12]] = { readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR13]] = { willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { noinline nounwind uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nobuiltin nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR5:[0-9]+]] = { nofree noinline nounwind readnone uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR6:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR7]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR8]] = { nofree nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR9:[0-9]+]] = { nobuiltin nofree nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR10:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR11:[0-9]+]] = { nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR12]] = { readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR13]] = { willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/nonnull.ll b/llvm/test/Transforms/Attributor/nonnull.ll --- a/llvm/test/Transforms/Attributor/nonnull.ll +++ b/llvm/test/Transforms/Attributor/nonnull.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=14 -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=14 -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 @@ -22,41 +20,30 @@ ; Return a pointer trivially nonnull (argument attribute) define i8* @test2(i8* nonnull %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT____-SAME: (i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i8* [[P]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_CGSCC_NPM-SAME: (i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i8* [[P]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC____-SAME: (i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i8* [[P]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_TUNIT_NPM-SAME: (i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret i8* [[P]] ; ret i8* %p } define i8* @test2A(i1 %c, i8* %ret) { -; NOT_CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test2A -; NOT_CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] -; NOT_CGSCC_OPM: A: -; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12:[0-9]+]] [ "nonnull"(i8* [[RET]]) ] -; NOT_CGSCC_OPM-NEXT: ret i8* [[RET]] -; NOT_CGSCC_OPM: B: -; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "nonnull"(i8* [[RET]]) ] -; NOT_CGSCC_OPM-NEXT: ret i8* [[RET]] -; -; IS__CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test2A -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] -; IS__CGSCC_OPM: A: -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR13:[0-9]+]] [ "nonnull"(i8* [[RET]]) ] -; IS__CGSCC_OPM-NEXT: ret i8* [[RET]] -; IS__CGSCC_OPM: B: -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR13]] [ "nonnull"(i8* [[RET]]) ] -; IS__CGSCC_OPM-NEXT: ret i8* [[RET]] +; CHECK: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@test2A +; CHECK-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] +; CHECK: A: +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12:[0-9]+]] [ "nonnull"(i8* [[RET]]) ] +; CHECK-NEXT: ret i8* [[RET]] +; CHECK: B: +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "nonnull"(i8* [[RET]]) ] +; CHECK-NEXT: ret i8* [[RET]] ; br i1 %c, label %A, label %B A: @@ -68,27 +55,16 @@ } define i8* @test2B(i1 %c, i8* %ret) { -; NOT_CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test2B -; NOT_CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0]] { -; NOT_CGSCC_OPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] -; NOT_CGSCC_OPM: A: -; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "dereferenceable"(i8* [[RET]], i32 4) ] -; NOT_CGSCC_OPM-NEXT: ret i8* [[RET]] -; NOT_CGSCC_OPM: B: -; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "dereferenceable"(i8* [[RET]], i32 4) ] -; NOT_CGSCC_OPM-NEXT: ret i8* [[RET]] -; -; IS__CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test2B -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] -; IS__CGSCC_OPM: A: -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR13]] [ "dereferenceable"(i8* [[RET]], i32 4) ] -; IS__CGSCC_OPM-NEXT: ret i8* [[RET]] -; IS__CGSCC_OPM: B: -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR13]] [ "dereferenceable"(i8* [[RET]], i32 4) ] -; IS__CGSCC_OPM-NEXT: ret i8* [[RET]] +; CHECK: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@test2B +; CHECK-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] +; CHECK: A: +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "dereferenceable"(i8* [[RET]], i32 4) ] +; CHECK-NEXT: ret i8* [[RET]] +; CHECK: B: +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "dereferenceable"(i8* [[RET]], i32 4) ] +; CHECK-NEXT: ret i8* [[RET]] ; br i1 %c, label %A, label %B A: @@ -102,23 +78,15 @@ ; Given an SCC where one of the functions can not be marked nonnull, ; can we still mark the other one which is trivially nonnull define i8* @scc_binder(i1 %c) { -; IS________OPM-LABEL: define {{[^@]+}}@scc_binder -; IS________OPM-SAME: (i1 [[C:%.*]]) { -; IS________OPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS________OPM: rec: -; IS________OPM-NEXT: [[TMP1:%.*]] = call i8* @test3(i1 [[C]]) -; IS________OPM-NEXT: br label [[END]] -; IS________OPM: end: -; IS________OPM-NEXT: ret i8* null -; -; IS________NPM-LABEL: define {{[^@]+}}@scc_binder -; IS________NPM-SAME: (i1 [[C:%.*]]) { -; IS________NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS________NPM: rec: -; IS________NPM-NEXT: [[TMP1:%.*]] = call i8* @test3(i1 noundef [[C]]) -; IS________NPM-NEXT: br label [[END]] -; IS________NPM: end: -; IS________NPM-NEXT: ret i8* null +; +; CHECK-LABEL: define {{[^@]+}}@scc_binder +; CHECK-SAME: (i1 [[C:%.*]]) { +; CHECK-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] +; CHECK: rec: +; CHECK-NEXT: [[TMP1:%.*]] = call i8* @test3(i1 noundef [[C]]) +; CHECK-NEXT: br label [[END]] +; CHECK: end: +; CHECK-NEXT: ret i8* null ; br i1 %c, label %rec, label %end rec: @@ -149,10 +117,10 @@ ; NOT_CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test4_helper -; IS__CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test4_helper +; NOT_TUNIT_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %ret = call i8* @test4() ret i8* %ret @@ -164,10 +132,10 @@ ; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test4 -; IS__CGSCC_NPM-SAME: () #[[ATTR2]] { -; IS__CGSCC_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test4 +; NOT_TUNIT_NPM-SAME: () #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %ret = call i8* @test4_helper() ret i8* %ret @@ -176,32 +144,23 @@ ; Given a mutual recursive set of functions which *can* return null ; make sure we haven't marked them as nonnull. define i8* @test5_helper(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test5_helper -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__TUNIT____: rec: -; IS__TUNIT____-NEXT: br label [[END]] -; IS__TUNIT____: end: -; IS__TUNIT____-NEXT: ret i8* null -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test5_helper -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__CGSCC_OPM: rec: -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: ret i8* null -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test5_helper -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__CGSCC_NPM: rec: -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret i8* null +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test5_helper +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; 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 +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test5_helper +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] +; NOT_TUNIT_NPM: rec: +; NOT_TUNIT_NPM-NEXT: br label [[END]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: ret i8* null ; br i1 %c, label %rec, label %end rec: @@ -212,20 +171,15 @@ } define i8* @test5(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test5 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8* null -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test5 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__CGSCC_OPM-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:%.*]]) #[[ATTR1]] { +; 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 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test5 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i8* null ; %ret = call i8* @test5_helper(i1 %c) ret i8* %ret @@ -234,27 +188,16 @@ ; Local analysis, but going through a self recursive phi define i8* @test6a() { ; -; NOT_CGSCC_OPM: Function Attrs: noreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test6a -; NOT_CGSCC_OPM-SAME: () #[[ATTR3:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: entry: -; NOT_CGSCC_OPM-NEXT: [[RET:%.*]] = call i8* @ret_nonnull() -; NOT_CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; NOT_CGSCC_OPM: loop: -; NOT_CGSCC_OPM-NEXT: unreachable -; NOT_CGSCC_OPM: exit: -; NOT_CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_OPM: Function Attrs: noreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test6a -; IS__CGSCC_OPM-SAME: () #[[ATTR4:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = call i8* @ret_nonnull() -; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_OPM: loop: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: exit: -; IS__CGSCC_OPM-NEXT: unreachable +; CHECK: Function Attrs: noreturn +; CHECK-LABEL: define {{[^@]+}}@test6a +; CHECK-SAME: () #[[ATTR3:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[RET:%.*]] = call i8* @ret_nonnull() +; CHECK-NEXT: br label [[LOOP:%.*]] +; CHECK: loop: +; CHECK-NEXT: unreachable +; CHECK: exit: +; CHECK-NEXT: unreachable ; entry: %ret = call i8* @ret_nonnull() @@ -289,70 +232,62 @@ } define i8* @test7(i8* %a) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test7 -; IS__TUNIT____-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8* [[A]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test7 +; NOT_CGSCC_NPM-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i8* [[A]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test7 -; IS__CGSCC____-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8* [[A]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test7 +; NOT_TUNIT_NPM-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i8* [[A]] ; %b = getelementptr inbounds i8, i8* %a, i64 0 ret i8* %b } define i8* @test8(i8* %a) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test8 -; IS__TUNIT____-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 1 -; IS__TUNIT____-NEXT: ret i8* [[B]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test8 -; IS__CGSCC____-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 1 -; IS__CGSCC____-NEXT: ret i8* [[B]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test8 +; NOT_CGSCC_NPM-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 1 +; NOT_CGSCC_NPM-NEXT: ret i8* [[B]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test8 +; NOT_TUNIT_NPM-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 1 +; NOT_TUNIT_NPM-NEXT: ret i8* [[B]] ; %b = getelementptr inbounds i8, i8* %a, i64 1 ret i8* %b } define i8* @test9(i8* %a, i64 %n) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test9 -; IS__TUNIT____-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] -; IS__TUNIT____-NEXT: ret i8* [[B]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test9 -; IS__CGSCC____-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] -; IS__CGSCC____-NEXT: ret i8* [[B]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test9 +; NOT_CGSCC_NPM-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] +; NOT_CGSCC_NPM-NEXT: ret i8* [[B]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test9 +; NOT_TUNIT_NPM-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] +; NOT_TUNIT_NPM-NEXT: ret i8* [[B]] ; %b = getelementptr inbounds i8, i8* %a, i64 %n ret i8* %b } -; ATTRIBUTOR_OPM: define i8* @test10 ; ATTRIBUTOR_NPM: define nonnull i8* @test10 define i8* @test10(i8* %a, i64 %n) { -; NOT_CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test10 -; NOT_CGSCC_OPM-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0]] { -; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] -; NOT_CGSCC_OPM-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] -; NOT_CGSCC_OPM-NEXT: ret i8* [[B]] -; -; IS__CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test10 -; IS__CGSCC_OPM-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR13]] -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] -; IS__CGSCC_OPM-NEXT: ret i8* [[B]] +; CHECK: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@test10 +; CHECK-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] +; CHECK-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] +; CHECK-NEXT: ret i8* [[B]] ; %cmp = icmp ne i64 %n, 0 call void @llvm.assume(i1 %cmp) @@ -406,19 +341,12 @@ ; Simple Argument Tests declare i8* @unknown() define void @test13_helper() { -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test13_helper() { -; NOT_CGSCC_OPM-NEXT: [[NONNULLPTR:%.*]] = tail call nonnull i8* @ret_nonnull() -; NOT_CGSCC_OPM-NEXT: [[MAYBENULLPTR:%.*]] = tail call i8* @unknown() -; NOT_CGSCC_OPM-NEXT: tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]]) #[[ATTR4:[0-9]+]] -; NOT_CGSCC_OPM-NEXT: tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13_helper() { -; IS__CGSCC_OPM-NEXT: [[NONNULLPTR:%.*]] = tail call nonnull i8* @ret_nonnull() -; IS__CGSCC_OPM-NEXT: [[MAYBENULLPTR:%.*]] = tail call i8* @unknown() -; IS__CGSCC_OPM-NEXT: tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]]) #[[ATTR5:[0-9]+]] -; IS__CGSCC_OPM-NEXT: tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@test13_helper() { +; CHECK-NEXT: [[NONNULLPTR:%.*]] = tail call nonnull i8* @ret_nonnull() +; CHECK-NEXT: [[MAYBENULLPTR:%.*]] = tail call i8* @unknown() +; CHECK-NEXT: tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]]) #[[ATTR4:[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]]) #[[ATTR4]] +; CHECK-NEXT: ret void ; %nonnullptr = tail call i8* @ret_nonnull() %maybenullptr = tail call i8* @unknown() @@ -428,21 +356,13 @@ } define internal void @test13(i8* %a, i8* %b, i8* %c) { ; -; NOT_CGSCC_OPM: Function Attrs: nounwind -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test13 -; NOT_CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone [[A:%.*]], i8* noalias nocapture nofree readnone [[B:%.*]], i8* noalias nocapture nofree readnone [[C:%.*]]) #[[ATTR4]] { -; NOT_CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[B]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[C]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13 -; IS__CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone [[A:%.*]], i8* noalias nocapture nofree readnone [[B:%.*]], i8* noalias nocapture nofree readnone [[C:%.*]]) #[[ATTR5]] { -; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[B]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[C]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: nounwind +; CHECK-LABEL: define {{[^@]+}}@test13 +; CHECK-SAME: (i8* noalias nocapture nofree nonnull readnone [[A:%.*]], i8* noalias nocapture nofree readnone [[B:%.*]], i8* noalias nocapture nofree readnone [[C:%.*]]) #[[ATTR4]] { +; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR4]] +; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[B]]) #[[ATTR4]] +; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[C]]) #[[ATTR4]] +; CHECK-NEXT: ret void ; call void @use_i8_ptr(i8* %a) call void @use_i8_ptr(i8* %b) @@ -466,49 +386,27 @@ define internal i32* @f1(i32* %arg) { ; FIXME: missing nonnull It should be nonnull @f1(i32* nonnull readonly %arg) -; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f1 -; NOT_CGSCC_OPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: bb: -; NOT_CGSCC_OPM-NEXT: [[TMP:%.*]] = icmp eq i32* [[ARG]], null -; NOT_CGSCC_OPM-NEXT: br i1 [[TMP]], label [[BB9:%.*]], label [[BB1:%.*]] -; NOT_CGSCC_OPM: bb1: -; NOT_CGSCC_OPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARG]], align 4 -; NOT_CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP2]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[BB6:%.*]], label [[BB4:%.*]] -; NOT_CGSCC_OPM: bb4: -; NOT_CGSCC_OPM-NEXT: [[TMP5:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 1 -; NOT_CGSCC_OPM-NEXT: [[TMP5B:%.*]] = tail call i32* @f3(i32* nofree nonnull readonly [[TMP5]]) #[[ATTR13:[0-9]+]] -; NOT_CGSCC_OPM-NEXT: [[TMP5C:%.*]] = getelementptr inbounds i32, i32* [[TMP5B]], i64 -1 -; NOT_CGSCC_OPM-NEXT: br label [[BB9]] -; NOT_CGSCC_OPM: bb6: -; NOT_CGSCC_OPM-NEXT: [[TMP7:%.*]] = tail call i32* @f2(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR13]] -; NOT_CGSCC_OPM-NEXT: ret i32* [[TMP7]] -; NOT_CGSCC_OPM: bb9: -; NOT_CGSCC_OPM-NEXT: [[TMP10:%.*]] = phi i32* [ [[TMP5C]], [[BB4]] ], [ inttoptr (i64 4 to i32*), [[BB:%.*]] ] -; NOT_CGSCC_OPM-NEXT: ret i32* [[TMP10]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC_OPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = icmp eq i32* [[ARG]], null -; IS__CGSCC_OPM-NEXT: br i1 [[TMP]], label [[BB9:%.*]], label [[BB1:%.*]] -; IS__CGSCC_OPM: bb1: -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARG]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP2]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[BB6:%.*]], label [[BB4:%.*]] -; IS__CGSCC_OPM: bb4: -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 1 -; IS__CGSCC_OPM-NEXT: [[TMP5B:%.*]] = tail call i32* @f3(i32* nofree nonnull readonly [[TMP5]]) #[[ATTR14:[0-9]+]] -; IS__CGSCC_OPM-NEXT: [[TMP5C:%.*]] = getelementptr inbounds i32, i32* [[TMP5B]], i64 -1 -; IS__CGSCC_OPM-NEXT: br label [[BB9]] -; IS__CGSCC_OPM: bb6: -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = tail call i32* @f2(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR14]] -; IS__CGSCC_OPM-NEXT: ret i32* [[TMP7]] -; IS__CGSCC_OPM: bb9: -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = phi i32* [ [[TMP5C]], [[BB4]] ], [ inttoptr (i64 4 to i32*), [[BB:%.*]] ] -; IS__CGSCC_OPM-NEXT: ret i32* [[TMP10]] +; CHECK: Function Attrs: argmemonly nofree nosync nounwind readonly +; CHECK-LABEL: define {{[^@]+}}@f1 +; CHECK-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR5:[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]]) #[[ATTR13:[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]]) #[[ATTR13]] +; CHECK-NEXT: ret i32* [[TMP7]] +; CHECK: bb9: +; CHECK-NEXT: [[TMP10:%.*]] = phi i32* [ [[TMP5C]], [[BB4]] ], [ inttoptr (i64 4 to i32*), [[BB:%.*]] ] +; CHECK-NEXT: ret i32* [[TMP10]] ; bb: @@ -536,19 +434,12 @@ } define internal i32* @f2(i32* %arg) { -; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f2 -; NOT_CGSCC_OPM-SAME: (i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5]] { -; NOT_CGSCC_OPM-NEXT: bb: -; NOT_CGSCC_OPM-NEXT: [[TMP:%.*]] = tail call i32* @f1(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR13]] -; NOT_CGSCC_OPM-NEXT: ret i32* [[TMP]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f2 -; IS__CGSCC_OPM-SAME: (i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR6]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = tail call i32* @f1(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR14]] -; IS__CGSCC_OPM-NEXT: ret i32* [[TMP]] +; CHECK: Function Attrs: argmemonly nofree nosync nounwind readonly +; CHECK-LABEL: define {{[^@]+}}@f2 +; CHECK-SAME: (i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5]] { +; CHECK-NEXT: bb: +; CHECK-NEXT: [[TMP:%.*]] = tail call i32* @f1(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR13]] +; CHECK-NEXT: ret i32* [[TMP]] ; bb: %tmp = tail call i32* @f1(i32* %arg) @@ -557,19 +448,12 @@ define dso_local noalias i32* @f3(i32* %arg) { ; FIXME: missing nonnull. It should be nonnull @f3(i32* nonnull readonly %arg) -; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f3 -; NOT_CGSCC_OPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR5]] { -; NOT_CGSCC_OPM-NEXT: bb: -; NOT_CGSCC_OPM-NEXT: [[TMP:%.*]] = call i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR13]] -; NOT_CGSCC_OPM-NEXT: ret i32* [[TMP]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f3 -; IS__CGSCC_OPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR6]] { -; IS__CGSCC_OPM-NEXT: bb: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = call i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR14]] -; IS__CGSCC_OPM-NEXT: ret i32* [[TMP]] +; CHECK: Function Attrs: argmemonly nofree nosync nounwind readonly +; CHECK-LABEL: define {{[^@]+}}@f3 +; CHECK-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR5]] { +; CHECK-NEXT: bb: +; CHECK-NEXT: [[TMP:%.*]] = call i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR13]] +; CHECK-NEXT: ret i32* [[TMP]] ; bb: ; FIXME: missing nonnull. It should be @f1(i32* nonnull readonly %arg) @@ -600,29 +484,17 @@ ; fun2(nonnull %a, %b) ; We can say that %a is nonnull but %b is not. define void @f16(i8* %a, i8 * %b, i8 %c) { -; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f16 -; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR6:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; NOT_CGSCC_OPM: if.then: -; NOT_CGSCC_OPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* nonnull [[B]]) #[[ATTR6]] -; NOT_CGSCC_OPM-NEXT: ret void -; NOT_CGSCC_OPM: if.else: -; NOT_CGSCC_OPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) #[[ATTR6]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f16 -; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__CGSCC_OPM: if.then: -; IS__CGSCC_OPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* nonnull [[B]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: ret void -; IS__CGSCC_OPM: if.else: -; IS__CGSCC_OPM-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@f16 +; CHECK-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR6:[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]]) #[[ATTR6]] +; CHECK-NEXT: ret void +; CHECK: if.else: +; CHECK-NEXT: tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) #[[ATTR6]] +; CHECK-NEXT: ret void ; %cmp = icmp eq i8 %c, 0 br i1 %cmp, label %if.then, label %if.else @@ -642,35 +514,20 @@ ; We can say that %a is nonnull define void @f17(i8* %a, i8 %c) { ; -; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f17 -; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR6]] { -; NOT_CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; NOT_CGSCC_OPM: if.then: -; NOT_CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR6]] -; NOT_CGSCC_OPM-NEXT: br label [[CONT:%.*]] -; NOT_CGSCC_OPM: if.else: -; NOT_CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR6]] -; NOT_CGSCC_OPM-NEXT: br label [[CONT]] -; NOT_CGSCC_OPM: cont: -; NOT_CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR6]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f17 -; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR7]] { -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__CGSCC_OPM: if.then: -; IS__CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: br label [[CONT:%.*]] -; IS__CGSCC_OPM: if.else: -; IS__CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: br label [[CONT]] -; IS__CGSCC_OPM: cont: -; IS__CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@f17 +; CHECK-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR6]] { +; 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() #[[ATTR6]] +; CHECK-NEXT: br label [[CONT:%.*]] +; CHECK: if.else: +; CHECK-NEXT: tail call void @fun0() #[[ATTR6]] +; CHECK-NEXT: br label [[CONT]] +; CHECK: cont: +; CHECK-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR6]] +; CHECK-NEXT: ret void ; %cmp = icmp eq i8 %c, 0 br i1 %cmp, label %if.then, label %if.else @@ -696,53 +553,29 @@ ; fun1(nonnull %a) define void @f18(i8* %a, i8* %b, i8 %c) { -; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f18 -; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR6]] { -; NOT_CGSCC_OPM-NEXT: [[CMP1:%.*]] = icmp eq i8 [[C]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[CMP1]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; NOT_CGSCC_OPM: if.then: -; NOT_CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR6]] -; NOT_CGSCC_OPM-NEXT: br label [[CONT:%.*]] -; NOT_CGSCC_OPM: if.else: -; NOT_CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR6]] -; NOT_CGSCC_OPM-NEXT: br label [[CONT]] -; NOT_CGSCC_OPM: cont: -; NOT_CGSCC_OPM-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 1 -; NOT_CGSCC_OPM-NEXT: br i1 [[CMP2]], label [[CONT_THEN:%.*]], label [[CONT_ELSE:%.*]] -; NOT_CGSCC_OPM: cont.then: -; NOT_CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR6]] -; NOT_CGSCC_OPM-NEXT: br label [[CONT2:%.*]] -; NOT_CGSCC_OPM: cont.else: -; NOT_CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR6]] -; NOT_CGSCC_OPM-NEXT: br label [[CONT2]] -; NOT_CGSCC_OPM: cont2: -; NOT_CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR6]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f18 -; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR7]] { -; IS__CGSCC_OPM-NEXT: [[CMP1:%.*]] = icmp eq i8 [[C]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP1]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__CGSCC_OPM: if.then: -; IS__CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: br label [[CONT:%.*]] -; IS__CGSCC_OPM: if.else: -; IS__CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: br label [[CONT]] -; IS__CGSCC_OPM: cont: -; IS__CGSCC_OPM-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 1 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP2]], label [[CONT_THEN:%.*]], label [[CONT_ELSE:%.*]] -; IS__CGSCC_OPM: cont.then: -; IS__CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: br label [[CONT2:%.*]] -; IS__CGSCC_OPM: cont.else: -; IS__CGSCC_OPM-NEXT: tail call void @fun0() #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: br label [[CONT2]] -; IS__CGSCC_OPM: cont2: -; IS__CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@f18 +; CHECK-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR6]] { +; 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() #[[ATTR6]] +; CHECK-NEXT: br label [[CONT:%.*]] +; CHECK: if.else: +; CHECK-NEXT: tail call void @fun0() #[[ATTR6]] +; 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]]) #[[ATTR6]] +; CHECK-NEXT: br label [[CONT2:%.*]] +; CHECK: cont.else: +; CHECK-NEXT: tail call void @fun0() #[[ATTR6]] +; CHECK-NEXT: br label [[CONT2]] +; CHECK: cont2: +; CHECK-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR6]] +; CHECK-NEXT: ret void ; %cmp1 = icmp eq i8 %c, 0 br i1 %cmp1, label %if.then, label %if.else @@ -769,35 +602,20 @@ ; TEST 19: Loop define void @f19(i8* %a, i8* %b, i8 %c) { -; NOT_CGSCC_OPM: Function Attrs: nounwind -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f19 -; NOT_CGSCC_OPM-SAME: (i8* [[A:%.*]], i8* nonnull [[B:%.*]], i8 [[C:%.*]]) #[[ATTR4]] { -; NOT_CGSCC_OPM-NEXT: br label [[LOOP_HEADER:%.*]] -; NOT_CGSCC_OPM: loop.header: -; NOT_CGSCC_OPM-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[CMP2]], label [[LOOP_BODY:%.*]], label [[LOOP_EXIT:%.*]] -; NOT_CGSCC_OPM: loop.body: -; NOT_CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: br label [[LOOP_HEADER]] -; NOT_CGSCC_OPM: loop.exit: -; NOT_CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f19 -; IS__CGSCC_OPM-SAME: (i8* [[A:%.*]], i8* nonnull [[B:%.*]], i8 [[C:%.*]]) #[[ATTR5]] { -; IS__CGSCC_OPM-NEXT: br label [[LOOP_HEADER:%.*]] -; IS__CGSCC_OPM: loop.header: -; IS__CGSCC_OPM-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP2]], label [[LOOP_BODY:%.*]], label [[LOOP_EXIT:%.*]] -; IS__CGSCC_OPM: loop.body: -; IS__CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: br label [[LOOP_HEADER]] -; IS__CGSCC_OPM: loop.exit: -; IS__CGSCC_OPM-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: nounwind +; CHECK-LABEL: define {{[^@]+}}@f19 +; CHECK-SAME: (i8* [[A:%.*]], i8* nonnull [[B:%.*]], i8 [[C:%.*]]) #[[ATTR4]] { +; 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]]) #[[ATTR4]] +; CHECK-NEXT: tail call void @fun1(i8* nonnull [[A]]) #[[ATTR4]] +; CHECK-NEXT: br label [[LOOP_HEADER]] +; CHECK: loop.exit: +; CHECK-NEXT: tail call void @fun1(i8* nonnull [[B]]) #[[ATTR4]] +; CHECK-NEXT: ret void ; br label %loop.header loop.header: @@ -930,17 +748,11 @@ ; The nonnull callsite is guaranteed to execute, so the argument must be nonnull throughout the parent. define i8 @parent7(i8* %a) { -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@parent7 -; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]]) { -; NOT_CGSCC_OPM-NEXT: [[RET:%.*]] = call i8 @use1safecall(i8* nonnull readonly [[A]]) #[[ATTR14:[0-9]+]] -; NOT_CGSCC_OPM-NEXT: call void @use1nonnull(i8* nonnull [[A]]) -; NOT_CGSCC_OPM-NEXT: ret i8 [[RET]] -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@parent7 -; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]]) { -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = call i8 @use1safecall(i8* nonnull readonly [[A]]) #[[ATTR15:[0-9]+]] -; IS__CGSCC_OPM-NEXT: call void @use1nonnull(i8* nonnull [[A]]) -; IS__CGSCC_OPM-NEXT: ret i8 [[RET]] +; CHECK-LABEL: define {{[^@]+}}@parent7 +; CHECK-SAME: (i8* nonnull [[A:%.*]]) { +; CHECK-NEXT: [[RET:%.*]] = call i8 @use1safecall(i8* nonnull readonly [[A]]) #[[ATTR14:[0-9]+]] +; CHECK-NEXT: call void @use1nonnull(i8* nonnull [[A]]) +; CHECK-NEXT: ret i8 [[RET]] ; @@ -954,31 +766,18 @@ declare i32 @esfp(...) define i1 @parent8(i8* %a, i8* %bogus1, i8* %b) personality i8* bitcast (i32 (...)* @esfp to i8*){ -; NOT_CGSCC_OPM: Function Attrs: nounwind -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@parent8 -; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* nocapture nofree readnone [[BOGUS1:%.*]], i8* nonnull [[B:%.*]]) #[[ATTR4]] personality i8* bitcast (i32 (...)* @esfp to i8*) { -; NOT_CGSCC_OPM-NEXT: entry: -; NOT_CGSCC_OPM-NEXT: invoke void @use2nonnull(i8* nonnull [[A]], i8* nonnull [[B]]) -; NOT_CGSCC_OPM-NEXT: to label [[CONT:%.*]] unwind label [[EXC:%.*]] -; NOT_CGSCC_OPM: cont: -; NOT_CGSCC_OPM-NEXT: ret i1 false -; NOT_CGSCC_OPM: exc: -; NOT_CGSCC_OPM-NEXT: [[LP:%.*]] = landingpad { i8*, i32 } -; NOT_CGSCC_OPM-NEXT: filter [0 x i8*] zeroinitializer -; NOT_CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@parent8 -; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* nocapture nofree readnone [[BOGUS1:%.*]], i8* nonnull [[B:%.*]]) #[[ATTR5]] personality i8* bitcast (i32 (...)* @esfp to i8*) { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: invoke void @use2nonnull(i8* nonnull [[A]], i8* nonnull [[B]]) -; IS__CGSCC_OPM-NEXT: to label [[CONT:%.*]] unwind label [[EXC:%.*]] -; IS__CGSCC_OPM: cont: -; IS__CGSCC_OPM-NEXT: ret i1 false -; IS__CGSCC_OPM: exc: -; IS__CGSCC_OPM-NEXT: [[LP:%.*]] = landingpad { i8*, i32 } -; IS__CGSCC_OPM-NEXT: filter [0 x i8*] zeroinitializer -; IS__CGSCC_OPM-NEXT: unreachable +; CHECK: Function Attrs: nounwind +; CHECK-LABEL: define {{[^@]+}}@parent8 +; CHECK-SAME: (i8* nonnull [[A:%.*]], i8* nocapture nofree readnone [[BOGUS1:%.*]], i8* nonnull [[B:%.*]]) #[[ATTR4]] personality i8* bitcast (i32 (...)* @esfp to i8*) { +; CHECK-NEXT: entry: +; CHECK-NEXT: invoke void @use2nonnull(i8* nonnull [[A]], i8* nonnull [[B]]) +; CHECK-NEXT: to label [[CONT:%.*]] unwind label [[EXC:%.*]] +; CHECK: cont: +; CHECK-NEXT: ret i1 false +; CHECK: exc: +; CHECK-NEXT: [[LP:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: filter [0 x i8*] zeroinitializer +; CHECK-NEXT: unreachable ; entry: @@ -996,17 +795,17 @@ } define i32* @gep1(i32* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@gep1 -; IS__TUNIT____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 -; IS__TUNIT____-NEXT: ret i32* [[Q]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@gep1 -; IS__CGSCC____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 -; IS__CGSCC____-NEXT: ret i32* [[Q]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@gep1 +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 +; NOT_CGSCC_NPM-NEXT: ret i32* [[Q]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@gep1 +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 +; NOT_TUNIT_NPM-NEXT: ret i32* [[Q]] ; %q = getelementptr inbounds i32, i32* %p, i32 1 ret i32* %q @@ -1014,40 +813,34 @@ define i32* @gep1_no_null_opt(i32* %p) #0 { ; Should't be able to derive nonnull based on gep. -; IS__TUNIT____: Function Attrs: nofree nosync nounwind null_pointer_is_valid readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@gep1_no_null_opt -; IS__TUNIT____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__TUNIT____-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 -; IS__TUNIT____-NEXT: ret i32* [[Q]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@gep1_no_null_opt -; IS__CGSCC_OPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 -; IS__CGSCC_OPM-NEXT: ret i32* [[Q]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@gep1_no_null_opt -; IS__CGSCC_NPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 -; IS__CGSCC_NPM-NEXT: ret i32* [[Q]] +; NOT_CGSCC_NPM: Function Attrs: nofree 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]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@gep1_no_null_opt +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 +; NOT_TUNIT_NPM-NEXT: ret i32* [[Q]] ; %q = getelementptr inbounds i32, i32* %p, i32 1 ret i32* %q } define i32 addrspace(3)* @gep2(i32 addrspace(3)* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@gep2 -; IS__TUNIT____-SAME: (i32 addrspace(3)* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32 addrspace(3)* [[P]], i32 1 -; IS__TUNIT____-NEXT: ret i32 addrspace(3)* [[Q]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@gep2 -; IS__CGSCC____-SAME: (i32 addrspace(3)* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32 addrspace(3)* [[P]], i32 1 -; IS__CGSCC____-NEXT: ret i32 addrspace(3)* [[Q]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@gep2 +; NOT_CGSCC_NPM-SAME: (i32 addrspace(3)* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32 addrspace(3)* [[P]], i32 1 +; NOT_CGSCC_NPM-NEXT: ret i32 addrspace(3)* [[Q]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@gep2 +; NOT_TUNIT_NPM-SAME: (i32 addrspace(3)* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32 addrspace(3)* [[P]], i32 1 +; NOT_TUNIT_NPM-NEXT: ret i32 addrspace(3)* [[Q]] ; %q = getelementptr inbounds i32, i32 addrspace(3)* %p, i32 1 ret i32 addrspace(3)* %q @@ -1055,39 +848,39 @@ ; FIXME: We should propagate dereferenceable here but *not* nonnull define i32 addrspace(3)* @as(i32 addrspace(3)* dereferenceable(4) %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@as -; IS__TUNIT____-SAME: (i32 addrspace(3)* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32 addrspace(3)* [[P]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@as +; NOT_CGSCC_NPM-SAME: (i32 addrspace(3)* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i32 addrspace(3)* [[P]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@as -; IS__CGSCC____-SAME: (i32 addrspace(3)* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 addrspace(3)* [[P]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@as +; NOT_TUNIT_NPM-SAME: (i32 addrspace(3)* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i32 addrspace(3)* [[P]] ; ret i32 addrspace(3)* %p } ; CHECK-NOT: @g2() define internal i32* @g2() { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@g2 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32* undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@g2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i32* undef ; ret i32* inttoptr (i64 4 to i32*) } define i32* @g1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@g1 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32* inttoptr (i64 4 to i32*) +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@g1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i32* inttoptr (i64 4 to i32*) ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@g1 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32* inttoptr (i64 4 to i32*) +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@g1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i32* inttoptr (i64 4 to i32*) ; %c = call i32* @g2() ret i32* %c @@ -1095,17 +888,11 @@ declare void @use_i32_ptr(i32* readnone nocapture) nounwind define internal void @called_by_weak(i32* %a) { -; NOT_CGSCC_OPM: Function Attrs: nounwind -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@called_by_weak -; NOT_CGSCC_OPM-SAME: (i32* noalias nocapture nonnull readnone [[A:%.*]]) #[[ATTR4]] { -; NOT_CGSCC_OPM-NEXT: call void @use_i32_ptr(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@called_by_weak -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nonnull readnone [[A:%.*]]) #[[ATTR5]] { -; IS__CGSCC_OPM-NEXT: call void @use_i32_ptr(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: nounwind +; CHECK-LABEL: define {{[^@]+}}@called_by_weak +; CHECK-SAME: (i32* noalias nocapture nonnull readnone [[A:%.*]]) #[[ATTR4]] { +; CHECK-NEXT: call void @use_i32_ptr(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR4]] +; CHECK-NEXT: ret void ; call void @use_i32_ptr(i32* %a) ret void @@ -1114,15 +901,10 @@ ; Check we do not annotate the function interface of this weak function. define weak_odr void @weak_caller(i32* nonnull %a) { ; -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@weak_caller -; NOT_CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]]) { -; NOT_CGSCC_OPM-NEXT: call void @called_by_weak(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@weak_caller -; IS__CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]]) { -; IS__CGSCC_OPM-NEXT: call void @called_by_weak(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@weak_caller +; CHECK-SAME: (i32* nonnull [[A:%.*]]) { +; CHECK-NEXT: call void @called_by_weak(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR4]] +; CHECK-NEXT: ret void ; call void @called_by_weak(i32* %a) ret void @@ -1130,34 +912,22 @@ ; Expect nonnull define internal void @control(i32* dereferenceable(4) %a) { -; NOT_CGSCC_OPM: Function Attrs: nounwind -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@control -; NOT_CGSCC_OPM-SAME: (i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR4]] { -; NOT_CGSCC_OPM-NEXT: call void @use_i32_ptr(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@control -; IS__CGSCC_OPM-SAME: (i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR5]] { -; IS__CGSCC_OPM-NEXT: call void @use_i32_ptr(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: nounwind +; CHECK-LABEL: define {{[^@]+}}@control +; CHECK-SAME: (i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR4]] { +; CHECK-NEXT: call void @use_i32_ptr(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR4]] +; CHECK-NEXT: ret void ; call void @use_i32_ptr(i32* %a) ret void } ; Avoid nonnull as we do not touch naked functions define internal void @naked(i32* dereferenceable(4) %a) naked { -; NOT_CGSCC_OPM: Function Attrs: naked -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@naked -; NOT_CGSCC_OPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR9:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: call void @use_i32_ptr(i32* [[A]]) -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: naked -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@naked -; IS__CGSCC_OPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR10:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @use_i32_ptr(i32* [[A]]) -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: naked +; CHECK-LABEL: define {{[^@]+}}@naked +; CHECK-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR9:[0-9]+]] { +; CHECK-NEXT: call void @use_i32_ptr(i32* [[A]]) +; CHECK-NEXT: ret void ; call void @use_i32_ptr(i32* %a) ret void @@ -1165,35 +935,22 @@ ; Avoid nonnull as we do not touch optnone define internal void @optnone(i32* dereferenceable(4) %a) optnone noinline { ; -; NOT_CGSCC_OPM: Function Attrs: noinline optnone -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@optnone -; NOT_CGSCC_OPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR10:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: call void @use_i32_ptr(i32* [[A]]) -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: noinline optnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@optnone -; IS__CGSCC_OPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR11:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @use_i32_ptr(i32* [[A]]) -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: noinline optnone +; CHECK-LABEL: define {{[^@]+}}@optnone +; CHECK-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR10:[0-9]+]] { +; CHECK-NEXT: call void @use_i32_ptr(i32* [[A]]) +; CHECK-NEXT: ret void ; call void @use_i32_ptr(i32* %a) ret void } define void @make_live(i32* nonnull dereferenceable(8) %a) { -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@make_live -; NOT_CGSCC_OPM-SAME: (i32* noundef nonnull align 16 dereferenceable(8) [[A:%.*]]) { -; NOT_CGSCC_OPM-NEXT: call void @naked(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) -; NOT_CGSCC_OPM-NEXT: call void @control(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: call void @optnone(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@make_live -; IS__CGSCC_OPM-SAME: (i32* noundef nonnull align 16 dereferenceable(8) [[A:%.*]]) { -; IS__CGSCC_OPM-NEXT: call void @naked(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) -; IS__CGSCC_OPM-NEXT: call void @control(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: call void @optnone(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) -; IS__CGSCC_OPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@make_live +; CHECK-SAME: (i32* noundef nonnull align 16 dereferenceable(8) [[A:%.*]]) { +; CHECK-NEXT: call void @naked(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) +; CHECK-NEXT: call void @control(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR4]] +; CHECK-NEXT: call void @optnone(i32* noundef nonnull align 16 dereferenceable(8) [[A]]) +; CHECK-NEXT: ret void ; call void @naked(i32* nonnull dereferenceable(8) align 16 %a) call void @control(i32* nonnull dereferenceable(8) align 16 %a) @@ -1212,53 +969,22 @@ declare i32 @g(i32*) willreturn nounwind define i32 @nonnull_exec_ctx_1(i32* %a, i32 %b) { ; -; IS__TUNIT_OPM: Function Attrs: nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1 -; IS__TUNIT_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR4]] { -; IS__TUNIT_OPM-NEXT: en: -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; IS__TUNIT_OPM: ex: -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP5]] -; IS__TUNIT_OPM: hd: -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; IS__TUNIT_OPM-NEXT: tail call void @h(i32* [[A]]) #[[ATTR4]] -; IS__TUNIT_OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; IS__TUNIT_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; IS__TUNIT_OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] -; -; IS________NPM: Function Attrs: nounwind willreturn -; IS________NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1 -; IS________NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] { -; 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]]) #[[ATTR6]] -; 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]]) #[[ATTR6]] -; 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__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1 -; IS__CGSCC_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] { -; IS__CGSCC_OPM-NEXT: en: -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; IS__CGSCC_OPM: ex: -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP5]] -; IS__CGSCC_OPM: hd: -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; IS__CGSCC_OPM-NEXT: tail call void @h(i32* [[A]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] +; +; CHECK: Function Attrs: nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1 +; CHECK-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] { +; 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]]) #[[ATTR6]] +; CHECK-NEXT: ret i32 [[TMP5]] +; CHECK: hd: +; CHECK-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] +; CHECK-NEXT: tail call void @h(i32* [[A]]) #[[ATTR6]] +; CHECK-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 +; CHECK-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] +; CHECK-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] ; en: %tmp3 = icmp eq i32 %b, 0 @@ -1278,59 +1004,24 @@ define i32 @nonnull_exec_ctx_1b(i32* %a, i32 %b) { ; -; IS__TUNIT_OPM: Function Attrs: nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b -; IS__TUNIT_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR4]] { -; IS__TUNIT_OPM-NEXT: en: -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; IS__TUNIT_OPM: ex: -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP5]] -; IS__TUNIT_OPM: hd: -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; IS__TUNIT_OPM-NEXT: tail call void @h(i32* [[A]]) #[[ATTR4]] -; IS__TUNIT_OPM-NEXT: br label [[HD2]] -; IS__TUNIT_OPM: hd2: -; IS__TUNIT_OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; IS__TUNIT_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; IS__TUNIT_OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] -; -; IS________NPM: Function Attrs: nounwind willreturn -; IS________NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b -; IS________NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] { -; 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]]) #[[ATTR6]] -; 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]]) #[[ATTR6]] -; 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__CGSCC_OPM: Function Attrs: nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b -; IS__CGSCC_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] { -; IS__CGSCC_OPM-NEXT: en: -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; IS__CGSCC_OPM: ex: -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP5]] -; IS__CGSCC_OPM: hd: -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; IS__CGSCC_OPM-NEXT: tail call void @h(i32* [[A]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: br label [[HD2]] -; IS__CGSCC_OPM: hd2: -; IS__CGSCC_OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] +; +; CHECK: Function Attrs: nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b +; CHECK-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] { +; 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]]) #[[ATTR6]] +; CHECK-NEXT: ret i32 [[TMP5]] +; CHECK: hd: +; CHECK-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] +; CHECK-NEXT: tail call void @h(i32* [[A]]) #[[ATTR6]] +; CHECK-NEXT: br label [[HD2]] +; CHECK: hd2: +; CHECK-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 +; CHECK-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] +; CHECK-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] ; en: %tmp3 = icmp eq i32 %b, 0 @@ -1353,37 +1044,21 @@ define i32 @nonnull_exec_ctx_2(i32* %a, i32 %b) willreturn nounwind { ; -; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2 -; NOT_CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] { -; NOT_CGSCC_OPM-NEXT: en: -; NOT_CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; NOT_CGSCC_OPM: ex: -; NOT_CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: ret i32 [[TMP5]] -; NOT_CGSCC_OPM: hd: -; NOT_CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; NOT_CGSCC_OPM-NEXT: tail call void @h(i32* nonnull [[A]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; NOT_CGSCC_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; NOT_CGSCC_OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] -; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2 -; IS__CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR7]] { -; IS__CGSCC_OPM-NEXT: en: -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; IS__CGSCC_OPM: ex: -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP5]] -; IS__CGSCC_OPM: hd: -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; IS__CGSCC_OPM-NEXT: tail call void @h(i32* nonnull [[A]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] +; CHECK: Function Attrs: nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2 +; CHECK-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] { +; 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]]) #[[ATTR4]] +; 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]]) #[[ATTR4]] +; CHECK-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 +; CHECK-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] +; CHECK-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] ; en: %tmp3 = icmp eq i32 %b, 0 @@ -1403,41 +1078,23 @@ define i32 @nonnull_exec_ctx_2b(i32* %a, i32 %b) willreturn nounwind { ; -; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b -; NOT_CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] { -; NOT_CGSCC_OPM-NEXT: en: -; NOT_CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; NOT_CGSCC_OPM: ex: -; NOT_CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: ret i32 [[TMP5]] -; NOT_CGSCC_OPM: hd: -; NOT_CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; NOT_CGSCC_OPM-NEXT: tail call void @h(i32* nonnull [[A]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: br label [[HD2]] -; NOT_CGSCC_OPM: hd2: -; NOT_CGSCC_OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; NOT_CGSCC_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; NOT_CGSCC_OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] -; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b -; IS__CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR7]] { -; IS__CGSCC_OPM-NEXT: en: -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] -; IS__CGSCC_OPM: ex: -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP5]] -; IS__CGSCC_OPM: hd: -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; IS__CGSCC_OPM-NEXT: tail call void @h(i32* nonnull [[A]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: br label [[HD2]] -; IS__CGSCC_OPM: hd2: -; IS__CGSCC_OPM-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] +; CHECK: Function Attrs: nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b +; CHECK-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] { +; 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]]) #[[ATTR4]] +; 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]]) #[[ATTR4]] +; CHECK-NEXT: br label [[HD2]] +; CHECK: hd2: +; CHECK-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 +; CHECK-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] +; CHECK-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] ; en: %tmp3 = icmp eq i32 %b, 0 @@ -1462,39 +1119,23 @@ declare void @sink(i32*) define void @PR43833(i32* %0, i32 %1) { -; IS________OPM-LABEL: define {{[^@]+}}@PR43833 -; IS________OPM-SAME: (i32* [[TMP0:%.*]], i32 [[TMP1:%.*]]) { -; IS________OPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP1]], 1 -; IS________OPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP7:%.*]] -; IS________OPM: 4: -; IS________OPM-NEXT: [[TMP5:%.*]] = zext i32 [[TMP1]] to i64 -; IS________OPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP5]] -; IS________OPM-NEXT: br label [[TMP8:%.*]] -; IS________OPM: 7: -; IS________OPM-NEXT: ret void -; IS________OPM: 8: -; IS________OPM-NEXT: [[TMP9:%.*]] = phi i32 [ 1, [[TMP4]] ], [ [[TMP10:%.*]], [[TMP8]] ] -; IS________OPM-NEXT: tail call void @sink(i32* [[TMP6]]) -; IS________OPM-NEXT: [[TMP10]] = add nuw nsw i32 [[TMP9]], 1 -; IS________OPM-NEXT: [[TMP11:%.*]] = icmp eq i32 [[TMP10]], [[TMP1]] -; IS________OPM-NEXT: br i1 [[TMP11]], label [[TMP7]], label [[TMP8]] -; -; IS________NPM-LABEL: define {{[^@]+}}@PR43833 -; IS________NPM-SAME: (i32* [[TMP0:%.*]], i32 [[TMP1:%.*]]) { -; IS________NPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP1]], 1 -; IS________NPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP7:%.*]] -; IS________NPM: 4: -; IS________NPM-NEXT: [[TMP5:%.*]] = zext i32 [[TMP1]] to i64 -; IS________NPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP5]] -; IS________NPM-NEXT: br label [[TMP8:%.*]] -; IS________NPM: 7: -; IS________NPM-NEXT: ret void -; IS________NPM: 8: -; IS________NPM-NEXT: [[TMP9:%.*]] = phi i32 [ 1, [[TMP4]] ], [ [[TMP10:%.*]], [[TMP8]] ] -; IS________NPM-NEXT: tail call void @sink(i32* nonnull [[TMP6]]) -; IS________NPM-NEXT: [[TMP10]] = add nuw nsw i32 [[TMP9]], 1 -; IS________NPM-NEXT: [[TMP11:%.*]] = icmp eq i32 [[TMP10]], [[TMP1]] -; IS________NPM-NEXT: br i1 [[TMP11]], label [[TMP7]], label [[TMP8]] +; +; CHECK-LABEL: define {{[^@]+}}@PR43833 +; CHECK-SAME: (i32* [[TMP0:%.*]], i32 [[TMP1:%.*]]) { +; CHECK-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP1]], 1 +; CHECK-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP7:%.*]] +; CHECK: 4: +; CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP1]] to i64 +; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP5]] +; CHECK-NEXT: br label [[TMP8:%.*]] +; CHECK: 7: +; CHECK-NEXT: ret void +; CHECK: 8: +; CHECK-NEXT: [[TMP9:%.*]] = phi i32 [ 1, [[TMP4]] ], [ [[TMP10:%.*]], [[TMP8]] ] +; CHECK-NEXT: tail call void @sink(i32* nonnull [[TMP6]]) +; CHECK-NEXT: [[TMP10]] = add nuw nsw i32 [[TMP9]], 1 +; CHECK-NEXT: [[TMP11:%.*]] = icmp eq i32 [[TMP10]], [[TMP1]] +; CHECK-NEXT: br i1 [[TMP11]], label [[TMP7]], label [[TMP8]] ; %3 = icmp sgt i32 %1, 1 br i1 %3, label %4, label %7 @@ -1517,39 +1158,23 @@ ; Adjusted from PR43833 define void @PR43833_simple(i32* %0, i32 %1) { -; IS________OPM-LABEL: define {{[^@]+}}@PR43833_simple -; IS________OPM-SAME: (i32* [[TMP0:%.*]], i32 [[TMP1:%.*]]) { -; IS________OPM-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP1]], 0 -; IS________OPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP7:%.*]] -; IS________OPM: 4: -; IS________OPM-NEXT: [[TMP5:%.*]] = zext i32 [[TMP1]] to i64 -; IS________OPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP5]] -; IS________OPM-NEXT: br label [[TMP8:%.*]] -; IS________OPM: 7: -; IS________OPM-NEXT: ret void -; IS________OPM: 8: -; IS________OPM-NEXT: [[TMP9:%.*]] = phi i32 [ 1, [[TMP4]] ], [ [[TMP10:%.*]], [[TMP8]] ] -; IS________OPM-NEXT: tail call void @sink(i32* [[TMP6]]) -; IS________OPM-NEXT: [[TMP10]] = add nuw nsw i32 [[TMP9]], 1 -; IS________OPM-NEXT: [[TMP11:%.*]] = icmp eq i32 [[TMP10]], [[TMP1]] -; IS________OPM-NEXT: br i1 [[TMP11]], label [[TMP7]], label [[TMP8]] -; -; IS________NPM-LABEL: define {{[^@]+}}@PR43833_simple -; IS________NPM-SAME: (i32* [[TMP0:%.*]], i32 [[TMP1:%.*]]) { -; IS________NPM-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP1]], 0 -; IS________NPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP7:%.*]] -; IS________NPM: 4: -; IS________NPM-NEXT: [[TMP5:%.*]] = zext i32 [[TMP1]] to i64 -; IS________NPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP5]] -; IS________NPM-NEXT: br label [[TMP8:%.*]] -; IS________NPM: 7: -; IS________NPM-NEXT: ret void -; IS________NPM: 8: -; IS________NPM-NEXT: [[TMP9:%.*]] = phi i32 [ 1, [[TMP4]] ], [ [[TMP10:%.*]], [[TMP8]] ] -; IS________NPM-NEXT: tail call void @sink(i32* nonnull [[TMP6]]) -; IS________NPM-NEXT: [[TMP10]] = add nuw nsw i32 [[TMP9]], 1 -; IS________NPM-NEXT: [[TMP11:%.*]] = icmp eq i32 [[TMP10]], [[TMP1]] -; IS________NPM-NEXT: br i1 [[TMP11]], label [[TMP7]], label [[TMP8]] +; +; CHECK-LABEL: define {{[^@]+}}@PR43833_simple +; CHECK-SAME: (i32* [[TMP0:%.*]], i32 [[TMP1:%.*]]) { +; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP1]], 0 +; CHECK-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP7:%.*]] +; CHECK: 4: +; CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP1]] to i64 +; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP5]] +; CHECK-NEXT: br label [[TMP8:%.*]] +; CHECK: 7: +; CHECK-NEXT: ret void +; CHECK: 8: +; CHECK-NEXT: [[TMP9:%.*]] = phi i32 [ 1, [[TMP4]] ], [ [[TMP10:%.*]], [[TMP8]] ] +; CHECK-NEXT: tail call void @sink(i32* nonnull [[TMP6]]) +; CHECK-NEXT: [[TMP10]] = add nuw nsw i32 [[TMP9]], 1 +; CHECK-NEXT: [[TMP11:%.*]] = icmp eq i32 [[TMP10]], [[TMP1]] +; CHECK-NEXT: br i1 [[TMP11]], label [[TMP7]], label [[TMP8]] ; %3 = icmp ne i32 %1, 0 br i1 %3, label %4, label %7 @@ -1574,23 +1199,14 @@ ; We should not mark the return of @strrchr as `nonnull`, it may well be NULL! define i8* @mybasename(i8* nofree readonly %str) { -; NOT_CGSCC_OPM: Function Attrs: nofree nounwind readonly willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@mybasename -; NOT_CGSCC_OPM-SAME: (i8* nofree readonly [[STR:%.*]]) #[[ATTR11:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: [[CALL:%.*]] = call i8* @strrchr(i8* nofree readonly [[STR]], i32 noundef 47) #[[ATTR14]] -; NOT_CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp ne i8* [[CALL]], null -; NOT_CGSCC_OPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[CALL]], i64 1 -; NOT_CGSCC_OPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i8* [[ADD_PTR]], i8* [[STR]] -; NOT_CGSCC_OPM-NEXT: ret i8* [[COND]] -; -; IS__CGSCC_OPM: Function Attrs: nofree nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@mybasename -; IS__CGSCC_OPM-SAME: (i8* nofree readonly [[STR:%.*]]) #[[ATTR12:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i8* @strrchr(i8* nofree readonly [[STR]], i32 noundef 47) #[[ATTR15]] -; IS__CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp ne i8* [[CALL]], null -; IS__CGSCC_OPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[CALL]], i64 1 -; IS__CGSCC_OPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i8* [[ADD_PTR]], i8* [[STR]] -; IS__CGSCC_OPM-NEXT: ret i8* [[COND]] +; CHECK: Function Attrs: nofree nounwind readonly willreturn +; CHECK-LABEL: define {{[^@]+}}@mybasename +; CHECK-SAME: (i8* nofree readonly [[STR:%.*]]) #[[ATTR11:[0-9]+]] { +; CHECK-NEXT: [[CALL:%.*]] = call i8* @strrchr(i8* nofree readonly [[STR]], i32 noundef 47) #[[ATTR14]] +; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i8* [[CALL]], null +; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[CALL]], i64 1 +; CHECK-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i8* [[ADD_PTR]], i8* [[STR]] +; CHECK-NEXT: ret i8* [[COND]] ; %call = call i8* @strrchr(i8* %str, i32 47) %tobool = icmp ne i8* %call, null @@ -1607,19 +1223,12 @@ ; ATTRIBUTOR-NEXT: [[TMP1:%.*]] = call i8* @unknown() ; ATTRIBUTOR-NEXT: ret void ; -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_pos -; NOT_CGSCC_OPM-SAME: (i8* nocapture nofree nonnull readnone [[ARG:%.*]]) { -; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "nonnull"(i8* [[ARG]]) ] -; NOT_CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: [[TMP1:%.*]] = call i8* @unknown() -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_pos -; IS__CGSCC_OPM-SAME: (i8* nocapture nofree nonnull readnone [[ARG:%.*]]) { -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR13]] [ "nonnull"(i8* [[ARG]]) ] -; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = call i8* @unknown() -; IS__CGSCC_OPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_pos +; CHECK-SAME: (i8* nocapture nofree nonnull readnone [[ARG:%.*]]) { +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "nonnull"(i8* [[ARG]]) ] +; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]] +; CHECK-NEXT: [[TMP1:%.*]] = call i8* @unknown() +; CHECK-NEXT: ret void ; call void @llvm.assume(i1 true) ["nonnull"(i8* %arg)] call void @use_i8_ptr(i8* %arg) @@ -1640,29 +1249,17 @@ ; ATTRIBUTOR-NEXT: ret void ; ; -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_neg -; NOT_CGSCC_OPM-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) { -; NOT_CGSCC_OPM-NEXT: [[TMP1:%.*]] = call i8* @unknown() -; NOT_CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ] -; NOT_CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: [[TMP2:%.*]] = call i8* @unknown() -; NOT_CGSCC_OPM-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ] -; NOT_CGSCC_OPM-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_neg -; IS__CGSCC_OPM-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) { -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = call i8* @unknown() -; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ] -; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = call i8* @unknown() -; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ] -; IS__CGSCC_OPM-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_neg +; CHECK-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) { +; CHECK-NEXT: [[TMP1:%.*]] = call i8* @unknown() +; CHECK-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG]]) #[[ATTR4]] +; 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]]) #[[ATTR4]] +; CHECK-NEXT: [[TMP2:%.*]] = call i8* @unknown() +; CHECK-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]] +; 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]]) #[[ATTR4]] +; CHECK-NEXT: ret void ; call i8* @unknown() call void @use_i8_ptr(i8* %arg) @@ -1678,15 +1275,15 @@ declare void @use_i8_ptr_ret(i8* nofree nocapture readnone) nounwind willreturn define i8* @nonnull_function_ptr_1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@nonnull_function_ptr_1 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8* bitcast (i8* ()* @nonnull_function_ptr_1 to i8*) +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_function_ptr_1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i8* bitcast (i8* ()* @nonnull_function_ptr_1 to i8*) ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nonnull_function_ptr_1 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8* bitcast (i8* ()* @nonnull_function_ptr_1 to i8*) +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@nonnull_function_ptr_1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i8* bitcast (i8* ()* @nonnull_function_ptr_1 to i8*) ; %bc = bitcast i8*()* @nonnull_function_ptr_1 to i8* ret i8* %bc @@ -1694,15 +1291,15 @@ declare i8* @function_decl() define i8* @nonnull_function_ptr_2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@nonnull_function_ptr_2 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8* bitcast (i8* ()* @function_decl to i8*) +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nonnull_function_ptr_2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i8* bitcast (i8* ()* @function_decl to i8*) ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@nonnull_function_ptr_2 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8* bitcast (i8* ()* @function_decl to i8*) +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@nonnull_function_ptr_2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i8* bitcast (i8* ()* @function_decl to i8*) ; %bc = bitcast i8*()* @function_decl to i8* ret i8* %bc @@ -1724,52 +1321,35 @@ attributes #0 = { null_pointer_is_valid } attributes #1 = { nounwind willreturn} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR3]] = { noreturn } -; IS__TUNIT____: attributes #[[ATTR4]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind readonly } -; IS__TUNIT____: attributes #[[ATTR6]] = { nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR7:[0-9]+]] = { nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR8]] = { nofree nosync nounwind null_pointer_is_valid readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR9]] = { naked } -; IS__TUNIT____: attributes #[[ATTR10]] = { noinline optnone } -; IS__TUNIT____: attributes #[[ATTR11]] = { nofree nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR12]] = { willreturn } -; IS__TUNIT____: attributes #[[ATTR13]] = { nofree nosync nounwind readonly } -; IS__TUNIT____: attributes #[[ATTR14]] = { readonly willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { noreturn } -; IS__CGSCC_OPM: attributes #[[ATTR5]] = { nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR6]] = { argmemonly nofree nosync nounwind readonly } -; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR8:[0-9]+]] = { nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR10]] = { naked } -; IS__CGSCC_OPM: attributes #[[ATTR11]] = { noinline optnone } -; IS__CGSCC_OPM: attributes #[[ATTR12]] = { nofree nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR13]] = { willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR14]] = { nofree nosync nounwind readonly } -; IS__CGSCC_OPM: attributes #[[ATTR15]] = { readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree noreturn 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 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]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { noreturn } -; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind readonly } -; IS__CGSCC_NPM: attributes #[[ATTR6]] = { nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR7:[0-9]+]] = { nounwind readonly willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR9]] = { naked } -; IS__CGSCC_NPM: attributes #[[ATTR10]] = { noinline optnone } -; IS__CGSCC_NPM: attributes #[[ATTR11]] = { nofree nounwind readonly willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR12]] = { willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR13]] = { nofree nosync nounwind readonly } -; IS__CGSCC_NPM: attributes #[[ATTR14]] = { readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { noreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind readonly } +; NOT_TUNIT_NPM: attributes #[[ATTR6]] = { nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR7:[0-9]+]] = { nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR9]] = { naked } +; NOT_TUNIT_NPM: attributes #[[ATTR10]] = { noinline optnone } +; NOT_TUNIT_NPM: attributes #[[ATTR11]] = { nofree nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR12]] = { willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR13]] = { nofree nosync nounwind readonly } +; NOT_TUNIT_NPM: attributes #[[ATTR14]] = { readonly willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/norecurse.ll b/llvm/test/Transforms/Attributor/norecurse.ll --- a/llvm/test/Transforms/Attributor/norecurse.ll +++ b/llvm/test/Transforms/Attributor/norecurse.ll @@ -1,89 +1,71 @@ ; 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-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM define i32 @leaf() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@leaf -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32 1 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@leaf +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i32 1 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@leaf -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32 1 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@leaf +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret i32 1 ; ret i32 1 } define i32 @self_rec() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@self_rec -; IS__TUNIT____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@self_rec +; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@self_rec -; IS__CGSCC____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@self_rec +; NOT_TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %a = call i32 @self_rec() ret i32 4 } define i32 @indirect_rec() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@indirect_rec -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@indirect_rec +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC_OPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@indirect_rec -; IS__CGSCC_OPM-SAME: () #[[ATTR2:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@indirect_rec -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@indirect_rec +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %a = call i32 @indirect_rec2() ret i32 %a } define i32 @indirect_rec2() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@indirect_rec2 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC_OPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@indirect_rec2 -; IS__CGSCC_OPM-SAME: () #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@indirect_rec2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@indirect_rec2 -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@indirect_rec2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %a = call i32 @indirect_rec() ret i32 %a } define i32 @extern() { -; NOT_CGSCC_OPM: Function Attrs: nosync readnone -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@extern -; NOT_CGSCC_OPM-SAME: () #[[ATTR2:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @k() -; NOT_CGSCC_OPM-NEXT: ret i32 [[A]] -; -; IS__CGSCC_OPM: Function Attrs: nosync readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@extern -; IS__CGSCC_OPM-SAME: () #[[ATTR3:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @k() -; IS__CGSCC_OPM-NEXT: ret i32 [[A]] +; CHECK: Function Attrs: nosync readnone +; CHECK-LABEL: define {{[^@]+}}@extern +; CHECK-SAME: () #[[ATTR2:[0-9]+]] { +; CHECK-NEXT: [[A:%.*]] = call i32 @k() +; CHECK-NEXT: ret i32 [[A]] ; %a = call i32 @k() ret i32 %a @@ -94,17 +76,11 @@ declare i32 @k() readnone define void @intrinsic(i8* %dest, i8* %src, i32 %len) { -; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@intrinsic -; NOT_CGSCC_OPM-SAME: (i8* nocapture nofree writeonly [[DEST:%.*]], i8* nocapture nofree readonly [[SRC:%.*]], i32 [[LEN:%.*]]) #[[ATTR4:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[DEST]], i8* noalias nocapture nofree readonly [[SRC]], i32 [[LEN]], i1 noundef false) #[[ATTR10:[0-9]+]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@intrinsic -; IS__CGSCC_OPM-SAME: (i8* nocapture nofree writeonly [[DEST:%.*]], i8* nocapture nofree readonly [[SRC:%.*]], i32 [[LEN:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[DEST]], i8* noalias nocapture nofree readonly [[SRC]], i32 [[LEN]], i1 noundef false) #[[ATTR11:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret void +; 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:%.*]]) #[[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) #[[ATTR10:[0-9]+]] +; CHECK-NEXT: ret void ; call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i1 false) ret void @@ -115,139 +91,95 @@ declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i1) define internal i32 @called_by_norecurse() { -; IS__TUNIT____: Function Attrs: nosync readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@called_by_norecurse -; IS__TUNIT____-SAME: () #[[ATTR2]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @k() -; IS__TUNIT____-NEXT: ret i32 undef -; -; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@called_by_norecurse -; IS__CGSCC_OPM-SAME: () #[[ATTR7:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @k() -; IS__CGSCC_OPM-NEXT: ret i32 undef -; -; IS__CGSCC_NPM: Function Attrs: norecurse nosync readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@called_by_norecurse -; IS__CGSCC_NPM-SAME: () #[[ATTR6:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @k() -; IS__CGSCC_NPM-NEXT: ret i32 undef +; NOT_CGSCC_NPM: Function Attrs: nosync readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@called_by_norecurse +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @k() +; NOT_CGSCC_NPM-NEXT: ret i32 undef +; +; NOT_TUNIT_NPM: Function Attrs: norecurse nosync readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@called_by_norecurse +; NOT_TUNIT_NPM-SAME: () #[[ATTR6:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = call i32 @k() +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %a = call i32 @k() ret i32 %a } define void @m() norecurse { -; IS__TUNIT____: Function Attrs: norecurse nosync readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@m -; IS__TUNIT____-SAME: () #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() #[[ATTR2]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@m -; IS__CGSCC_OPM-SAME: () #[[ATTR7]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: norecurse nosync readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@m -; IS__CGSCC_NPM-SAME: () #[[ATTR6]] { -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: norecurse nosync readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@m +; NOT_CGSCC_NPM-SAME: () #[[ATTR6:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: norecurse nosync readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@m +; NOT_TUNIT_NPM-SAME: () #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() +; NOT_TUNIT_NPM-NEXT: ret void ; %a = call i32 @called_by_norecurse() ret void } define internal i32 @called_by_norecurse_indirectly() { -; NOT_CGSCC_OPM: Function Attrs: nosync readnone -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@called_by_norecurse_indirectly -; NOT_CGSCC_OPM-SAME: () #[[ATTR2]] { -; NOT_CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @k() -; NOT_CGSCC_OPM-NEXT: ret i32 [[A]] -; -; IS__CGSCC_OPM: Function Attrs: nosync readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@called_by_norecurse_indirectly -; IS__CGSCC_OPM-SAME: () #[[ATTR3]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @k() -; IS__CGSCC_OPM-NEXT: ret i32 [[A]] +; CHECK: Function Attrs: nosync readnone +; CHECK-LABEL: define {{[^@]+}}@called_by_norecurse_indirectly +; CHECK-SAME: () #[[ATTR2]] { +; CHECK-NEXT: [[A:%.*]] = call i32 @k() +; CHECK-NEXT: ret i32 [[A]] ; %a = call i32 @k() ret i32 %a } define internal i32 @o() { -; IS__TUNIT____: Function Attrs: nosync readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@o -; IS__TUNIT____-SAME: () #[[ATTR2]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() #[[ATTR2]] -; IS__TUNIT____-NEXT: ret i32 [[A]] -; -; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@o -; IS__CGSCC_OPM-SAME: () #[[ATTR7]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() -; IS__CGSCC_OPM-NEXT: ret i32 [[A]] -; -; IS__CGSCC_NPM: Function Attrs: norecurse nosync readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@o -; IS__CGSCC_NPM-SAME: () #[[ATTR6]] { -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() -; IS__CGSCC_NPM-NEXT: ret i32 [[A]] +; NOT_CGSCC_NPM: Function Attrs: nosync readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@o +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[A]] +; +; NOT_TUNIT_NPM: Function Attrs: norecurse nosync readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@o +; NOT_TUNIT_NPM-SAME: () #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() +; NOT_TUNIT_NPM-NEXT: ret i32 [[A]] ; %a = call i32 @called_by_norecurse_indirectly() ret i32 %a } define i32 @p() norecurse { -; IS__TUNIT____: Function Attrs: norecurse nosync readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@p -; IS__TUNIT____-SAME: () #[[ATTR6]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = call i32 @o() #[[ATTR2]] -; IS__TUNIT____-NEXT: ret i32 [[A]] -; -; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@p -; IS__CGSCC_OPM-SAME: () #[[ATTR7]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = call i32 @o() -; IS__CGSCC_OPM-NEXT: ret i32 [[A]] -; -; IS__CGSCC_NPM: Function Attrs: norecurse nosync readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@p -; IS__CGSCC_NPM-SAME: () #[[ATTR6]] { -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @o() -; IS__CGSCC_NPM-NEXT: ret i32 [[A]] +; NOT_CGSCC_NPM: Function Attrs: norecurse nosync readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@p +; NOT_CGSCC_NPM-SAME: () #[[ATTR6]] { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = call i32 @o() #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[A]] +; +; NOT_TUNIT_NPM: Function Attrs: norecurse nosync readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@p +; NOT_TUNIT_NPM-SAME: () #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = call i32 @o() +; NOT_TUNIT_NPM-NEXT: ret i32 [[A]] ; %a = call i32 @o() ret i32 %a } define void @f(i32 %x) { -; NOT_CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f -; NOT_CGSCC_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR7:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: entry: -; NOT_CGSCC_OPM-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 -; NOT_CGSCC_OPM-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 -; NOT_CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 -; NOT_CGSCC_OPM-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; NOT_CGSCC_OPM: if.then: -; NOT_CGSCC_OPM-NEXT: call void @g() #[[ATTR8:[0-9]+]] -; NOT_CGSCC_OPM-NEXT: br label [[IF_END]] -; NOT_CGSCC_OPM: if.end: -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f -; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 -; IS__CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC_OPM: if.then: -; IS__CGSCC_OPM-NEXT: call void @g() #[[ATTR9:[0-9]+]] -; IS__CGSCC_OPM-NEXT: br label [[IF_END]] -; IS__CGSCC_OPM: if.end: -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: nofree nosync nounwind readnone +; CHECK-LABEL: define {{[^@]+}}@f +; CHECK-SAME: (i32 [[X:%.*]]) #[[ATTR7:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 +; CHECK-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 +; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 +; CHECK-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; CHECK: if.then: +; CHECK-NEXT: call void @g() #[[ATTR8:[0-9]+]] +; CHECK-NEXT: br label [[IF_END]] +; CHECK: if.end: +; CHECK-NEXT: ret void ; entry: %x.addr = alloca i32, align 4 @@ -265,19 +197,12 @@ } define void @g() norecurse { -; NOT_CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@g -; NOT_CGSCC_OPM-SAME: () #[[ATTR8]] { -; NOT_CGSCC_OPM-NEXT: entry: -; NOT_CGSCC_OPM-NEXT: call void @f(i32 noundef 0) #[[ATTR7]] -; NOT_CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@g -; IS__CGSCC_OPM-SAME: () #[[ATTR9]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: call void @f(i32 noundef 0) #[[ATTR8]] -; IS__CGSCC_OPM-NEXT: ret void +; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone +; CHECK-LABEL: define {{[^@]+}}@g +; CHECK-SAME: () #[[ATTR8]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: call void @f(i32 noundef 0) #[[ATTR7]] +; CHECK-NEXT: ret void ; entry: call void @f(i32 0) @@ -303,17 +228,11 @@ } define i32 @eval_func2(i32 (i32)* , i32) local_unnamed_addr null_pointer_is_valid{ -; NOT_CGSCC_OPM: Function Attrs: null_pointer_is_valid -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@eval_func2 -; NOT_CGSCC_OPM-SAME: (i32 (i32)* nocapture nofree noundef [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR9:[0-9]+]] { -; NOT_CGSCC_OPM-NEXT: [[TMP3:%.*]] = tail call i32 [[TMP0]](i32 [[TMP1]]) -; NOT_CGSCC_OPM-NEXT: ret i32 [[TMP3]] -; -; IS__CGSCC_OPM: Function Attrs: null_pointer_is_valid -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@eval_func2 -; IS__CGSCC_OPM-SAME: (i32 (i32)* nocapture nofree noundef [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR10:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = tail call i32 [[TMP0]](i32 [[TMP1]]) -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP3]] +; 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 #[[ATTR9:[0-9]+]] { +; CHECK-NEXT: [[TMP3:%.*]] = tail call i32 [[TMP0]](i32 [[TMP1]]) +; CHECK-NEXT: ret i32 [[TMP3]] ; %3 = tail call i32 %0(i32 %1) #2 ret i32 %3 @@ -322,19 +241,19 @@ ; Call an unknown function in a dead block. declare void @unknown() define i32 @call_unknown_in_dead_block() local_unnamed_addr { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@call_unknown_in_dead_block -; IS__TUNIT____-SAME: () local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 0 -; IS__TUNIT____: Dead: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_unknown_in_dead_block -; IS__CGSCC____-SAME: () local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 0 -; IS__CGSCC____: Dead: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@call_unknown_in_dead_block +; NOT_CGSCC_NPM-SAME: () local_unnamed_addr #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Dead: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@call_unknown_in_dead_block +; NOT_TUNIT_NPM-SAME: () local_unnamed_addr #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Dead: +; NOT_TUNIT_NPM-NEXT: unreachable ; ret i32 0 Dead: @@ -343,40 +262,27 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree noreturn nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nosync readnone } -; IS__TUNIT____: attributes #[[ATTR3:[0-9]+]] = { readnone } -; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR6]] = { norecurse nosync readnone } -; IS__TUNIT____: attributes #[[ATTR7]] = { nofree nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR9]] = { null_pointer_is_valid } -; IS__TUNIT____: attributes #[[ATTR10]] = { willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nosync readnone } -; IS__CGSCC_OPM: attributes #[[ATTR4:[0-9]+]] = { readnone } -; IS__CGSCC_OPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR6:[0-9]+]] = { argmemonly nofree nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR7]] = { norecurse nosync readnone } -; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree nosync nounwind readnone } -; IS__CGSCC_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC_OPM: attributes #[[ATTR10]] = { null_pointer_is_valid } -; IS__CGSCC_OPM: attributes #[[ATTR11]] = { willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree noreturn nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nosync readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR3:[0-9]+]] = { readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { norecurse nosync readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { null_pointer_is_valid } +; NOT_CGSCC_NPM: attributes #[[ATTR10]] = { willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nosync readnone } -; IS__CGSCC_NPM: attributes #[[ATTR3:[0-9]+]] = { readnone } -; IS__CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR6]] = { norecurse nosync readnone } -; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind readnone } -; IS__CGSCC_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC_NPM: attributes #[[ATTR9]] = { null_pointer_is_valid } -; IS__CGSCC_NPM: attributes #[[ATTR10]] = { willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nosync readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR3:[0-9]+]] = { readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR6]] = { norecurse nosync readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR9]] = { null_pointer_is_valid } +; NOT_TUNIT_NPM: attributes #[[ATTR10]] = { willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/noreturn.ll b/llvm/test/Transforms/Attributor/noreturn.ll --- a/llvm/test/Transforms/Attributor/noreturn.ll +++ b/llvm/test/Transforms/Attributor/noreturn.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 cases specifically designed for the "no-return" function attribute. @@ -17,17 +15,17 @@ ; } ; define void @srec0() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@srec0 -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@srec0 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@srec0 -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@srec0 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: call void @srec0() @@ -42,21 +40,21 @@ ; } ; define i32 @srec16(i32 %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@srec16 -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@srec16 +; NOT_CGSCC_NPM-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: exit: +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@srec16 -; IS__CGSCC____-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@srec16 +; NOT_TUNIT_NPM-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: exit: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: %call = call i32 @srec16(i32 %a) @@ -89,21 +87,21 @@ ; } ; define i32 @endless_loop(i32 %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@endless_loop -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[WHILE_BODY:%.*]] -; IS__TUNIT____: while.body: -; IS__TUNIT____-NEXT: br label [[WHILE_BODY]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@endless_loop +; NOT_CGSCC_NPM-SAME: (i32 [[A:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[WHILE_BODY:%.*]] +; NOT_CGSCC_NPM: while.body: +; NOT_CGSCC_NPM-NEXT: br label [[WHILE_BODY]] ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@endless_loop -; IS__CGSCC____-SAME: (i32 [[A:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[WHILE_BODY:%.*]] -; IS__CGSCC____: while.body: -; IS__CGSCC____-NEXT: br label [[WHILE_BODY]] +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@endless_loop +; NOT_TUNIT_NPM-SAME: (i32 [[A:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_BODY:%.*]] +; NOT_TUNIT_NPM: while.body: +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_BODY]] ; entry: br label %while.body @@ -122,25 +120,25 @@ ; ; FIXME: no-return missing (D65243 should fix this) define i32 @dead_return(i32 %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@dead_return -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[WHILE_BODY:%.*]] -; IS__TUNIT____: while.body: -; IS__TUNIT____-NEXT: br label [[WHILE_BODY]] -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@dead_return +; NOT_CGSCC_NPM-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[WHILE_BODY:%.*]] +; NOT_CGSCC_NPM: while.body: +; NOT_CGSCC_NPM-NEXT: br label [[WHILE_BODY]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@dead_return -; IS__CGSCC____-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[WHILE_BODY:%.*]] -; IS__CGSCC____: while.body: -; IS__CGSCC____-NEXT: br label [[WHILE_BODY]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@dead_return +; NOT_TUNIT_NPM-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_BODY:%.*]] +; NOT_TUNIT_NPM: while.body: +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_BODY]] +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: br label %while.body @@ -160,31 +158,31 @@ ; } ; define i32 @multiple_noreturn_calls(i32 %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@multiple_noreturn_calls -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; IS__TUNIT____: cond.true: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: cond.false: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: cond.end: -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@multiple_noreturn_calls +; NOT_CGSCC_NPM-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; NOT_CGSCC_NPM: cond.true: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: cond.false: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: cond.end: +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@multiple_noreturn_calls -; IS__CGSCC____-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; IS__CGSCC____: cond.true: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: cond.false: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: cond.end: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@multiple_noreturn_calls +; NOT_TUNIT_NPM-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; NOT_TUNIT_NPM: cond.true: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: cond.false: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: cond.end: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: %cmp = icmp eq i32 %a, 0 @@ -208,21 +206,21 @@ ; FIXME: we should derive "UB" as an argument and report it to the user on request. define i32 @endless_loop_but_willreturn() willreturn { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@endless_loop_but_willreturn -; IS__TUNIT____-SAME: () #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[WHILE_BODY:%.*]] -; IS__TUNIT____: while.body: -; IS__TUNIT____-NEXT: br label [[WHILE_BODY]] +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@endless_loop_but_willreturn +; NOT_CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[WHILE_BODY:%.*]] +; NOT_CGSCC_NPM: while.body: +; NOT_CGSCC_NPM-NEXT: br label [[WHILE_BODY]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@endless_loop_but_willreturn -; IS__CGSCC____-SAME: () #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[WHILE_BODY:%.*]] -; IS__CGSCC____: while.body: -; IS__CGSCC____-NEXT: br label [[WHILE_BODY]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@endless_loop_but_willreturn +; NOT_TUNIT_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_BODY:%.*]] +; NOT_TUNIT_NPM: while.body: +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_BODY]] ; entry: br label %while.body @@ -233,17 +231,17 @@ ; TEST 6b: willreturn means *not* no-return or UB define i32 @UB_and_willreturn() willreturn { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@UB_and_willreturn -; IS__TUNIT____-SAME: () #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@UB_and_willreturn +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@UB_and_willreturn -; IS__CGSCC____-SAME: () #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@UB_and_willreturn +; NOT_TUNIT_NPM-SAME: () #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: unreachable @@ -251,11 +249,11 @@ attributes #0 = { noinline nounwind uwtable } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } -; IS__CGSCC____: attributes #[[ATTR2]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/nosync.ll b/llvm/test/Transforms/Attributor/nosync.ll --- a/llvm/test/Transforms/Attributor/nosync.ll +++ b/llvm/test/Transforms/Attributor/nosync.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -32,19 +30,19 @@ ; CHECK: @[[A:[a-zA-Z0-9_$"\\.-]+]] = common global i32 0, align 4 ;. define i32* @foo(%struct.ST* %s) nounwind uwtable readnone optsize ssp { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind optsize readnone ssp uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (%struct.ST* nofree readnone "no-capture-maybe-returned" [[S:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], %struct.ST* [[S]], i64 1, i32 2, i32 1, i64 5, i64 13 -; IS__TUNIT____-NEXT: ret i32* [[ARRAYIDX]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind optsize readnone ssp uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (%struct.ST* nofree readnone "no-capture-maybe-returned" [[S:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], %struct.ST* [[S]], i64 1, i32 2, i32 1, i64 5, i64 13 -; IS__CGSCC____-NEXT: ret i32* [[ARRAYIDX]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind optsize readnone ssp uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo +; NOT_CGSCC_NPM-SAME: (%struct.ST* nofree readnone "no-capture-maybe-returned" [[S:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], %struct.ST* [[S]], i64 1, i32 2, i32 1, i64 5, i64 13 +; NOT_CGSCC_NPM-NEXT: ret i32* [[ARRAYIDX]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind optsize readnone ssp uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: (%struct.ST* nofree readnone "no-capture-maybe-returned" [[S:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], %struct.ST* [[S]], i64 1, i32 2, i32 1, i64 5, i64 13 +; NOT_TUNIT_NPM-NEXT: ret i32* [[ARRAYIDX]] ; entry: %arrayidx = getelementptr inbounds %struct.ST, %struct.ST* %s, i64 1, i32 2, i32 1, i64 5, i64 13 @@ -213,10 +211,10 @@ ; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] { ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@scc1 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@scc1 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; tail call void @scc2(i32* %0); %val = tail call i32 @volatile_load(i32* %0); @@ -229,10 +227,10 @@ ; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR5]] { ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@scc2 -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR5]] { -; IS__CGSCC_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@scc2 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR5]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; tail call i32 @scc1(i32* %0); ret void; @@ -258,23 +256,23 @@ %"struct.std::__atomic_base" = type { i8 } define void @foo1(i32* %0, %"struct.std::atomic"* %1) { -; IS__TUNIT____: Function Attrs: nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo1 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: store i32 100, i32* [[TMP0]], align 4 -; IS__TUNIT____-NEXT: fence release -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 -; IS__TUNIT____-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo1 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 100, i32* [[TMP0]], align 4 -; IS__CGSCC____-NEXT: fence release -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 -; IS__CGSCC____-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo1 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: store i32 100, i32* [[TMP0]], align 4 +; NOT_CGSCC_NPM-NEXT: fence release +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo1 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: store i32 100, i32* [[TMP0]], align 4 +; NOT_TUNIT_NPM-NEXT: fence release +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32 100, i32* %0, align 4 fence release @@ -284,33 +282,33 @@ } define void @bar(i32* %0, %"struct.std::atomic"* %1) { -; IS__TUNIT____: Function Attrs: nofree nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 -; IS__TUNIT____-NEXT: br label [[TMP4:%.*]] -; IS__TUNIT____: 4: -; IS__TUNIT____-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 -; IS__TUNIT____-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 -; IS__TUNIT____-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 -; IS__TUNIT____-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] -; IS__TUNIT____: 8: -; IS__TUNIT____-NEXT: fence acquire -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@bar -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 -; IS__CGSCC____-NEXT: br label [[TMP4:%.*]] -; IS__CGSCC____: 4: -; IS__CGSCC____-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 -; IS__CGSCC____-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 -; IS__CGSCC____-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 -; IS__CGSCC____-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] -; IS__CGSCC____: 8: -; IS__CGSCC____-NEXT: fence acquire -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bar +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: br label [[TMP4:%.*]] +; NOT_CGSCC_NPM: 4: +; NOT_CGSCC_NPM-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 +; NOT_CGSCC_NPM-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 +; NOT_CGSCC_NPM-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] +; NOT_CGSCC_NPM: 8: +; NOT_CGSCC_NPM-NEXT: fence acquire +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bar +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: br label [[TMP4:%.*]] +; NOT_TUNIT_NPM: 4: +; NOT_TUNIT_NPM-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 +; NOT_TUNIT_NPM-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 +; NOT_TUNIT_NPM-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] +; NOT_TUNIT_NPM: 8: +; NOT_TUNIT_NPM-NEXT: fence acquire +; NOT_TUNIT_NPM-NEXT: ret void ; %3 = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* %1, i64 0, i32 0, i32 0 br label %4 @@ -328,23 +326,23 @@ ; TEST 13 - Fence syncscope("singlethread") seq_cst define void @foo1_singlethread(i32* %0, %"struct.std::atomic"* %1) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo1_singlethread -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__TUNIT____-NEXT: store i32 100, i32* [[TMP0]], align 4 -; IS__TUNIT____-NEXT: fence syncscope("singlethread") release -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 -; IS__TUNIT____-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo1_singlethread -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 100, i32* [[TMP0]], align 4 -; IS__CGSCC____-NEXT: fence syncscope("singlethread") release -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 -; IS__CGSCC____-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo1_singlethread +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: store i32 100, i32* [[TMP0]], align 4 +; NOT_CGSCC_NPM-NEXT: fence syncscope("singlethread") release +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo1_singlethread +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: store i32 100, i32* [[TMP0]], align 4 +; NOT_TUNIT_NPM-NEXT: fence syncscope("singlethread") release +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32 100, i32* %0, align 4 fence syncscope("singlethread") release @@ -354,33 +352,33 @@ } define void @bar_singlethread(i32* %0, %"struct.std::atomic"* %1) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@bar_singlethread -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 -; IS__TUNIT____-NEXT: br label [[TMP4:%.*]] -; IS__TUNIT____: 4: -; IS__TUNIT____-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 -; IS__TUNIT____-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 -; IS__TUNIT____-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 -; IS__TUNIT____-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] -; IS__TUNIT____: 8: -; IS__TUNIT____-NEXT: fence syncscope("singlethread") acquire -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@bar_singlethread -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 -; IS__CGSCC____-NEXT: br label [[TMP4:%.*]] -; IS__CGSCC____: 4: -; IS__CGSCC____-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 -; IS__CGSCC____-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 -; IS__CGSCC____-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 -; IS__CGSCC____-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] -; IS__CGSCC____: 8: -; IS__CGSCC____-NEXT: fence syncscope("singlethread") acquire -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bar_singlethread +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR9:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: br label [[TMP4:%.*]] +; NOT_CGSCC_NPM: 4: +; NOT_CGSCC_NPM-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 +; NOT_CGSCC_NPM-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 +; NOT_CGSCC_NPM-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] +; NOT_CGSCC_NPM: 8: +; NOT_CGSCC_NPM-NEXT: fence syncscope("singlethread") acquire +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bar_singlethread +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR9:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: br label [[TMP4:%.*]] +; NOT_TUNIT_NPM: 4: +; NOT_TUNIT_NPM-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 +; NOT_TUNIT_NPM-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 +; NOT_TUNIT_NPM-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] +; NOT_TUNIT_NPM: 8: +; NOT_TUNIT_NPM-NEXT: fence syncscope("singlethread") acquire +; NOT_TUNIT_NPM-NEXT: ret void ; %3 = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* %1, i64 0, i32 0, i32 0 br label %4 @@ -404,17 +402,17 @@ ; It is odd to add nocapture but a result of the llvm.memcpy nocapture. ; define i32 @memcpy_volatile(i8* %ptr1, i8* %ptr2) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@memcpy_volatile -; IS__TUNIT____-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR10:[0-9]+]] { -; IS__TUNIT____-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[PTR1]], i8* noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR18:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 4 -; -; IS__CGSCC____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@memcpy_volatile -; IS__CGSCC____-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR10:[0-9]+]] { -; IS__CGSCC____-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[PTR1]], i8* noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR19:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 4 +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@memcpy_volatile +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR10:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[PTR1]], i8* noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR18:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 4 +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@memcpy_volatile +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR10:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[PTR1]], i8* noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR19:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 4 ; call void @llvm.memcpy(i8* %ptr1, i8* %ptr2, i32 8, i1 1) ret i32 4 @@ -425,17 +423,17 @@ ; It is odd to add nocapture but a result of the llvm.memset nocapture. ; define i32 @memset_non_volatile(i8* %ptr1, i8 %val) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@memset_non_volatile -; IS__TUNIT____-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR11:[0-9]+]] { -; IS__TUNIT____-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR19:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 4 -; -; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@memset_non_volatile -; IS__CGSCC____-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR11:[0-9]+]] { -; IS__CGSCC____-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR20:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 4 +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@memset_non_volatile +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR11:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR19:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 4 +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@memset_non_volatile +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR11:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR20:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 4 ; call void @llvm.memset(i8* %ptr1, i8 %val, i32 8, i1 0) ret i32 4 @@ -490,102 +488,79 @@ ; TEST 19 - positive, readnone & non-convergent intrinsic. define i32 @cos_test(float %x) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cos_test -; IS__TUNIT____-SAME: (float [[X:%.*]]) #[[ATTR15:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32 4 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@cos_test +; NOT_CGSCC_NPM-SAME: (float [[X:%.*]]) #[[ATTR15:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i32 4 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cos_test -; IS__CGSCC____-SAME: (float [[X:%.*]]) #[[ATTR15:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32 4 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cos_test +; NOT_TUNIT_NPM-SAME: (float [[X:%.*]]) #[[ATTR15:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret i32 4 ; call float @llvm.cos(float %x) ret i32 4 } define float @cos_test2(float %x) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cos_test2 -; IS__TUNIT____-SAME: (float [[X:%.*]]) #[[ATTR15]] { -; IS__TUNIT____-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) #[[ATTR20:[0-9]+]] -; IS__TUNIT____-NEXT: ret float [[C]] -; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cos_test2 -; IS__CGSCC____-SAME: (float [[X:%.*]]) #[[ATTR16:[0-9]+]] { -; IS__CGSCC____-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) #[[ATTR21:[0-9]+]] -; IS__CGSCC____-NEXT: ret float [[C]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@cos_test2 +; NOT_CGSCC_NPM-SAME: (float [[X:%.*]]) #[[ATTR15]] { +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) #[[ATTR20:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret float [[C]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cos_test2 +; NOT_TUNIT_NPM-SAME: (float [[X:%.*]]) #[[ATTR16:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) #[[ATTR21:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret float [[C]] ; %c = call float @llvm.cos(float %x) ret float %c } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind optsize readnone ssp uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { argmemonly nofree norecurse nounwind uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR3]] = { noinline nosync nounwind uwtable } -; IS__TUNIT____: attributes #[[ATTR4]] = { noinline nounwind uwtable } -; IS__TUNIT____: attributes #[[ATTR5]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR6]] = { nofree nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR7]] = { nofree nounwind } -; IS__TUNIT____: attributes #[[ATTR8]] = { nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR9]] = { nofree nosync nounwind } -; IS__TUNIT____: attributes #[[ATTR10]] = { argmemonly nofree nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR11]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR12:[0-9]+]] = { convergent readnone } -; IS__TUNIT____: attributes #[[ATTR13]] = { readnone } -; IS__TUNIT____: attributes #[[ATTR14]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR15]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR16:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR17:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__TUNIT____: attributes #[[ATTR18]] = { willreturn } -; IS__TUNIT____: attributes #[[ATTR19]] = { willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR20]] = { readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind optsize readnone ssp uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nounwind uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { noinline nosync nounwind uwtable } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { noinline nounwind uwtable } +; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { nofree nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { nofree nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { nofree nosync nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR10]] = { argmemonly nofree nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR11]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR12:[0-9]+]] = { convergent readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR13]] = { readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR14]] = { nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR15]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR16:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR17:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR18]] = { willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR19]] = { willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR20]] = { 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 } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nounwind uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { noinline nosync nounwind uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { noinline nounwind uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR5]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR6]] = { nofree norecurse nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nofree norecurse nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR10]] = { argmemonly nofree nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR11]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR12:[0-9]+]] = { convergent readnone } -; IS__CGSCC_OPM: attributes #[[ATTR13]] = { readnone } -; IS__CGSCC_OPM: attributes #[[ATTR14]] = { nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR15]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR16]] = { nofree nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR17:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR18:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR19]] = { willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR20]] = { willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR21]] = { readnone willreturn } -;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind optsize readnone ssp uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nounwind uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { noinline nosync nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR4]] = { noinline nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR5]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR6]] = { nofree norecurse nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree norecurse nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR10]] = { argmemonly nofree nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR11]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR12:[0-9]+]] = { convergent readnone } -; IS__CGSCC_NPM: attributes #[[ATTR13]] = { readnone } -; IS__CGSCC_NPM: attributes #[[ATTR14]] = { nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR15]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR16]] = { nofree nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR17:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR18:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR19]] = { willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR20]] = { willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR21]] = { readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind optsize readnone ssp uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nounwind uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { noinline nosync nounwind uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { noinline nounwind uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR5]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR6]] = { nofree norecurse nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR7]] = { nofree norecurse nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR10]] = { argmemonly nofree nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR11]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR12:[0-9]+]] = { convergent readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR13]] = { readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR14]] = { nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR15]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR16]] = { nofree nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR17:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR18:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR19]] = { willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR20]] = { willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR21]] = { readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/noundef.ll b/llvm/test/Transforms/Attributor/noundef.ll --- a/llvm/test/Transforms/Attributor/noundef.ll +++ b/llvm/test/Transforms/Attributor/noundef.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 declare void @unknown() @@ -50,13 +48,13 @@ } define void @callback_caller() { -; IS__TUNIT____-LABEL: define {{[^@]+}}@callback_caller() { -; IS__TUNIT____-NEXT: call void @callback_broker(void (i8*)* noundef @argument_dead_callback_callee, i8* noalias nocapture nofree readnone align 4294967296 undef) -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callback_caller() { +; NOT_CGSCC_NPM-NEXT: call void @callback_broker(void (i8*)* noundef @argument_dead_callback_callee, i8* noalias nocapture nofree readnone align 4294967296 undef) +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@callback_caller() { -; IS__CGSCC____-NEXT: call void @callback_broker(void (i8*)* noundef @argument_dead_callback_callee, i8* noalias nocapture nofree noundef readnone align 4294967296 null) -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callback_caller() { +; NOT_TUNIT_NPM-NEXT: call void @callback_broker(void (i8*)* noundef @argument_dead_callback_callee, i8* noalias nocapture nofree noundef readnone align 4294967296 null) +; NOT_TUNIT_NPM-NEXT: ret void ; call void @callback_broker(void (i8*)* @argument_dead_callback_callee, i8* null) ret void diff --git a/llvm/test/Transforms/Attributor/nounwind.ll b/llvm/test/Transforms/Attributor/nounwind.ll --- a/llvm/test/Transforms/Attributor/nounwind.ll +++ b/llvm/test/Transforms/Attributor/nounwind.ll @@ -1,20 +1,18 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 1 define i32 @foo1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo1 -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32 1 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i32 1 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo1 -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32 1 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret i32 1 ; ret i32 1 } @@ -26,10 +24,10 @@ ; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@scc1_foo -; IS__CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@scc1_foo +; NOT_TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %1 = call i32 @scc1_bar() ret i32 1 @@ -43,10 +41,10 @@ ; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { ; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@scc1_bar -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@scc1_bar +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %1 = call i32 @scc1_foo() ret i32 1 @@ -148,12 +146,9 @@ declare void @__cxa_end_catch() ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree noreturn nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree noreturn nosync nounwind readnone willreturn } ;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree noreturn nosync nounwind readnone willreturn } -;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/potential.ll b/llvm/test/Transforms/Attributor/potential.ll --- a/llvm/test/Transforms/Attributor/potential.ll +++ b/llvm/test/Transforms/Attributor/potential.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -enable-new-pm=0 -attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=20 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=20 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -enable-new-pm=0 -attributor-cgscc -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 for multiple potential values @@ -11,25 +9,25 @@ ; bool potential_test1(bool c) { return iszero(c ? 1 : -1); } define internal i1 @iszero1(i32 %c) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@iszero1 -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i1 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@iszero1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret i1 undef ; %cmp = icmp eq i32 %c, 0 ret i1 %cmp } define i1 @potential_test1(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i1 false +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test1 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i1 false ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test1 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 false +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test1 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i1 false ; %arg = select i1 %c, i32 -1, i32 1 %ret = call i1 @iszero1(i32 %arg) @@ -46,10 +44,10 @@ ; int potential_test2(int x) { return call_with_two_values(1) + call_with_two_values(-1); } define internal i32 @iszero2(i32 %c) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@iszero2 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@iszero2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %cmp = icmp eq i32 %c, 0 %ret = zext i1 %cmp to i32 @@ -57,10 +55,10 @@ } 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 i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@call_with_two_values +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %csret1 = call i32 @iszero2(i32 %c) %minusc = sub i32 0, %c @@ -70,15 +68,15 @@ } define i32 @potential_test2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test2 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test2 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; %csret1 = call i32 @call_with_two_values(i32 1) %csret2 = call i32 @call_with_two_values(i32 -1) @@ -98,12 +96,12 @@ ; int potential_test3() { return zero_or_one(iszero(0))+zero_or_one(iszero(1)); } define internal i32 @iszero3(i32 %c) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@iszero3 -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 undef, 0 -; IS__CGSCC____-NEXT: [[RET:%.*]] = zext i1 undef to i32 -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@iszero3 +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 undef, 0 +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = zext i1 undef to i32 +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %cmp = icmp eq i32 %c, 0 %ret = zext i1 %cmp to i32 @@ -111,12 +109,12 @@ } define internal i32 @less_than_two(i32 %c) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@less_than_two -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp slt i32 undef, 2 -; IS__CGSCC____-NEXT: [[RET:%.*]] = zext i1 true to i32 -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@less_than_two +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 undef, 2 +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = zext i1 true to i32 +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %cmp = icmp slt i32 %c, 2 %ret = zext i1 %cmp to i32 @@ -124,15 +122,15 @@ } define i32 @potential_test3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test3 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 2 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test3 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32 2 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test3 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 2 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32 2 ; %cmp1 = call i32 @iszero3(i32 0) %true1 = call i32 @less_than_two(i32 %cmp1) @@ -154,15 +152,15 @@ ; int potential_test7(int c) { return return1or3(c) == return3or4(c); } define i32 @potential_test4(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test4 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test4 +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test4 -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test4 +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; %csret = call i32 @return1or3(i32 %c) %false = icmp eq i32 %csret, 2 @@ -171,15 +169,15 @@ } define i32 @potential_test5(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test5 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test5 +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test5 -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test5 +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; %csret1 = call i32 @return1or3(i32 %c) %csret2 = call i32 @return2or4(i32 %c) @@ -189,26 +187,19 @@ } define i1 @potential_test6(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test6 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR0]], !range [[RNG0:![0-9]+]] -; IS__TUNIT____-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], 3 -; IS__TUNIT____-NEXT: ret i1 [[RET]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test6 -; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR2:[0-9]+]], !range [[RNG0:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], 3 -; IS__CGSCC_OPM-NEXT: ret i1 [[RET]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test6 -; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], 3 -; IS__CGSCC_NPM-NEXT: ret i1 [[RET]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test6 +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR0]], !range [[RNG0:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], 3 +; NOT_CGSCC_NPM-NEXT: ret i1 [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test6 +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], 3 +; NOT_TUNIT_NPM-NEXT: ret i1 [[RET]] ; %csret1 = call i32 @return1or3(i32 %c) %ret = icmp eq i32 %csret1, 3 @@ -216,29 +207,21 @@ } define i1 @potential_test7(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test7 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR0]], !range [[RNG0]] -; IS__TUNIT____-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR0]], !range [[RNG1:![0-9]+]] -; IS__TUNIT____-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] -; IS__TUNIT____-NEXT: ret i1 [[RET]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test7 -; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR2]], !range [[RNG0]] -; IS__CGSCC_OPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR2]], !range [[RNG1:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[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]]) #[[ATTR1]], !range [[RNG1:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] -; IS__CGSCC_NPM-NEXT: ret i1 [[RET]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test7 +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR0]], !range [[RNG0]] +; NOT_CGSCC_NPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR0]], !range [[RNG1:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] +; NOT_CGSCC_NPM-NEXT: ret i1 [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test7 +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR1]], !range [[RNG0]] +; NOT_TUNIT_NPM-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR1]], !range [[RNG1:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] +; NOT_TUNIT_NPM-NEXT: ret i1 [[RET]] ; %csret1 = call i32 @return1or3(i32 %c) %csret2 = call i32 @return3or4(i32 %c) @@ -247,19 +230,19 @@ } define internal i32 @return1or3(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@return1or3 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 -; IS__TUNIT____-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 1, i32 3 -; IS__TUNIT____-NEXT: ret i32 [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@return1or3 -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 -; IS__CGSCC____-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 1, i32 3 -; IS__CGSCC____-NEXT: ret i32 [[RET]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@return1or3 +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 1, i32 3 +; NOT_CGSCC_NPM-NEXT: ret i32 [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@return1or3 +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 1, i32 3 +; NOT_TUNIT_NPM-NEXT: ret i32 [[RET]] ; %cmp = icmp eq i32 %c, 0 %ret = select i1 %cmp, i32 1, i32 3 @@ -267,12 +250,12 @@ } define internal i32 @return2or4(i32 %c) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@return2or4 -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 undef, 0 -; IS__CGSCC____-NEXT: [[RET:%.*]] = select i1 undef, i32 2, i32 4 -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@return2or4 +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 undef, 0 +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = select i1 undef, i32 2, i32 4 +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %cmp = icmp eq i32 %c, 0 %ret = select i1 %cmp, i32 2, i32 4 @@ -280,19 +263,19 @@ } define internal i32 @return3or4(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@return3or4 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 -; IS__TUNIT____-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 3, i32 4 -; IS__TUNIT____-NEXT: ret i32 [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@return3or4 -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 -; IS__CGSCC____-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 3, i32 4 -; IS__CGSCC____-NEXT: ret i32 [[RET]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@return3or4 +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 3, i32 4 +; NOT_CGSCC_NPM-NEXT: ret i32 [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@return3or4 +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 3, i32 4 +; NOT_TUNIT_NPM-NEXT: ret i32 [[RET]] ; %cmp = icmp eq i32 %c, 0 %ret = select i1 %cmp, i32 3, i32 4 @@ -304,35 +287,35 @@ ; propagate argument to callsite argument define internal i1 @cmp_with_four(i32 %c) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cmp_with_four -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cmp_with_four +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i1 undef ; %cmp = icmp eq i32 %c, 4 ret i1 %cmp } define internal i1 @wrapper(i32 %c) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@wrapper -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@wrapper +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i1 undef ; %ret = call i1 @cmp_with_four(i32 %c) ret i1 %ret } define i1 @potential_test8() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test8 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i1 false +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test8 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i1 false ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test8 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 false +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test8 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i1 false ; %res1 = call i1 @wrapper(i32 1) %res3 = call i1 @wrapper(i32 3) @@ -343,81 +326,44 @@ } define i1 @potential_test9() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@potential_test9 -; IS__TUNIT_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[COND:%.*]] -; IS__TUNIT_OPM: cond: -; IS__TUNIT_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] -; IS__TUNIT_OPM: body: -; IS__TUNIT_OPM-NEXT: [[C_1]] = mul i32 [[C_0]], -1 -; IS__TUNIT_OPM-NEXT: br label [[INC]] -; IS__TUNIT_OPM: inc: -; IS__TUNIT_OPM-NEXT: [[I_1]] = add i32 [[I_0]], 1 -; IS__TUNIT_OPM-NEXT: br label [[COND]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: ret i1 false -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test9 -; IS__TUNIT_NPM-SAME: () #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[COND:%.*]] -; IS__TUNIT_NPM: cond: -; IS__TUNIT_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] -; IS__TUNIT_NPM: body: -; IS__TUNIT_NPM-NEXT: [[C_1]] = mul i32 [[C_0]], -1 -; IS__TUNIT_NPM-NEXT: br label [[INC]] -; IS__TUNIT_NPM: inc: -; IS__TUNIT_NPM-NEXT: [[I_1]] = add i32 [[I_0]], 1 -; IS__TUNIT_NPM-NEXT: br label [[COND]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: ret i1 false -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test9 -; IS__CGSCC_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[COND:%.*]] -; IS__CGSCC_OPM: cond: -; IS__CGSCC_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] -; IS__CGSCC_OPM: body: -; IS__CGSCC_OPM-NEXT: [[C_1]] = mul i32 [[C_0]], -1 -; IS__CGSCC_OPM-NEXT: br label [[INC]] -; IS__CGSCC_OPM: inc: -; IS__CGSCC_OPM-NEXT: [[I_1]] = add i32 [[I_0]], 1 -; IS__CGSCC_OPM-NEXT: br label [[COND]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: ret i1 false -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test9 -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[COND:%.*]] -; IS__CGSCC_NPM: cond: -; IS__CGSCC_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] -; IS__CGSCC_NPM: body: -; IS__CGSCC_NPM-NEXT: [[C_1]] = mul i32 [[C_0]], -1 -; IS__CGSCC_NPM-NEXT: br label [[INC]] -; IS__CGSCC_NPM: inc: -; IS__CGSCC_NPM-NEXT: [[I_1]] = add i32 [[I_0]], 1 -; IS__CGSCC_NPM-NEXT: br label [[COND]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret i1 false +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test9 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[COND:%.*]] +; NOT_CGSCC_NPM: cond: +; NOT_CGSCC_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] +; NOT_CGSCC_NPM: body: +; NOT_CGSCC_NPM-NEXT: [[C_1]] = mul i32 [[C_0]], -1 +; NOT_CGSCC_NPM-NEXT: br label [[INC]] +; NOT_CGSCC_NPM: inc: +; NOT_CGSCC_NPM-NEXT: [[I_1]] = add i32 [[I_0]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[COND]] +; NOT_CGSCC_NPM: end: +; NOT_CGSCC_NPM-NEXT: ret i1 false +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test9 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[COND:%.*]] +; NOT_TUNIT_NPM: cond: +; NOT_TUNIT_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] +; NOT_TUNIT_NPM: body: +; NOT_TUNIT_NPM-NEXT: [[C_1]] = mul i32 [[C_0]], -1 +; NOT_TUNIT_NPM-NEXT: br label [[INC]] +; NOT_TUNIT_NPM: inc: +; NOT_TUNIT_NPM-NEXT: [[I_1]] = add i32 [[I_0]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[COND]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: ret i1 false ; entry: br label %cond @@ -442,19 +388,19 @@ ; and returned value of @potential_test10 can be simplified to 0(false) define internal i32 @may_return_undef(i32 %c) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@may_return_undef -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ -; IS__CGSCC____-NEXT: i32 1, label [[A:%.*]] -; IS__CGSCC____-NEXT: i32 -1, label [[B:%.*]] -; IS__CGSCC____-NEXT: ] -; IS__CGSCC____: a: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: b: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: otherwise: -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@may_return_undef +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ +; NOT_TUNIT_NPM-NEXT: i32 1, label [[A:%.*]] +; NOT_TUNIT_NPM-NEXT: i32 -1, label [[B:%.*]] +; NOT_TUNIT_NPM-NEXT: ] +; NOT_TUNIT_NPM: a: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: b: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: otherwise: +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; switch i32 %c, label %otherwise [i32 1, label %a i32 -1, label %b] @@ -467,16 +413,16 @@ } define i1 @potential_test10(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test10 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i1 false +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test10 +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i1 false ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test10 -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 undef, 0 -; IS__CGSCC____-NEXT: ret i1 false +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test10 +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 undef, 0 +; NOT_TUNIT_NPM-NEXT: ret i1 false ; %ret = call i32 @may_return_undef(i32 %c) %cmp = icmp eq i32 %ret, 0 @@ -484,23 +430,23 @@ } define i32 @optimize_undef_1(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@optimize_undef_1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: ret i32 0 -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: ret i32 1 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@optimize_undef_1 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i32 0 -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: ret i32 1 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@optimize_undef_1 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: ret i32 0 +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: ret i32 1 +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@optimize_undef_1 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: ret i32 0 +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: ret i32 1 ; br i1 %c, label %t, label %f t: @@ -511,23 +457,23 @@ } define i32 @optimize_undef_2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@optimize_undef_2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: ret i32 0 -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: ret i32 -1 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@optimize_undef_2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i32 0 -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: ret i32 -1 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@optimize_undef_2 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: ret i32 0 +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: ret i32 -1 +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@optimize_undef_2 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: ret i32 0 +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: ret i32 -1 ; br i1 %c, label %t, label %f t: @@ -538,23 +484,23 @@ } define i32 @optimize_undef_3(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@optimize_undef_3 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: ret i32 0 -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: ret i32 1 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@optimize_undef_3 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i32 0 -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: ret i32 1 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@optimize_undef_3 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: ret i32 0 +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: ret i32 1 +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@optimize_undef_3 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: ret i32 0 +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: ret i32 1 ; br i1 %c, label %t, label %f t: @@ -568,35 +514,25 @@ ; FIXME: returned value can be simplified to 0 define i32 @potential_test11(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test11 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) #[[ATTR0]], !range [[RNG2:![0-9]+]] -; IS__TUNIT____-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) #[[ATTR0]], !range [[RNG3:![0-9]+]] -; IS__TUNIT____-NEXT: [[ZERO3:%.*]] = call i32 @optimize_undef_3(i1 [[C]]) #[[ATTR0]], !range [[RNG2]] -; IS__TUNIT____-NEXT: [[ACC1:%.*]] = add i32 [[ZERO1]], [[ZERO2]] -; IS__TUNIT____-NEXT: [[ACC2:%.*]] = add i32 [[ACC1]], [[ZERO3]] -; IS__TUNIT____-NEXT: ret i32 [[ACC2]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test11 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) #[[ATTR2]], !range [[RNG2:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) #[[ATTR2]], !range [[RNG3:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[ZERO3:%.*]] = call i32 @optimize_undef_3(i1 [[C]]) #[[ATTR2]], !range [[RNG2]] -; IS__CGSCC_OPM-NEXT: [[ACC1:%.*]] = add i32 [[ZERO1]], [[ZERO2]] -; IS__CGSCC_OPM-NEXT: [[ACC2:%.*]] = add i32 [[ACC1]], [[ZERO3]] -; IS__CGSCC_OPM-NEXT: ret i32 [[ACC2]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test11 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) #[[ATTR1]], !range [[RNG2:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) #[[ATTR1]], !range [[RNG3:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[ZERO3:%.*]] = call i32 @optimize_undef_3(i1 [[C]]) #[[ATTR1]], !range [[RNG2]] -; IS__CGSCC_NPM-NEXT: [[ACC1:%.*]] = add i32 [[ZERO1]], [[ZERO2]] -; IS__CGSCC_NPM-NEXT: [[ACC2:%.*]] = add i32 [[ACC1]], [[ZERO3]] -; IS__CGSCC_NPM-NEXT: ret i32 [[ACC2]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test11 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) #[[ATTR0]], !range [[RNG2:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) #[[ATTR0]], !range [[RNG3:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[ZERO3:%.*]] = call i32 @optimize_undef_3(i1 [[C]]) #[[ATTR0]], !range [[RNG2]] +; NOT_CGSCC_NPM-NEXT: [[ACC1:%.*]] = add i32 [[ZERO1]], [[ZERO2]] +; NOT_CGSCC_NPM-NEXT: [[ACC2:%.*]] = add i32 [[ACC1]], [[ZERO3]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[ACC2]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test11 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) #[[ATTR1]], !range [[RNG2:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) #[[ATTR1]], !range [[RNG3:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[ZERO3:%.*]] = call i32 @optimize_undef_3(i1 [[C]]) #[[ATTR1]], !range [[RNG2]] +; NOT_TUNIT_NPM-NEXT: [[ACC1:%.*]] = add i32 [[ZERO1]], [[ZERO2]] +; NOT_TUNIT_NPM-NEXT: [[ACC2:%.*]] = add i32 [[ACC1]], [[ZERO3]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[ACC2]] ; %zero1 = call i32 @optimize_undef_1(i1 %c) %zero2 = call i32 @optimize_undef_2(i1 %c) @@ -607,41 +543,24 @@ } define i32 @optimize_poison_1(i1 %c) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@optimize_poison_1 -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT_OPM: t: -; IS__TUNIT_OPM-NEXT: ret i32 0 -; IS__TUNIT_OPM: f: -; IS__TUNIT_OPM-NEXT: ret i32 -1 -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@optimize_poison_1 -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT_NPM: t: -; IS__TUNIT_NPM-NEXT: ret i32 0 -; IS__TUNIT_NPM: f: -; IS__TUNIT_NPM-NEXT: ret i32 undef -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@optimize_poison_1 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_OPM: t: -; IS__CGSCC_OPM-NEXT: ret i32 0 -; IS__CGSCC_OPM: f: -; IS__CGSCC_OPM-NEXT: ret i32 -1 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@optimize_poison_1 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_NPM: t: -; IS__CGSCC_NPM-NEXT: ret i32 0 -; IS__CGSCC_NPM: f: -; IS__CGSCC_NPM-NEXT: ret i32 undef +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@optimize_poison_1 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: ret i32 0 +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: ret i32 undef +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@optimize_poison_1 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: ret i32 0 +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; br i1 %c, label %t, label %f t: @@ -653,27 +572,16 @@ ; FIXME: returned value can be simplified to 0 define i32 @potential_test12(i1 %c) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@potential_test12 -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: [[ZERO:%.*]] = call noundef i32 @optimize_poison_1(i1 [[C]]) #[[ATTR0]], !range [[RNG3]] -; IS__TUNIT_OPM-NEXT: ret i32 [[ZERO]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test12 -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: ret i32 0 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test12 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[ZERO:%.*]] = call noundef i32 @optimize_poison_1(i1 [[C]]) #[[ATTR2]], !range [[RNG3]] -; IS__CGSCC_OPM-NEXT: ret i32 [[ZERO]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test12 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: ret i32 0 +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test12 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32 0 +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test12 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; %zero = call i32 @optimize_poison_1(i1 %c) ret i32 %zero @@ -685,111 +593,93 @@ ; However, we should not simplify `and i32 %c, 3` to `%c` define internal i32 @potential_test13_callee(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test13_callee -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = and i32 [[C]], 3 -; IS__TUNIT____-NEXT: ret i32 [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test13_callee -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[RET:%.*]] = and i32 [[C]], 3 -; IS__CGSCC____-NEXT: ret i32 [[RET]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test13_callee +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = and i32 [[C]], 3 +; NOT_CGSCC_NPM-NEXT: ret i32 [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test13_callee +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = and i32 [[C]], 3 +; NOT_TUNIT_NPM-NEXT: ret i32 [[RET]] ; %ret = and i32 %c, 3 ret i32 %ret } define i32 @potential_test13_caller1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test13_caller1 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 0) #[[ATTR0]], !range [[RNG2]] -; IS__TUNIT____-NEXT: ret i32 [[RET]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test13_caller1 -; IS__CGSCC_OPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 0) #[[ATTR2]], !range [[RNG2]] -; IS__CGSCC_OPM-NEXT: ret i32 [[RET]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test13_caller1 -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 0) #[[ATTR1]], !range [[RNG2]] -; IS__CGSCC_NPM-NEXT: ret i32 [[RET]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test13_caller1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 0) #[[ATTR0]], !range [[RNG2]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test13_caller1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 0) #[[ATTR1]], !range [[RNG2]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[RET]] ; %ret = call i32 @potential_test13_callee(i32 0) ret i32 %ret } define i32 @potential_test13_caller2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test13_caller2 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 1) #[[ATTR0]], !range [[RNG2]] -; IS__TUNIT____-NEXT: ret i32 [[RET]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test13_caller2 -; IS__CGSCC_OPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 1) #[[ATTR2]], !range [[RNG2]] -; IS__CGSCC_OPM-NEXT: ret i32 [[RET]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test13_caller2 -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 1) #[[ATTR1]], !range [[RNG2]] -; IS__CGSCC_NPM-NEXT: ret i32 [[RET]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test13_caller2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 1) #[[ATTR0]], !range [[RNG2]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test13_caller2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 1) #[[ATTR1]], !range [[RNG2]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[RET]] ; %ret = call i32 @potential_test13_callee(i32 1) ret i32 %ret } define i32 @potential_test13_caller3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test13_caller3 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR0]], !range [[RNG2]] -; IS__TUNIT____-NEXT: ret i32 [[RET]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test13_caller3 -; IS__CGSCC_OPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR2]], !range [[RNG2]] -; IS__CGSCC_OPM-NEXT: ret i32 [[RET]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test13_caller3 -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR1]], !range [[RNG2]] -; IS__CGSCC_NPM-NEXT: ret i32 [[RET]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test13_caller3 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR0]], !range [[RNG2]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test13_caller3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR1]], !range [[RNG2]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[RET]] ; %ret = call i32 @potential_test13_callee(i32 undef) ret i32 %ret } define i1 @potential_test14(i1 %c0, i1 %c1, i1 %c2, i1 %c3) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test14 -; IS__TUNIT____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[X0:%.*]] = select i1 [[C0]], i32 0, i32 1 -; IS__TUNIT____-NEXT: [[X1:%.*]] = select i1 [[C1]], i32 [[X0]], i32 undef -; IS__TUNIT____-NEXT: [[Y2:%.*]] = select i1 [[C2]], i32 0, i32 7 -; IS__TUNIT____-NEXT: [[Z3:%.*]] = select i1 [[C3]], i32 [[X1]], i32 [[Y2]] -; IS__TUNIT____-NEXT: [[RET:%.*]] = icmp slt i32 [[Z3]], 7 -; IS__TUNIT____-NEXT: ret i1 [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test14 -; IS__CGSCC____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[X0:%.*]] = select i1 [[C0]], i32 0, i32 1 -; IS__CGSCC____-NEXT: [[X1:%.*]] = select i1 [[C1]], i32 [[X0]], i32 undef -; IS__CGSCC____-NEXT: [[Y2:%.*]] = select i1 [[C2]], i32 0, i32 7 -; IS__CGSCC____-NEXT: [[Z3:%.*]] = select i1 [[C3]], i32 [[X1]], i32 [[Y2]] -; IS__CGSCC____-NEXT: [[RET:%.*]] = icmp slt i32 [[Z3]], 7 -; IS__CGSCC____-NEXT: ret i1 [[RET]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test14 +; NOT_CGSCC_NPM-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[X0:%.*]] = select i1 [[C0]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[X1:%.*]] = select i1 [[C1]], i32 [[X0]], i32 undef +; NOT_CGSCC_NPM-NEXT: [[Y2:%.*]] = select i1 [[C2]], i32 0, i32 7 +; NOT_CGSCC_NPM-NEXT: [[Z3:%.*]] = select i1 [[C3]], i32 [[X1]], i32 [[Y2]] +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = icmp slt i32 [[Z3]], 7 +; NOT_CGSCC_NPM-NEXT: ret i1 [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test14 +; NOT_TUNIT_NPM-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[X0:%.*]] = select i1 [[C0]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[X1:%.*]] = select i1 [[C1]], i32 [[X0]], i32 undef +; NOT_TUNIT_NPM-NEXT: [[Y2:%.*]] = select i1 [[C2]], i32 0, i32 7 +; NOT_TUNIT_NPM-NEXT: [[Z3:%.*]] = select i1 [[C3]], i32 [[X1]], i32 [[Y2]] +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = icmp slt i32 [[Z3]], 7 +; NOT_TUNIT_NPM-NEXT: ret i1 [[RET]] ; %x0 = select i1 %c0, i32 0, i32 1 %x1 = select i1 %c1, i32 %x0, i32 undef @@ -800,15 +690,15 @@ } define i1 @potential_test15(i1 %c0, i1 %c1) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test15 -; IS__TUNIT____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i1 false +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test15 +; NOT_CGSCC_NPM-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i1 false ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test15 -; IS__CGSCC____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 false +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test15 +; NOT_TUNIT_NPM-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i1 false ; %x0 = select i1 %c0, i32 0, i32 1 %x1 = select i1 %c1, i32 %x0, i32 undef @@ -817,15 +707,15 @@ } define i1 @potential_test16(i1 %c0, i1 %c1) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@potential_test16 -; IS__TUNIT____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i1 false +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test16 +; NOT_CGSCC_NPM-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i1 false ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test16 -; IS__CGSCC____-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 false +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test16 +; NOT_TUNIT_NPM-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i1 false ; %x0 = select i1 %c0, i32 0, i32 undef %x1 = select i1 %c1, i32 %x0, i32 1 @@ -834,17 +724,10 @@ } ;. -; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone } -;. -; IS__TUNIT_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { readnone willreturn } ;. ; CHECK: [[META0:![0-9]+]] = !{i32 1, i32 4} ; CHECK: [[META1:![0-9]+]] = !{i32 3, i32 5} diff --git a/llvm/test/Transforms/Attributor/range.ll b/llvm/test/Transforms/Attributor/range.ll --- a/llvm/test/Transforms/Attributor/range.ll +++ b/llvm/test/Transforms/Attributor/range.ll @@ -1,52 +1,39 @@ ; 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=25 -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=25 -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 ; FIXME: CGSCC is not looking at callees and calleers even though it could be allowed. define i32 @test0(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test0 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG0:![0-9]+]] -; IS__TUNIT____-NEXT: ret i32 [[A]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test0 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG0:![0-9]+]] -; IS__CGSCC____-NEXT: ret i32 [[A]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test0 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG0:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[A]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test0 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG0:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[A]] ; %a = load i32, i32* %p, !range !0 ret i32 %a } define i32 @test0-range-check(i32* %p) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test0-range-check -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: [[A:%.*]] = tail call i32 @test0(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR3:[0-9]+]], !range [[RNG0]] -; IS__TUNIT_OPM-NEXT: ret i32 [[A]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test0-range-check -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: [[A:%.*]] = tail call i32 @test0(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR2:[0-9]+]], !range [[RNG0]] -; IS__TUNIT_NPM-NEXT: ret i32 [[A]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test0-range-check -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = tail call i32 @test0(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR3:[0-9]+]], !range [[RNG0]] -; IS__CGSCC_OPM-NEXT: ret i32 [[A]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test0-range-check -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = tail call i32 @test0(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR2:[0-9]+]], !range [[RNG0]] -; IS__CGSCC_NPM-NEXT: ret i32 [[A]] +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test0-range-check +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = tail call i32 @test0(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR2:[0-9]+]], !range [[RNG0]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[A]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test0-range-check +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = tail call i32 @test0(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR2:[0-9]+]], !range [[RNG0]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[A]] ; %a = tail call i32 @test0(i32* %p) ret i32 %a @@ -66,193 +53,100 @@ ; TEST0 icmp test define void @test0-icmp-check(i32* %p){ ; ret = [0, 10) -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test0-icmp-check -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) { -; IS__TUNIT_OPM-NEXT: [[RET:%.*]] = tail call i32 @test0(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR3]], !range [[RNG0]] -; IS__TUNIT_OPM-NEXT: [[CMP_EQ_2:%.*]] = icmp eq i32 [[RET]], 9 -; IS__TUNIT_OPM-NEXT: [[CMP_EQ_3:%.*]] = icmp eq i32 [[RET]], 8 -; IS__TUNIT_OPM-NEXT: [[CMP_EQ_4:%.*]] = icmp eq i32 [[RET]], 1 -; IS__TUNIT_OPM-NEXT: [[CMP_EQ_5:%.*]] = icmp eq i32 [[RET]], 0 -; IS__TUNIT_OPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_EQ_2]], i1 [[CMP_EQ_3]]) -; IS__TUNIT_OPM-NEXT: tail call void @use3(i1 [[CMP_EQ_4]], i1 [[CMP_EQ_5]], i1 noundef false) -; IS__TUNIT_OPM-NEXT: [[CMP_NE_2:%.*]] = icmp ne i32 [[RET]], 9 -; IS__TUNIT_OPM-NEXT: [[CMP_NE_3:%.*]] = icmp ne i32 [[RET]], 8 -; IS__TUNIT_OPM-NEXT: [[CMP_NE_4:%.*]] = icmp ne i32 [[RET]], 1 -; IS__TUNIT_OPM-NEXT: [[CMP_NE_5:%.*]] = icmp ne i32 [[RET]], 0 -; IS__TUNIT_OPM-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_NE_2]], i1 [[CMP_NE_3]]) -; IS__TUNIT_OPM-NEXT: tail call void @use3(i1 [[CMP_NE_4]], i1 [[CMP_NE_5]], i1 noundef true) -; IS__TUNIT_OPM-NEXT: [[CMP_UGT_3:%.*]] = icmp ugt i32 [[RET]], 8 -; IS__TUNIT_OPM-NEXT: [[CMP_UGT_4:%.*]] = icmp ugt i32 [[RET]], 1 -; IS__TUNIT_OPM-NEXT: [[CMP_UGT_5:%.*]] = icmp ugt i32 [[RET]], 0 -; IS__TUNIT_OPM-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_UGT_3]]) -; IS__TUNIT_OPM-NEXT: tail call void @use3(i1 [[CMP_UGT_4]], i1 [[CMP_UGT_5]], i1 noundef false) -; IS__TUNIT_OPM-NEXT: [[CMP_UGE_2:%.*]] = icmp uge i32 [[RET]], 9 -; IS__TUNIT_OPM-NEXT: [[CMP_UGE_3:%.*]] = icmp uge i32 [[RET]], 8 -; IS__TUNIT_OPM-NEXT: [[CMP_UGE_4:%.*]] = icmp uge i32 [[RET]], 1 -; IS__TUNIT_OPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_UGE_2]], i1 [[CMP_UGE_3]]) -; IS__TUNIT_OPM-NEXT: tail call void @use3(i1 [[CMP_UGE_4]], i1 noundef true, i1 noundef false) -; IS__TUNIT_OPM-NEXT: [[CMP_SGT_3:%.*]] = icmp sgt i32 [[RET]], 8 -; IS__TUNIT_OPM-NEXT: [[CMP_SGT_4:%.*]] = icmp sgt i32 [[RET]], 1 -; IS__TUNIT_OPM-NEXT: [[CMP_SGT_5:%.*]] = icmp sgt i32 [[RET]], 0 -; IS__TUNIT_OPM-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_SGT_3]]) -; IS__TUNIT_OPM-NEXT: tail call void @use3(i1 [[CMP_SGT_4]], i1 [[CMP_SGT_5]], i1 noundef true) -; IS__TUNIT_OPM-NEXT: [[CMP_GTE_2:%.*]] = icmp sge i32 [[RET]], 9 -; IS__TUNIT_OPM-NEXT: [[CMP_GTE_3:%.*]] = icmp sge i32 [[RET]], 8 -; IS__TUNIT_OPM-NEXT: [[CMP_GTE_4:%.*]] = icmp sge i32 [[RET]], 1 -; IS__TUNIT_OPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_GTE_2]], i1 [[CMP_GTE_3]]) -; IS__TUNIT_OPM-NEXT: tail call void @use3(i1 [[CMP_GTE_4]], i1 noundef true, i1 noundef true) -; IS__TUNIT_OPM-NEXT: [[CMP_SLT_2:%.*]] = icmp slt i32 [[RET]], 9 -; IS__TUNIT_OPM-NEXT: [[CMP_SLT_3:%.*]] = icmp slt i32 [[RET]], 8 -; IS__TUNIT_OPM-NEXT: [[CMP_SLT_4:%.*]] = icmp slt i32 [[RET]], 1 -; IS__TUNIT_OPM-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_SLT_2]], i1 [[CMP_SLT_3]]) -; IS__TUNIT_OPM-NEXT: tail call void @use3(i1 [[CMP_SLT_4]], i1 noundef false, i1 noundef false) -; IS__TUNIT_OPM-NEXT: [[CMP_LTE_3:%.*]] = icmp sle i32 [[RET]], 8 -; IS__TUNIT_OPM-NEXT: [[CMP_LTE_4:%.*]] = icmp sle i32 [[RET]], 1 -; IS__TUNIT_OPM-NEXT: [[CMP_LTE_5:%.*]] = icmp sle i32 [[RET]], 0 -; IS__TUNIT_OPM-NEXT: tail call void @use3(i1 noundef true, i1 noundef true, i1 [[CMP_LTE_3]]) -; IS__TUNIT_OPM-NEXT: tail call void @use3(i1 [[CMP_LTE_4]], i1 [[CMP_LTE_5]], i1 noundef false) -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test0-icmp-check -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) { -; IS__TUNIT_NPM-NEXT: [[RET:%.*]] = tail call i32 @test0(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR2]], !range [[RNG0]] -; IS__TUNIT_NPM-NEXT: [[CMP_EQ_2:%.*]] = icmp eq i32 [[RET]], 9 -; IS__TUNIT_NPM-NEXT: [[CMP_EQ_3:%.*]] = icmp eq i32 [[RET]], 8 -; IS__TUNIT_NPM-NEXT: [[CMP_EQ_4:%.*]] = icmp eq i32 [[RET]], 1 -; IS__TUNIT_NPM-NEXT: [[CMP_EQ_5:%.*]] = icmp eq i32 [[RET]], 0 -; IS__TUNIT_NPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_EQ_2]], i1 [[CMP_EQ_3]]) -; IS__TUNIT_NPM-NEXT: tail call void @use3(i1 [[CMP_EQ_4]], i1 [[CMP_EQ_5]], i1 noundef false) -; IS__TUNIT_NPM-NEXT: [[CMP_NE_2:%.*]] = icmp ne i32 [[RET]], 9 -; IS__TUNIT_NPM-NEXT: [[CMP_NE_3:%.*]] = icmp ne i32 [[RET]], 8 -; IS__TUNIT_NPM-NEXT: [[CMP_NE_4:%.*]] = icmp ne i32 [[RET]], 1 -; IS__TUNIT_NPM-NEXT: [[CMP_NE_5:%.*]] = icmp ne i32 [[RET]], 0 -; IS__TUNIT_NPM-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_NE_2]], i1 [[CMP_NE_3]]) -; IS__TUNIT_NPM-NEXT: tail call void @use3(i1 [[CMP_NE_4]], i1 [[CMP_NE_5]], i1 noundef true) -; IS__TUNIT_NPM-NEXT: [[CMP_UGT_3:%.*]] = icmp ugt i32 [[RET]], 8 -; IS__TUNIT_NPM-NEXT: [[CMP_UGT_4:%.*]] = icmp ugt i32 [[RET]], 1 -; IS__TUNIT_NPM-NEXT: [[CMP_UGT_5:%.*]] = icmp ugt i32 [[RET]], 0 -; IS__TUNIT_NPM-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_UGT_3]]) -; IS__TUNIT_NPM-NEXT: tail call void @use3(i1 [[CMP_UGT_4]], i1 [[CMP_UGT_5]], i1 noundef false) -; IS__TUNIT_NPM-NEXT: [[CMP_UGE_2:%.*]] = icmp uge i32 [[RET]], 9 -; IS__TUNIT_NPM-NEXT: [[CMP_UGE_3:%.*]] = icmp uge i32 [[RET]], 8 -; IS__TUNIT_NPM-NEXT: [[CMP_UGE_4:%.*]] = icmp uge i32 [[RET]], 1 -; IS__TUNIT_NPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_UGE_2]], i1 [[CMP_UGE_3]]) -; IS__TUNIT_NPM-NEXT: tail call void @use3(i1 [[CMP_UGE_4]], i1 noundef true, i1 noundef false) -; IS__TUNIT_NPM-NEXT: [[CMP_SGT_3:%.*]] = icmp sgt i32 [[RET]], 8 -; IS__TUNIT_NPM-NEXT: [[CMP_SGT_4:%.*]] = icmp sgt i32 [[RET]], 1 -; IS__TUNIT_NPM-NEXT: [[CMP_SGT_5:%.*]] = icmp sgt i32 [[RET]], 0 -; IS__TUNIT_NPM-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_SGT_3]]) -; IS__TUNIT_NPM-NEXT: tail call void @use3(i1 [[CMP_SGT_4]], i1 [[CMP_SGT_5]], i1 noundef true) -; IS__TUNIT_NPM-NEXT: [[CMP_GTE_2:%.*]] = icmp sge i32 [[RET]], 9 -; IS__TUNIT_NPM-NEXT: [[CMP_GTE_3:%.*]] = icmp sge i32 [[RET]], 8 -; IS__TUNIT_NPM-NEXT: [[CMP_GTE_4:%.*]] = icmp sge i32 [[RET]], 1 -; IS__TUNIT_NPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_GTE_2]], i1 [[CMP_GTE_3]]) -; IS__TUNIT_NPM-NEXT: tail call void @use3(i1 [[CMP_GTE_4]], i1 noundef true, i1 noundef true) -; IS__TUNIT_NPM-NEXT: [[CMP_SLT_2:%.*]] = icmp slt i32 [[RET]], 9 -; IS__TUNIT_NPM-NEXT: [[CMP_SLT_3:%.*]] = icmp slt i32 [[RET]], 8 -; IS__TUNIT_NPM-NEXT: [[CMP_SLT_4:%.*]] = icmp slt i32 [[RET]], 1 -; IS__TUNIT_NPM-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_SLT_2]], i1 [[CMP_SLT_3]]) -; IS__TUNIT_NPM-NEXT: tail call void @use3(i1 [[CMP_SLT_4]], i1 noundef false, i1 noundef false) -; IS__TUNIT_NPM-NEXT: [[CMP_LTE_3:%.*]] = icmp sle i32 [[RET]], 8 -; IS__TUNIT_NPM-NEXT: [[CMP_LTE_4:%.*]] = icmp sle i32 [[RET]], 1 -; IS__TUNIT_NPM-NEXT: [[CMP_LTE_5:%.*]] = icmp sle i32 [[RET]], 0 -; IS__TUNIT_NPM-NEXT: tail call void @use3(i1 noundef true, i1 noundef true, i1 [[CMP_LTE_3]]) -; IS__TUNIT_NPM-NEXT: tail call void @use3(i1 [[CMP_LTE_4]], i1 [[CMP_LTE_5]], i1 noundef false) -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test0-icmp-check -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) { -; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = tail call i32 @test0(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR3]], !range [[RNG0]] -; IS__CGSCC_OPM-NEXT: [[CMP_EQ_2:%.*]] = icmp eq i32 [[RET]], 9 -; IS__CGSCC_OPM-NEXT: [[CMP_EQ_3:%.*]] = icmp eq i32 [[RET]], 8 -; IS__CGSCC_OPM-NEXT: [[CMP_EQ_4:%.*]] = icmp eq i32 [[RET]], 1 -; IS__CGSCC_OPM-NEXT: [[CMP_EQ_5:%.*]] = icmp eq i32 [[RET]], 0 -; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_EQ_2]], i1 [[CMP_EQ_3]]) -; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 [[CMP_EQ_4]], i1 [[CMP_EQ_5]], i1 noundef false) -; IS__CGSCC_OPM-NEXT: [[CMP_NE_2:%.*]] = icmp ne i32 [[RET]], 9 -; IS__CGSCC_OPM-NEXT: [[CMP_NE_3:%.*]] = icmp ne i32 [[RET]], 8 -; IS__CGSCC_OPM-NEXT: [[CMP_NE_4:%.*]] = icmp ne i32 [[RET]], 1 -; IS__CGSCC_OPM-NEXT: [[CMP_NE_5:%.*]] = icmp ne i32 [[RET]], 0 -; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_NE_2]], i1 [[CMP_NE_3]]) -; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 [[CMP_NE_4]], i1 [[CMP_NE_5]], i1 noundef true) -; IS__CGSCC_OPM-NEXT: [[CMP_UGT_3:%.*]] = icmp ugt i32 [[RET]], 8 -; IS__CGSCC_OPM-NEXT: [[CMP_UGT_4:%.*]] = icmp ugt i32 [[RET]], 1 -; IS__CGSCC_OPM-NEXT: [[CMP_UGT_5:%.*]] = icmp ugt i32 [[RET]], 0 -; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_UGT_3]]) -; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 [[CMP_UGT_4]], i1 [[CMP_UGT_5]], i1 noundef false) -; IS__CGSCC_OPM-NEXT: [[CMP_UGE_2:%.*]] = icmp uge i32 [[RET]], 9 -; IS__CGSCC_OPM-NEXT: [[CMP_UGE_3:%.*]] = icmp uge i32 [[RET]], 8 -; IS__CGSCC_OPM-NEXT: [[CMP_UGE_4:%.*]] = icmp uge i32 [[RET]], 1 -; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_UGE_2]], i1 [[CMP_UGE_3]]) -; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 [[CMP_UGE_4]], i1 noundef true, i1 noundef false) -; IS__CGSCC_OPM-NEXT: [[CMP_SGT_3:%.*]] = icmp sgt i32 [[RET]], 8 -; IS__CGSCC_OPM-NEXT: [[CMP_SGT_4:%.*]] = icmp sgt i32 [[RET]], 1 -; IS__CGSCC_OPM-NEXT: [[CMP_SGT_5:%.*]] = icmp sgt i32 [[RET]], 0 -; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_SGT_3]]) -; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 [[CMP_SGT_4]], i1 [[CMP_SGT_5]], i1 noundef true) -; IS__CGSCC_OPM-NEXT: [[CMP_GTE_2:%.*]] = icmp sge i32 [[RET]], 9 -; IS__CGSCC_OPM-NEXT: [[CMP_GTE_3:%.*]] = icmp sge i32 [[RET]], 8 -; IS__CGSCC_OPM-NEXT: [[CMP_GTE_4:%.*]] = icmp sge i32 [[RET]], 1 -; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_GTE_2]], i1 [[CMP_GTE_3]]) -; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 [[CMP_GTE_4]], i1 noundef true, i1 noundef true) -; IS__CGSCC_OPM-NEXT: [[CMP_SLT_2:%.*]] = icmp slt i32 [[RET]], 9 -; IS__CGSCC_OPM-NEXT: [[CMP_SLT_3:%.*]] = icmp slt i32 [[RET]], 8 -; IS__CGSCC_OPM-NEXT: [[CMP_SLT_4:%.*]] = icmp slt i32 [[RET]], 1 -; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_SLT_2]], i1 [[CMP_SLT_3]]) -; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 [[CMP_SLT_4]], i1 noundef false, i1 noundef false) -; IS__CGSCC_OPM-NEXT: [[CMP_LTE_3:%.*]] = icmp sle i32 [[RET]], 8 -; IS__CGSCC_OPM-NEXT: [[CMP_LTE_4:%.*]] = icmp sle i32 [[RET]], 1 -; IS__CGSCC_OPM-NEXT: [[CMP_LTE_5:%.*]] = icmp sle i32 [[RET]], 0 -; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 noundef true, i1 noundef true, i1 [[CMP_LTE_3]]) -; IS__CGSCC_OPM-NEXT: tail call void @use3(i1 [[CMP_LTE_4]], i1 [[CMP_LTE_5]], i1 noundef false) -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test0-icmp-check -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) { -; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = tail call i32 @test0(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR2]], !range [[RNG0]] -; IS__CGSCC_NPM-NEXT: [[CMP_EQ_2:%.*]] = icmp eq i32 [[RET]], 9 -; IS__CGSCC_NPM-NEXT: [[CMP_EQ_3:%.*]] = icmp eq i32 [[RET]], 8 -; IS__CGSCC_NPM-NEXT: [[CMP_EQ_4:%.*]] = icmp eq i32 [[RET]], 1 -; IS__CGSCC_NPM-NEXT: [[CMP_EQ_5:%.*]] = icmp eq i32 [[RET]], 0 -; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_EQ_2]], i1 [[CMP_EQ_3]]) -; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_EQ_4]], i1 [[CMP_EQ_5]], i1 noundef false) -; IS__CGSCC_NPM-NEXT: [[CMP_NE_2:%.*]] = icmp ne i32 [[RET]], 9 -; IS__CGSCC_NPM-NEXT: [[CMP_NE_3:%.*]] = icmp ne i32 [[RET]], 8 -; IS__CGSCC_NPM-NEXT: [[CMP_NE_4:%.*]] = icmp ne i32 [[RET]], 1 -; IS__CGSCC_NPM-NEXT: [[CMP_NE_5:%.*]] = icmp ne i32 [[RET]], 0 -; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_NE_2]], i1 [[CMP_NE_3]]) -; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_NE_4]], i1 [[CMP_NE_5]], i1 noundef true) -; IS__CGSCC_NPM-NEXT: [[CMP_UGT_3:%.*]] = icmp ugt i32 [[RET]], 8 -; IS__CGSCC_NPM-NEXT: [[CMP_UGT_4:%.*]] = icmp ugt i32 [[RET]], 1 -; IS__CGSCC_NPM-NEXT: [[CMP_UGT_5:%.*]] = icmp ugt i32 [[RET]], 0 -; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_UGT_3]]) -; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_UGT_4]], i1 [[CMP_UGT_5]], i1 noundef false) -; IS__CGSCC_NPM-NEXT: [[CMP_UGE_2:%.*]] = icmp uge i32 [[RET]], 9 -; IS__CGSCC_NPM-NEXT: [[CMP_UGE_3:%.*]] = icmp uge i32 [[RET]], 8 -; IS__CGSCC_NPM-NEXT: [[CMP_UGE_4:%.*]] = icmp uge i32 [[RET]], 1 -; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_UGE_2]], i1 [[CMP_UGE_3]]) -; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_UGE_4]], i1 noundef true, i1 noundef false) -; IS__CGSCC_NPM-NEXT: [[CMP_SGT_3:%.*]] = icmp sgt i32 [[RET]], 8 -; IS__CGSCC_NPM-NEXT: [[CMP_SGT_4:%.*]] = icmp sgt i32 [[RET]], 1 -; IS__CGSCC_NPM-NEXT: [[CMP_SGT_5:%.*]] = icmp sgt i32 [[RET]], 0 -; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_SGT_3]]) -; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_SGT_4]], i1 [[CMP_SGT_5]], i1 noundef true) -; IS__CGSCC_NPM-NEXT: [[CMP_GTE_2:%.*]] = icmp sge i32 [[RET]], 9 -; IS__CGSCC_NPM-NEXT: [[CMP_GTE_3:%.*]] = icmp sge i32 [[RET]], 8 -; IS__CGSCC_NPM-NEXT: [[CMP_GTE_4:%.*]] = icmp sge i32 [[RET]], 1 -; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_GTE_2]], i1 [[CMP_GTE_3]]) -; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_GTE_4]], i1 noundef true, i1 noundef true) -; IS__CGSCC_NPM-NEXT: [[CMP_SLT_2:%.*]] = icmp slt i32 [[RET]], 9 -; IS__CGSCC_NPM-NEXT: [[CMP_SLT_3:%.*]] = icmp slt i32 [[RET]], 8 -; IS__CGSCC_NPM-NEXT: [[CMP_SLT_4:%.*]] = icmp slt i32 [[RET]], 1 -; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_SLT_2]], i1 [[CMP_SLT_3]]) -; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_SLT_4]], i1 noundef false, i1 noundef false) -; IS__CGSCC_NPM-NEXT: [[CMP_LTE_3:%.*]] = icmp sle i32 [[RET]], 8 -; IS__CGSCC_NPM-NEXT: [[CMP_LTE_4:%.*]] = icmp sle i32 [[RET]], 1 -; IS__CGSCC_NPM-NEXT: [[CMP_LTE_5:%.*]] = icmp sle i32 [[RET]], 0 -; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 noundef true, i1 noundef true, i1 [[CMP_LTE_3]]) -; IS__CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_LTE_4]], i1 [[CMP_LTE_5]], i1 noundef false) -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test0-icmp-check +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) { +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = tail call i32 @test0(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR2]], !range [[RNG0]] +; NOT_CGSCC_NPM-NEXT: [[CMP_EQ_2:%.*]] = icmp eq i32 [[RET]], 9 +; NOT_CGSCC_NPM-NEXT: [[CMP_EQ_3:%.*]] = icmp eq i32 [[RET]], 8 +; NOT_CGSCC_NPM-NEXT: [[CMP_EQ_4:%.*]] = icmp eq i32 [[RET]], 1 +; NOT_CGSCC_NPM-NEXT: [[CMP_EQ_5:%.*]] = icmp eq i32 [[RET]], 0 +; NOT_CGSCC_NPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_EQ_2]], i1 [[CMP_EQ_3]]) +; NOT_CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_EQ_4]], i1 [[CMP_EQ_5]], i1 noundef false) +; NOT_CGSCC_NPM-NEXT: [[CMP_NE_2:%.*]] = icmp ne i32 [[RET]], 9 +; NOT_CGSCC_NPM-NEXT: [[CMP_NE_3:%.*]] = icmp ne i32 [[RET]], 8 +; NOT_CGSCC_NPM-NEXT: [[CMP_NE_4:%.*]] = icmp ne i32 [[RET]], 1 +; NOT_CGSCC_NPM-NEXT: [[CMP_NE_5:%.*]] = icmp ne i32 [[RET]], 0 +; NOT_CGSCC_NPM-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_NE_2]], i1 [[CMP_NE_3]]) +; NOT_CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_NE_4]], i1 [[CMP_NE_5]], i1 noundef true) +; NOT_CGSCC_NPM-NEXT: [[CMP_UGT_3:%.*]] = icmp ugt i32 [[RET]], 8 +; NOT_CGSCC_NPM-NEXT: [[CMP_UGT_4:%.*]] = icmp ugt i32 [[RET]], 1 +; NOT_CGSCC_NPM-NEXT: [[CMP_UGT_5:%.*]] = icmp ugt i32 [[RET]], 0 +; NOT_CGSCC_NPM-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_UGT_3]]) +; NOT_CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_UGT_4]], i1 [[CMP_UGT_5]], i1 noundef false) +; NOT_CGSCC_NPM-NEXT: [[CMP_UGE_2:%.*]] = icmp uge i32 [[RET]], 9 +; NOT_CGSCC_NPM-NEXT: [[CMP_UGE_3:%.*]] = icmp uge i32 [[RET]], 8 +; NOT_CGSCC_NPM-NEXT: [[CMP_UGE_4:%.*]] = icmp uge i32 [[RET]], 1 +; NOT_CGSCC_NPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_UGE_2]], i1 [[CMP_UGE_3]]) +; NOT_CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_UGE_4]], i1 noundef true, i1 noundef false) +; NOT_CGSCC_NPM-NEXT: [[CMP_SGT_3:%.*]] = icmp sgt i32 [[RET]], 8 +; NOT_CGSCC_NPM-NEXT: [[CMP_SGT_4:%.*]] = icmp sgt i32 [[RET]], 1 +; NOT_CGSCC_NPM-NEXT: [[CMP_SGT_5:%.*]] = icmp sgt i32 [[RET]], 0 +; NOT_CGSCC_NPM-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_SGT_3]]) +; NOT_CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_SGT_4]], i1 [[CMP_SGT_5]], i1 noundef true) +; NOT_CGSCC_NPM-NEXT: [[CMP_GTE_2:%.*]] = icmp sge i32 [[RET]], 9 +; NOT_CGSCC_NPM-NEXT: [[CMP_GTE_3:%.*]] = icmp sge i32 [[RET]], 8 +; NOT_CGSCC_NPM-NEXT: [[CMP_GTE_4:%.*]] = icmp sge i32 [[RET]], 1 +; NOT_CGSCC_NPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_GTE_2]], i1 [[CMP_GTE_3]]) +; NOT_CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_GTE_4]], i1 noundef true, i1 noundef true) +; NOT_CGSCC_NPM-NEXT: [[CMP_SLT_2:%.*]] = icmp slt i32 [[RET]], 9 +; NOT_CGSCC_NPM-NEXT: [[CMP_SLT_3:%.*]] = icmp slt i32 [[RET]], 8 +; NOT_CGSCC_NPM-NEXT: [[CMP_SLT_4:%.*]] = icmp slt i32 [[RET]], 1 +; NOT_CGSCC_NPM-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_SLT_2]], i1 [[CMP_SLT_3]]) +; NOT_CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_SLT_4]], i1 noundef false, i1 noundef false) +; NOT_CGSCC_NPM-NEXT: [[CMP_LTE_3:%.*]] = icmp sle i32 [[RET]], 8 +; NOT_CGSCC_NPM-NEXT: [[CMP_LTE_4:%.*]] = icmp sle i32 [[RET]], 1 +; NOT_CGSCC_NPM-NEXT: [[CMP_LTE_5:%.*]] = icmp sle i32 [[RET]], 0 +; NOT_CGSCC_NPM-NEXT: tail call void @use3(i1 noundef true, i1 noundef true, i1 [[CMP_LTE_3]]) +; NOT_CGSCC_NPM-NEXT: tail call void @use3(i1 [[CMP_LTE_4]], i1 [[CMP_LTE_5]], i1 noundef false) +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test0-icmp-check +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) { +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = tail call i32 @test0(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR2]], !range [[RNG0]] +; NOT_TUNIT_NPM-NEXT: [[CMP_EQ_2:%.*]] = icmp eq i32 [[RET]], 9 +; NOT_TUNIT_NPM-NEXT: [[CMP_EQ_3:%.*]] = icmp eq i32 [[RET]], 8 +; NOT_TUNIT_NPM-NEXT: [[CMP_EQ_4:%.*]] = icmp eq i32 [[RET]], 1 +; NOT_TUNIT_NPM-NEXT: [[CMP_EQ_5:%.*]] = icmp eq i32 [[RET]], 0 +; NOT_TUNIT_NPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_EQ_2]], i1 [[CMP_EQ_3]]) +; NOT_TUNIT_NPM-NEXT: tail call void @use3(i1 [[CMP_EQ_4]], i1 [[CMP_EQ_5]], i1 noundef false) +; NOT_TUNIT_NPM-NEXT: [[CMP_NE_2:%.*]] = icmp ne i32 [[RET]], 9 +; NOT_TUNIT_NPM-NEXT: [[CMP_NE_3:%.*]] = icmp ne i32 [[RET]], 8 +; NOT_TUNIT_NPM-NEXT: [[CMP_NE_4:%.*]] = icmp ne i32 [[RET]], 1 +; NOT_TUNIT_NPM-NEXT: [[CMP_NE_5:%.*]] = icmp ne i32 [[RET]], 0 +; NOT_TUNIT_NPM-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_NE_2]], i1 [[CMP_NE_3]]) +; NOT_TUNIT_NPM-NEXT: tail call void @use3(i1 [[CMP_NE_4]], i1 [[CMP_NE_5]], i1 noundef true) +; NOT_TUNIT_NPM-NEXT: [[CMP_UGT_3:%.*]] = icmp ugt i32 [[RET]], 8 +; NOT_TUNIT_NPM-NEXT: [[CMP_UGT_4:%.*]] = icmp ugt i32 [[RET]], 1 +; NOT_TUNIT_NPM-NEXT: [[CMP_UGT_5:%.*]] = icmp ugt i32 [[RET]], 0 +; NOT_TUNIT_NPM-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_UGT_3]]) +; NOT_TUNIT_NPM-NEXT: tail call void @use3(i1 [[CMP_UGT_4]], i1 [[CMP_UGT_5]], i1 noundef false) +; NOT_TUNIT_NPM-NEXT: [[CMP_UGE_2:%.*]] = icmp uge i32 [[RET]], 9 +; NOT_TUNIT_NPM-NEXT: [[CMP_UGE_3:%.*]] = icmp uge i32 [[RET]], 8 +; NOT_TUNIT_NPM-NEXT: [[CMP_UGE_4:%.*]] = icmp uge i32 [[RET]], 1 +; NOT_TUNIT_NPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_UGE_2]], i1 [[CMP_UGE_3]]) +; NOT_TUNIT_NPM-NEXT: tail call void @use3(i1 [[CMP_UGE_4]], i1 noundef true, i1 noundef false) +; NOT_TUNIT_NPM-NEXT: [[CMP_SGT_3:%.*]] = icmp sgt i32 [[RET]], 8 +; NOT_TUNIT_NPM-NEXT: [[CMP_SGT_4:%.*]] = icmp sgt i32 [[RET]], 1 +; NOT_TUNIT_NPM-NEXT: [[CMP_SGT_5:%.*]] = icmp sgt i32 [[RET]], 0 +; NOT_TUNIT_NPM-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_SGT_3]]) +; NOT_TUNIT_NPM-NEXT: tail call void @use3(i1 [[CMP_SGT_4]], i1 [[CMP_SGT_5]], i1 noundef true) +; NOT_TUNIT_NPM-NEXT: [[CMP_GTE_2:%.*]] = icmp sge i32 [[RET]], 9 +; NOT_TUNIT_NPM-NEXT: [[CMP_GTE_3:%.*]] = icmp sge i32 [[RET]], 8 +; NOT_TUNIT_NPM-NEXT: [[CMP_GTE_4:%.*]] = icmp sge i32 [[RET]], 1 +; NOT_TUNIT_NPM-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_GTE_2]], i1 [[CMP_GTE_3]]) +; NOT_TUNIT_NPM-NEXT: tail call void @use3(i1 [[CMP_GTE_4]], i1 noundef true, i1 noundef true) +; NOT_TUNIT_NPM-NEXT: [[CMP_SLT_2:%.*]] = icmp slt i32 [[RET]], 9 +; NOT_TUNIT_NPM-NEXT: [[CMP_SLT_3:%.*]] = icmp slt i32 [[RET]], 8 +; NOT_TUNIT_NPM-NEXT: [[CMP_SLT_4:%.*]] = icmp slt i32 [[RET]], 1 +; NOT_TUNIT_NPM-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_SLT_2]], i1 [[CMP_SLT_3]]) +; NOT_TUNIT_NPM-NEXT: tail call void @use3(i1 [[CMP_SLT_4]], i1 noundef false, i1 noundef false) +; NOT_TUNIT_NPM-NEXT: [[CMP_LTE_3:%.*]] = icmp sle i32 [[RET]], 8 +; NOT_TUNIT_NPM-NEXT: [[CMP_LTE_4:%.*]] = icmp sle i32 [[RET]], 1 +; NOT_TUNIT_NPM-NEXT: [[CMP_LTE_5:%.*]] = icmp sle i32 [[RET]], 0 +; NOT_TUNIT_NPM-NEXT: tail call void @use3(i1 noundef true, i1 noundef true, i1 [[CMP_LTE_3]]) +; NOT_TUNIT_NPM-NEXT: tail call void @use3(i1 [[CMP_LTE_4]], i1 [[CMP_LTE_5]], i1 noundef false) +; NOT_TUNIT_NPM-NEXT: ret void ; %ret = tail call i32 @test0(i32 *%p) @@ -339,21 +233,21 @@ ret void } define i32 @test1(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test1 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[LOAD_10_100:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG1:![0-9]+]] -; IS__TUNIT____-NEXT: [[ADD_10_THEN_20_110:%.*]] = add i32 [[LOAD_10_100]], 10 -; IS__TUNIT____-NEXT: [[MUL_10_THEN_200_1091:%.*]] = mul i32 [[ADD_10_THEN_20_110]], 10 -; IS__TUNIT____-NEXT: ret i32 [[MUL_10_THEN_200_1091]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test1 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[LOAD_10_100:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG1:![0-9]+]] -; IS__CGSCC____-NEXT: [[ADD_10_THEN_20_110:%.*]] = add i32 [[LOAD_10_100]], 10 -; IS__CGSCC____-NEXT: [[MUL_10_THEN_200_1091:%.*]] = mul i32 [[ADD_10_THEN_20_110]], 10 -; IS__CGSCC____-NEXT: ret i32 [[MUL_10_THEN_200_1091]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test1 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[LOAD_10_100:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG1:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[ADD_10_THEN_20_110:%.*]] = add i32 [[LOAD_10_100]], 10 +; NOT_CGSCC_NPM-NEXT: [[MUL_10_THEN_200_1091:%.*]] = mul i32 [[ADD_10_THEN_20_110]], 10 +; NOT_CGSCC_NPM-NEXT: ret i32 [[MUL_10_THEN_200_1091]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test1 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[LOAD_10_100:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG1:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[ADD_10_THEN_20_110:%.*]] = add i32 [[LOAD_10_100]], 10 +; NOT_TUNIT_NPM-NEXT: [[MUL_10_THEN_200_1091:%.*]] = mul i32 [[ADD_10_THEN_20_110]], 10 +; NOT_TUNIT_NPM-NEXT: ret i32 [[MUL_10_THEN_200_1091]] ; %load-10-100 = load i32, i32* %p, !range !1 %add-10-then-20-110 = add i32 %load-10-100, 10 @@ -363,33 +257,20 @@ define i1 @test1-check(i32* %p) { ; -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test1-check -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: [[RES:%.*]] = tail call i32 @test1(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR3]], !range [[RNG2:![0-9]+]] -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 500 -; IS__TUNIT_OPM-NEXT: ret i1 [[CMP]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test1-check -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: [[RES:%.*]] = tail call i32 @test1(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR2]], !range [[RNG2:![0-9]+]] -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 500 -; IS__TUNIT_NPM-NEXT: ret i1 [[CMP]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test1-check -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: [[RES:%.*]] = tail call i32 @test1(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR3]], !range [[RNG2:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 500 -; IS__CGSCC_OPM-NEXT: ret i1 [[CMP]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test1-check -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[RES:%.*]] = tail call i32 @test1(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR2]], !range [[RNG2:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 500 -; IS__CGSCC_NPM-NEXT: ret i1 [[CMP]] +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test1-check +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[RES:%.*]] = tail call i32 @test1(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR2]], !range [[RNG2:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 500 +; NOT_CGSCC_NPM-NEXT: ret i1 [[CMP]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test1-check +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[RES:%.*]] = tail call i32 @test1(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR2]], !range [[RNG2:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 500 +; NOT_TUNIT_NPM-NEXT: ret i1 [[CMP]] ; %res = tail call i32 @test1(i32* %p) %cmp = icmp eq i32 %res, 500 @@ -409,23 +290,23 @@ ; } define i32 @test2(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 4 -; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__TUNIT____-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i32 4, i32 3 -; IS__TUNIT____-NEXT: ret i32 [[COND]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 4 -; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__CGSCC____-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i32 4, i32 3 -; IS__CGSCC____-NEXT: ret i32 [[COND]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0 +; NOT_CGSCC_NPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i32 4, i32 3 +; NOT_CGSCC_NPM-NEXT: ret i32 [[COND]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0 +; NOT_TUNIT_NPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i32 4, i32 3 +; NOT_TUNIT_NPM-NEXT: ret i32 [[COND]] ; entry: %0 = load i32, i32* %p, align 4 @@ -435,29 +316,29 @@ } define i32 @test2_check(i32* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2_check -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone align 4 [[P:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[IF_THEN:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: ret i32 2 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2_check -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readnone align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[IF_THEN:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: ret i32 2 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2_check +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone align 4 [[P:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[IF_THEN:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: ret i32 2 +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test2_check +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull readnone align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[IF_THEN:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: ret i32 2 ; entry: %call = tail call i32 @test2(i32* %p) @@ -503,61 +384,25 @@ declare dso_local void @unkown() define internal i32 @r1(i32) local_unnamed_addr { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@r1 -; IS__TUNIT_OPM-SAME: () local_unnamed_addr #[[ATTR2:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: br label [[TMP4:%.*]] -; IS__TUNIT_OPM: 1: -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[TMP7:%.*]], 10000 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[F:%.*]] -; IS__TUNIT_OPM: 3: -; IS__TUNIT_OPM-NEXT: ret i32 20 -; IS__TUNIT_OPM: f: -; IS__TUNIT_OPM-NEXT: ret i32 10 -; IS__TUNIT_OPM: 4: -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP0:%.*]] ], [ [[TMP8:%.*]], [[TMP4]] ] -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = phi i32 [ 0, [[TMP0]] ], [ [[TMP7]], [[TMP4]] ] -; IS__TUNIT_OPM-NEXT: [[TMP7]] = add nuw nsw i32 [[TMP5]], [[TMP6]] -; IS__TUNIT_OPM-NEXT: [[TMP8]] = add nuw nsw i32 [[TMP5]], 1 -; IS__TUNIT_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], 100 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP9]], label [[TMP1:%.*]], label [[TMP4]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@r1 -; IS__CGSCC_OPM-SAME: () local_unnamed_addr #[[ATTR2:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br label [[TMP4:%.*]] -; IS__CGSCC_OPM: 1: -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[TMP7:%.*]], 10000 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[F:%.*]] -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: ret i32 20 -; IS__CGSCC_OPM: f: -; IS__CGSCC_OPM-NEXT: ret i32 10 -; IS__CGSCC_OPM: 4: -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP0:%.*]] ], [ [[TMP8:%.*]], [[TMP4]] ] -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = phi i32 [ 0, [[TMP0]] ], [ [[TMP7]], [[TMP4]] ] -; IS__CGSCC_OPM-NEXT: [[TMP7]] = add nuw nsw i32 [[TMP5]], [[TMP6]] -; IS__CGSCC_OPM-NEXT: [[TMP8]] = add nuw nsw i32 [[TMP5]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], 100 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP9]], label [[TMP1:%.*]], label [[TMP4]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@r1 -; IS__CGSCC_NPM-SAME: () local_unnamed_addr #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: br label [[TMP3:%.*]] -; IS__CGSCC_NPM: 1: -; IS__CGSCC_NPM-NEXT: br label [[F:%.*]] -; IS__CGSCC_NPM: 2: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: f: -; IS__CGSCC_NPM-NEXT: ret i32 undef -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 0, [[TMP0:%.*]] ], [ [[TMP7:%.*]], [[TMP3]] ] -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP0]] ], [ [[TMP6:%.*]], [[TMP3]] ] -; IS__CGSCC_NPM-NEXT: [[TMP6]] = add nuw nsw i32 [[TMP4]], [[TMP5]] -; IS__CGSCC_NPM-NEXT: [[TMP7]] = add nuw nsw i32 [[TMP4]], 1 -; IS__CGSCC_NPM-NEXT: [[TMP8:%.*]] = icmp eq i32 [[TMP7]], 100 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP8]], label [[TMP1:%.*]], label [[TMP3]] +; +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@r1 +; NOT_TUNIT_NPM-SAME: () local_unnamed_addr #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: br label [[TMP3:%.*]] +; NOT_TUNIT_NPM: 1: +; NOT_TUNIT_NPM-NEXT: br label [[F:%.*]] +; NOT_TUNIT_NPM: 2: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: 3: +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 0, [[TMP0:%.*]] ], [ [[TMP7:%.*]], [[TMP3]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP0]] ], [ [[TMP6:%.*]], [[TMP3]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP6]] = add nuw nsw i32 [[TMP4]], [[TMP5]] +; NOT_TUNIT_NPM-NEXT: [[TMP7]] = add nuw nsw i32 [[TMP4]], 1 +; NOT_TUNIT_NPM-NEXT: [[TMP8:%.*]] = icmp eq i32 [[TMP7]], 100 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP8]], label [[TMP1:%.*]], label [[TMP3]] ; br label %5 @@ -578,45 +423,24 @@ } define void @f1(i32){ -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@f1 -; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]]) { -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = tail call i32 @r1() #[[ATTR2]] -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP2]], 15 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP5:%.*]] -; IS__TUNIT_OPM: 4: -; IS__TUNIT_OPM-NEXT: tail call void @unkown() -; IS__TUNIT_OPM-NEXT: br label [[TMP5]] -; IS__TUNIT_OPM: 5: -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f1 -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: br label [[TMP3:%.*]] -; IS__TUNIT_NPM: 2: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: 3: -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]]) { -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = tail call i32 @r1() #[[ATTR4:[0-9]+]], !range [[RNG3:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP2]], 15 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP5:%.*]] -; IS__CGSCC_OPM: 4: -; IS__CGSCC_OPM-NEXT: tail call void @unkown() -; IS__CGSCC_OPM-NEXT: br label [[TMP5]] -; IS__CGSCC_OPM: 5: -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: br label [[TMP3:%.*]] -; IS__CGSCC_NPM: 2: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f1 +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: br label [[TMP3:%.*]] +; NOT_CGSCC_NPM: 2: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: 3: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f1 +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: br label [[TMP3:%.*]] +; NOT_TUNIT_NPM: 2: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: 3: +; NOT_TUNIT_NPM-NEXT: ret void ; %2 = tail call i32 @r1(i32 %0) %3 = icmp sgt i32 %2, 15 @@ -641,29 +465,29 @@ ; } ; } define dso_local i32 @test4-f1(i32 %u) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test4-f1 -; IS__TUNIT____-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[U]], [[IF_THEN]] ], [ 0, [[ENTRY:%.*]] ] -; IS__TUNIT____-NEXT: ret i32 [[RETVAL_0]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test4-f1 -; IS__CGSCC____-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[U]], [[IF_THEN]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC____-NEXT: ret i32 [[RETVAL_0]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test4-f1 +; NOT_CGSCC_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[U]], [[IF_THEN]] ], [ 0, [[ENTRY:%.*]] ] +; NOT_CGSCC_NPM-NEXT: ret i32 [[RETVAL_0]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test4-f1 +; NOT_TUNIT_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[U]], [[IF_THEN]] ], [ 0, [[ENTRY:%.*]] ] +; NOT_TUNIT_NPM-NEXT: ret i32 [[RETVAL_0]] ; ; FIXME: RETVAL_0 >= 0 entry: @@ -680,26 +504,19 @@ define dso_local i32 @test4-g1(i32 %u) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test4-g1 -; IS__TUNIT____-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: ret i32 [[CALL]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test4-g1 -; IS__CGSCC_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR5:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 [[CALL]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test4-g1 -; IS__CGSCC_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR3:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 [[CALL]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test4-g1 +; NOT_CGSCC_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR1]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[CALL]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test4-g1 +; NOT_TUNIT_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR3:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[CALL]] ; ; FIXME: %call should have range [0, inf] @@ -717,35 +534,35 @@ ; } ; } define dso_local i32 @test4-f2(i32 %u) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test4-f2 -; IS__TUNIT____-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[ADD:%.*]] = add nuw nsw i32 [[U]], 1 -; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT____: if.else: -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[ADD]], [[IF_THEN]] ], [ 1, [[IF_ELSE]] ] -; IS__TUNIT____-NEXT: ret i32 [[RETVAL_0]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test4-f2 -; IS__CGSCC____-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: [[ADD:%.*]] = add nuw nsw i32 [[U]], 1 -; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC____: if.else: -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[ADD]], [[IF_THEN]] ], [ 1, [[IF_ELSE]] ] -; IS__CGSCC____-NEXT: ret i32 [[RETVAL_0]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test4-f2 +; NOT_CGSCC_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = add nuw nsw i32 [[U]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_CGSCC_NPM: if.else: +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[ADD]], [[IF_THEN]] ], [ 1, [[IF_ELSE]] ] +; NOT_CGSCC_NPM-NEXT: ret i32 [[RETVAL_0]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test4-f2 +; NOT_TUNIT_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: [[ADD:%.*]] = add nuw nsw i32 [[U]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_TUNIT_NPM: if.else: +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[ADD]], [[IF_THEN]] ], [ 1, [[IF_ELSE]] ] +; NOT_TUNIT_NPM-NEXT: ret i32 [[RETVAL_0]] ; entry: %cmp = icmp sgt i32 %u, -1 @@ -765,33 +582,20 @@ define dso_local i32 @test4-g2(i32 %u) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test4-g2 -; IS__TUNIT_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR1]] -; IS__TUNIT_OPM-NEXT: ret i32 [[CALL]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test4-g2 -; IS__TUNIT_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR1]], !range [[RNG3:![0-9]+]] -; IS__TUNIT_NPM-NEXT: ret i32 [[CALL]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test4-g2 -; IS__CGSCC_OPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: ret i32 [[CALL]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test4-g2 -; IS__CGSCC_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR3]], !range [[RNG3:![0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 [[CALL]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test4-g2 +; NOT_CGSCC_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR1]], !range [[RNG3:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[CALL]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test4-g2 +; NOT_TUNIT_NPM-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR3]], !range [[RNG3:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[CALL]] ; entry: %call = tail call i32 @test4-f2(i32 %u) @@ -799,62 +603,38 @@ } define dso_local i32 @test-5() { -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test-5() { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noundef i32 @rec(i32 noundef 0), !range [[RNG3:![0-9]+]] -; IS__TUNIT_OPM-NEXT: ret i32 [[CALL]] ; -; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@test-5() { -; NOT_TUNIT_OPM-NEXT: entry: -; NOT_TUNIT_OPM-NEXT: [[CALL:%.*]] = call noundef i32 @rec(i32 noundef 0), !range [[RNG4:![0-9]+]] -; NOT_TUNIT_OPM-NEXT: ret i32 [[CALL]] +; CHECK-LABEL: define {{[^@]+}}@test-5() { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[CALL:%.*]] = call noundef i32 @rec(i32 noundef 0), !range [[RNG4:![0-9]+]] +; CHECK-NEXT: ret i32 [[CALL]] ; entry: %call = call i32 @rec(i32 0) ret i32 %call } define internal i32 @rec(i32 %depth) { -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@rec -; IS__TUNIT_OPM-SAME: (i32 [[DEPTH:%.*]]) { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32 @foo(i32 [[DEPTH]]) -; IS__TUNIT_OPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[CALL]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__TUNIT_OPM: if.then: -; IS__TUNIT_OPM-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT_OPM: if.end: -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[DEPTH]], 10 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN1:%.*]], label [[IF_END3:%.*]] -; IS__TUNIT_OPM: if.then1: -; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[DEPTH]], 1 -; IS__TUNIT_OPM-NEXT: [[CALL2:%.*]] = call i32 @rec(i32 [[ADD]]), !range [[RNG3]] -; IS__TUNIT_OPM-NEXT: br label [[IF_END3]] -; IS__TUNIT_OPM: if.end3: -; IS__TUNIT_OPM-NEXT: br label [[RETURN]] -; IS__TUNIT_OPM: return: -; IS__TUNIT_OPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ 0, [[IF_THEN]] ], [ 1, [[IF_END3]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[RETVAL_0]] -; -; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@rec -; NOT_TUNIT_OPM-SAME: (i32 [[DEPTH:%.*]]) { -; NOT_TUNIT_OPM-NEXT: entry: -; NOT_TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32 @foo(i32 [[DEPTH]]) -; NOT_TUNIT_OPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[CALL]], 0 -; NOT_TUNIT_OPM-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; NOT_TUNIT_OPM: if.then: -; NOT_TUNIT_OPM-NEXT: br label [[RETURN:%.*]] -; NOT_TUNIT_OPM: if.end: -; NOT_TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[DEPTH]], 10 -; NOT_TUNIT_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN1:%.*]], label [[IF_END3:%.*]] -; NOT_TUNIT_OPM: if.then1: -; NOT_TUNIT_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[DEPTH]], 1 -; NOT_TUNIT_OPM-NEXT: [[CALL2:%.*]] = call i32 @rec(i32 [[ADD]]), !range [[RNG4]] -; NOT_TUNIT_OPM-NEXT: br label [[IF_END3]] -; NOT_TUNIT_OPM: if.end3: -; NOT_TUNIT_OPM-NEXT: br label [[RETURN]] -; NOT_TUNIT_OPM: return: -; NOT_TUNIT_OPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ 0, [[IF_THEN]] ], [ 1, [[IF_END3]] ] -; NOT_TUNIT_OPM-NEXT: ret i32 [[RETVAL_0]] +; +; CHECK-LABEL: define {{[^@]+}}@rec +; CHECK-SAME: (i32 [[DEPTH:%.*]]) { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[CALL:%.*]] = call i32 @foo(i32 [[DEPTH]]) +; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[CALL]], 0 +; CHECK-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; CHECK: if.then: +; CHECK-NEXT: br label [[RETURN:%.*]] +; CHECK: if.end: +; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[DEPTH]], 10 +; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN1:%.*]], label [[IF_END3:%.*]] +; CHECK: if.then1: +; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[DEPTH]], 1 +; CHECK-NEXT: [[CALL2:%.*]] = call i32 @rec(i32 [[ADD]]), !range [[RNG4]] +; CHECK-NEXT: br label [[IF_END3]] +; CHECK: if.end3: +; CHECK-NEXT: br label [[RETURN]] +; CHECK: return: +; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i32 [ 0, [[IF_THEN]] ], [ 1, [[IF_END3]] ] +; CHECK-NEXT: ret i32 [[RETVAL_0]] ; entry: %call = call i32 @foo(i32 %depth) @@ -891,57 +671,57 @@ ; FIXME: All but the return is not needed anymore define dso_local zeroext i1 @phi(i32 %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@phi -; IS__TUNIT____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: bb: -; IS__TUNIT____-NEXT: [[TMP:%.*]] = icmp sgt i32 [[ARG]], 5 -; IS__TUNIT____-NEXT: br i1 [[TMP]], label [[BB1:%.*]], label [[BB2:%.*]] -; IS__TUNIT____: bb1: -; IS__TUNIT____-NEXT: br label [[BB3:%.*]] -; IS__TUNIT____: bb2: -; IS__TUNIT____-NEXT: br label [[BB3]] -; IS__TUNIT____: bb3: -; IS__TUNIT____-NEXT: [[TMP4:%.*]] = icmp sgt i32 [[ARG]], 10 -; IS__TUNIT____-NEXT: br i1 [[TMP4]], label [[BB5:%.*]], label [[BB7:%.*]] -; IS__TUNIT____: bb5: -; IS__TUNIT____-NEXT: br label [[BB9:%.*]] -; IS__TUNIT____: bb7: -; IS__TUNIT____-NEXT: br label [[BB9]] -; IS__TUNIT____: bb9: -; IS__TUNIT____-NEXT: br label [[BB12:%.*]] -; IS__TUNIT____: bb11: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: bb12: -; IS__TUNIT____-NEXT: br label [[BB13:%.*]] -; IS__TUNIT____: bb13: -; IS__TUNIT____-NEXT: ret i1 false -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@phi -; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: bb: -; IS__CGSCC____-NEXT: [[TMP:%.*]] = icmp sgt i32 [[ARG]], 5 -; IS__CGSCC____-NEXT: br i1 [[TMP]], label [[BB1:%.*]], label [[BB2:%.*]] -; IS__CGSCC____: bb1: -; IS__CGSCC____-NEXT: br label [[BB3:%.*]] -; IS__CGSCC____: bb2: -; IS__CGSCC____-NEXT: br label [[BB3]] -; IS__CGSCC____: bb3: -; IS__CGSCC____-NEXT: [[TMP4:%.*]] = icmp sgt i32 [[ARG]], 10 -; IS__CGSCC____-NEXT: br i1 [[TMP4]], label [[BB5:%.*]], label [[BB7:%.*]] -; IS__CGSCC____: bb5: -; IS__CGSCC____-NEXT: br label [[BB9:%.*]] -; IS__CGSCC____: bb7: -; IS__CGSCC____-NEXT: br label [[BB9]] -; IS__CGSCC____: bb9: -; IS__CGSCC____-NEXT: br label [[BB12:%.*]] -; IS__CGSCC____: bb11: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: bb12: -; IS__CGSCC____-NEXT: br label [[BB13:%.*]] -; IS__CGSCC____: bb13: -; IS__CGSCC____-NEXT: ret i1 false +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@phi +; NOT_CGSCC_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: bb: +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[ARG]], 5 +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP]], label [[BB1:%.*]], label [[BB2:%.*]] +; NOT_CGSCC_NPM: bb1: +; NOT_CGSCC_NPM-NEXT: br label [[BB3:%.*]] +; NOT_CGSCC_NPM: bb2: +; NOT_CGSCC_NPM-NEXT: br label [[BB3]] +; NOT_CGSCC_NPM: bb3: +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = icmp sgt i32 [[ARG]], 10 +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP4]], label [[BB5:%.*]], label [[BB7:%.*]] +; NOT_CGSCC_NPM: bb5: +; NOT_CGSCC_NPM-NEXT: br label [[BB9:%.*]] +; NOT_CGSCC_NPM: bb7: +; NOT_CGSCC_NPM-NEXT: br label [[BB9]] +; NOT_CGSCC_NPM: bb9: +; NOT_CGSCC_NPM-NEXT: br label [[BB12:%.*]] +; NOT_CGSCC_NPM: bb11: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: bb12: +; NOT_CGSCC_NPM-NEXT: br label [[BB13:%.*]] +; NOT_CGSCC_NPM: bb13: +; NOT_CGSCC_NPM-NEXT: ret i1 false +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@phi +; NOT_TUNIT_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: bb: +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[ARG]], 5 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP]], label [[BB1:%.*]], label [[BB2:%.*]] +; NOT_TUNIT_NPM: bb1: +; NOT_TUNIT_NPM-NEXT: br label [[BB3:%.*]] +; NOT_TUNIT_NPM: bb2: +; NOT_TUNIT_NPM-NEXT: br label [[BB3]] +; NOT_TUNIT_NPM: bb3: +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = icmp sgt i32 [[ARG]], 10 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP4]], label [[BB5:%.*]], label [[BB7:%.*]] +; NOT_TUNIT_NPM: bb5: +; NOT_TUNIT_NPM-NEXT: br label [[BB9:%.*]] +; NOT_TUNIT_NPM: bb7: +; NOT_TUNIT_NPM-NEXT: br label [[BB9]] +; NOT_TUNIT_NPM: bb9: +; NOT_TUNIT_NPM-NEXT: br label [[BB12:%.*]] +; NOT_TUNIT_NPM: bb11: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: bb12: +; NOT_TUNIT_NPM-NEXT: br label [[BB13:%.*]] +; NOT_TUNIT_NPM: bb13: +; NOT_TUNIT_NPM-NEXT: ret i1 false ; bb: %tmp = icmp sgt i32 %arg, 5 @@ -983,17 +763,17 @@ } define dso_local i1 @select(i32 %a) local_unnamed_addr #0 { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@select -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i1 false -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@select -; IS__CGSCC____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i1 false +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@select +; NOT_CGSCC_NPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i1 false +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@select +; NOT_TUNIT_NPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i1 false ; entry: %cmp = icmp sgt i32 %a, 5 @@ -1006,17 +786,17 @@ } define dso_local i32 @select_zext(i32 %a) local_unnamed_addr #0 { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@select_zext -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@select_zext -; IS__CGSCC____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@select_zext +; NOT_CGSCC_NPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32 0 +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@select_zext +; NOT_TUNIT_NPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; entry: %cmp = icmp sgt i32 %a, 5 @@ -1030,17 +810,17 @@ } define dso_local i64 @select_int2ptr_bitcast_ptr2int(i32 %a) local_unnamed_addr #0 { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@select_int2ptr_bitcast_ptr2int -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i64 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@select_int2ptr_bitcast_ptr2int -; IS__CGSCC____-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i64 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@select_int2ptr_bitcast_ptr2int +; NOT_CGSCC_NPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i64 0 +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@select_int2ptr_bitcast_ptr2int +; NOT_TUNIT_NPM-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i64 0 ; entry: %cmp = icmp sgt i32 %a, 5 @@ -1058,117 +838,105 @@ ; } define i1 @f_fcmp(float %a, float %b) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@f_fcmp -; IS__TUNIT____-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[R:%.*]] = fcmp uge float [[A]], [[B]] -; IS__TUNIT____-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__TUNIT____-NEXT: ret i1 [[S]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@f_fcmp -; IS__CGSCC____-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[R:%.*]] = fcmp uge float [[A]], [[B]] -; IS__CGSCC____-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__CGSCC____-NEXT: ret i1 [[S]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f_fcmp +; NOT_CGSCC_NPM-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[R:%.*]] = fcmp uge float [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; NOT_CGSCC_NPM-NEXT: ret i1 [[S]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f_fcmp +; NOT_TUNIT_NPM-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[R:%.*]] = fcmp uge float [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; NOT_TUNIT_NPM-NEXT: ret i1 [[S]] ; %r = fcmp uge float %a, %b %s = select i1 %r, i1 %r, i1 0 ret i1 %s } define i1 @d_fcmp(double %a, double %b) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@d_fcmp -; IS__TUNIT____-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[R:%.*]] = fcmp oeq double [[A]], [[B]] -; IS__TUNIT____-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__TUNIT____-NEXT: ret i1 [[S]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@d_fcmp -; IS__CGSCC____-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[R:%.*]] = fcmp oeq double [[A]], [[B]] -; IS__CGSCC____-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__CGSCC____-NEXT: ret i1 [[S]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@d_fcmp +; NOT_CGSCC_NPM-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[R:%.*]] = fcmp oeq double [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; NOT_CGSCC_NPM-NEXT: ret i1 [[S]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@d_fcmp +; NOT_TUNIT_NPM-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[R:%.*]] = fcmp oeq double [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; NOT_TUNIT_NPM-NEXT: ret i1 [[S]] ; %r = fcmp oeq double %a, %b %s = select i1 %r, i1 %r, i1 0 ret i1 %s } define i1 @dp_icmp(double* %a, double* %b) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@dp_icmp -; IS__TUNIT____-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone [[B:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[R:%.*]] = icmp sge double* [[A]], [[B]] -; IS__TUNIT____-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__TUNIT____-NEXT: ret i1 [[S]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@dp_icmp -; IS__CGSCC____-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone [[B:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[R:%.*]] = icmp sge double* [[A]], [[B]] -; IS__CGSCC____-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__CGSCC____-NEXT: ret i1 [[S]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@dp_icmp +; NOT_CGSCC_NPM-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone [[B:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[R:%.*]] = icmp sge double* [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; NOT_CGSCC_NPM-NEXT: ret i1 [[S]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@dp_icmp +; NOT_TUNIT_NPM-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone [[B:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[R:%.*]] = icmp sge double* [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; NOT_TUNIT_NPM-NEXT: ret i1 [[S]] ; %r = icmp sge double* %a, %b %s = select i1 %r, i1 %r, i1 0 ret i1 %s } define i1 @ip_icmp(i8* %a, i8* %b) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ip_icmp -; IS__TUNIT____-SAME: (i8* nofree readnone [[A:%.*]], i8* nofree readnone [[B:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[R:%.*]] = icmp ult i8* [[A]], [[B]] -; IS__TUNIT____-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__TUNIT____-NEXT: ret i1 [[S]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ip_icmp -; IS__CGSCC____-SAME: (i8* nofree readnone [[A:%.*]], i8* nofree readnone [[B:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[R:%.*]] = icmp ult i8* [[A]], [[B]] -; IS__CGSCC____-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false -; IS__CGSCC____-NEXT: ret i1 [[S]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ip_icmp +; NOT_CGSCC_NPM-SAME: (i8* nofree readnone [[A:%.*]], i8* nofree readnone [[B:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[R:%.*]] = icmp ult i8* [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; NOT_CGSCC_NPM-NEXT: ret i1 [[S]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ip_icmp +; NOT_TUNIT_NPM-SAME: (i8* nofree readnone [[A:%.*]], i8* nofree readnone [[B:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[R:%.*]] = icmp ult i8* [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; NOT_TUNIT_NPM-NEXT: ret i1 [[S]] ; %r = icmp ult i8* %a, %b %s = select i1 %r, i1 %r, i1 0 ret i1 %s } define i1 @fcmp_caller(float %fa, float %fb, double %da, double %db, double* %dpa, double* %dpb, i8* %ipa, i8* %ipb) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@fcmp_caller -; IS__TUNIT____-SAME: (float [[FA:%.*]], float [[FB:%.*]], double [[DA:%.*]], double [[DB:%.*]], double* nofree readnone [[DPA:%.*]], double* nofree readnone [[DPB:%.*]], i8* nofree readnone [[IPA:%.*]], i8* nofree readnone [[IPB:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] -; IS__TUNIT____-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] -; IS__TUNIT____-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] -; IS__TUNIT____-NEXT: ret i1 [[O3]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fcmp_caller -; IS__CGSCC_OPM-SAME: (float [[FA:%.*]], float [[FB:%.*]], double [[DA:%.*]], double [[DB:%.*]], double* nofree readnone [[DPA:%.*]], double* nofree readnone [[DPB:%.*]], i8* nofree readnone [[IPA:%.*]], i8* nofree readnone [[IPB:%.*]]) #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] -; IS__CGSCC_OPM-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] -; IS__CGSCC_OPM-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] -; IS__CGSCC_OPM-NEXT: ret i1 [[O3]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fcmp_caller -; IS__CGSCC_NPM-SAME: (float [[FA:%.*]], float [[FB:%.*]], double [[DA:%.*]], double [[DB:%.*]], double* nofree readnone [[DPA:%.*]], double* nofree readnone [[DPB:%.*]], i8* nofree readnone [[IPA:%.*]], i8* nofree readnone [[IPB:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR3]] -; IS__CGSCC_NPM-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR3]] -; IS__CGSCC_NPM-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR3]] -; IS__CGSCC_NPM-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR3]] -; IS__CGSCC_NPM-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] -; IS__CGSCC_NPM-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] -; IS__CGSCC_NPM-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] -; IS__CGSCC_NPM-NEXT: ret i1 [[O3]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@fcmp_caller +; NOT_CGSCC_NPM-SAME: (float [[FA:%.*]], float [[FB:%.*]], double [[DA:%.*]], double [[DB:%.*]], double* nofree readnone [[DPA:%.*]], double* nofree readnone [[DPB:%.*]], i8* nofree readnone [[IPA:%.*]], i8* nofree readnone [[IPB:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR1]] +; NOT_CGSCC_NPM-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR1]] +; NOT_CGSCC_NPM-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR1]] +; NOT_CGSCC_NPM-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR1]] +; NOT_CGSCC_NPM-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] +; NOT_CGSCC_NPM-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] +; NOT_CGSCC_NPM-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] +; NOT_CGSCC_NPM-NEXT: ret i1 [[O3]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fcmp_caller +; NOT_TUNIT_NPM-SAME: (float [[FA:%.*]], float [[FB:%.*]], double [[DA:%.*]], double [[DB:%.*]], double* nofree readnone [[DPA:%.*]], double* nofree readnone [[DPB:%.*]], i8* nofree readnone [[IPA:%.*]], i8* nofree readnone [[IPB:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] +; NOT_TUNIT_NPM-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] +; NOT_TUNIT_NPM-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] +; NOT_TUNIT_NPM-NEXT: ret i1 [[O3]] ; %r1 = call i1 @f_fcmp(float %fa, float %fb) %r2 = call i1 @d_fcmp(double %da, double %db) @@ -1181,43 +949,43 @@ } define i8 @ret_two() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_two -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 2 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ret_two +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i8 2 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_two -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 2 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ret_two +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i8 2 ; ret i8 2 } define i8 @ret_undef() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_undef -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 undef +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ret_undef +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i8 undef ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_undef -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ret_undef +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i8 undef ; ret i8 undef } ; Verify we collapse undef to a value and return something non-undef here. define i8 @undef_collapse_1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@undef_collapse_1 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@undef_collapse_1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i8 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@undef_collapse_1 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@undef_collapse_1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i8 0 ; %c = call i8 @ret_undef() %s = shl i8 %c, 2 @@ -1226,15 +994,15 @@ ; Verify we collapse undef to a value and return something non-undef here. define i8 @undef_collapse_2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@undef_collapse_2 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@undef_collapse_2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i8 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@undef_collapse_2 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@undef_collapse_2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i8 0 ; %c = call i8 @ret_two() %s = shl i8 undef, %c @@ -1243,15 +1011,15 @@ define i8 @undef_collapse_caller() { ; -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@undef_collapse_caller -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@undef_collapse_caller +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i8 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@undef_collapse_caller -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@undef_collapse_caller +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i8 0 ; %c1 = call i8 @undef_collapse_1() %c2 = call i8 @undef_collapse_2() @@ -1260,32 +1028,32 @@ } define i32 @ret1or2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret1or2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[S:%.*]] = select i1 [[C]], i32 1, i32 2 -; IS__TUNIT____-NEXT: ret i32 [[S]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret1or2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[S:%.*]] = select i1 [[C]], i32 1, i32 2 -; IS__CGSCC____-NEXT: ret i32 [[S]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ret1or2 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[S:%.*]] = select i1 [[C]], i32 1, i32 2 +; NOT_CGSCC_NPM-NEXT: ret i32 [[S]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ret1or2 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[S:%.*]] = select i1 [[C]], i32 1, i32 2 +; NOT_TUNIT_NPM-NEXT: ret i32 [[S]] ; %s = select i1 %c, i32 1, i32 2 ret i32 %s } define i1 @callee_range_1(i1 %c1, i1 %c2, i1 %c3) { ; -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@callee_range_1 -; IS__TUNIT____-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 true +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callee_range_1 +; NOT_CGSCC_NPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i1 true ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@callee_range_1 -; IS__CGSCC____-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 true +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callee_range_1 +; NOT_TUNIT_NPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i1 true ; %r1 = call i32 @ret1or2(i1 %c1) %r2 = call i32 @ret1or2(i1 %c2) @@ -1299,43 +1067,24 @@ define i1 @callee_range_2(i1 %c1, i1 %c2) { ; -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callee_range_2 -; IS__TUNIT_OPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR1]], !range [[RNG4:![0-9]+]] -; IS__TUNIT_OPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR1]], !range [[RNG4]] -; IS__TUNIT_OPM-NEXT: [[A:%.*]] = add i32 [[R1]], [[R2]] -; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 3 -; IS__TUNIT_OPM-NEXT: [[F:%.*]] = and i1 [[I1]], true -; IS__TUNIT_OPM-NEXT: ret i1 [[F]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callee_range_2 -; IS__TUNIT_NPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR1]], !range [[RNG5:![0-9]+]] -; IS__TUNIT_NPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR1]], !range [[RNG5]] -; IS__TUNIT_NPM-NEXT: [[A:%.*]] = add i32 [[R1]], [[R2]] -; IS__TUNIT_NPM-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 3 -; IS__TUNIT_NPM-NEXT: ret i1 [[I1]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@callee_range_2 -; IS__CGSCC_OPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR5]], !range [[RNG5:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR5]], !range [[RNG5]] -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = add i32 [[R1]], [[R2]] -; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 3 -; IS__CGSCC_OPM-NEXT: [[F:%.*]] = and i1 [[I1]], true -; IS__CGSCC_OPM-NEXT: ret i1 [[F]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@callee_range_2 -; IS__CGSCC_NPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR3]], !range [[RNG5:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR3]], !range [[RNG5]] -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = add i32 [[R1]], [[R2]] -; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 3 -; IS__CGSCC_NPM-NEXT: ret i1 [[I1]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callee_range_2 +; NOT_CGSCC_NPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR1]], !range [[RNG5:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR1]], !range [[RNG5]] +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = add i32 [[R1]], [[R2]] +; NOT_CGSCC_NPM-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 3 +; NOT_CGSCC_NPM-NEXT: ret i1 [[I1]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callee_range_2 +; NOT_TUNIT_NPM-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR3]], !range [[RNG5:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR3]], !range [[RNG5]] +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = add i32 [[R1]], [[R2]] +; NOT_TUNIT_NPM-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 3 +; NOT_TUNIT_NPM-NEXT: ret i1 [[I1]] ; %r1 = call i32 @ret1or2(i1 %c1) %r2 = call i32 @ret1or2(i1 %c2) @@ -1348,72 +1097,45 @@ define i32 @ret100() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret100 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32 100 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ret100 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i32 100 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret100 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 100 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ret100 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i32 100 ; ret i32 100 } define i1 @ctx_adjustment(i32 %V) { ; -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@ctx_adjustment -; IS__TUNIT_OPM-SAME: (i32 [[V:%.*]]) #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 -; IS__TUNIT_OPM-NEXT: br i1 [[C1]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] -; IS__TUNIT_OPM: if.true: -; IS__TUNIT_OPM-NEXT: br label [[END:%.*]] -; IS__TUNIT_OPM: if.false: -; IS__TUNIT_OPM-NEXT: br label [[END]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: [[PHI:%.*]] = phi i32 [ [[V]], [[IF_TRUE]] ], [ 100, [[IF_FALSE]] ] -; IS__TUNIT_OPM-NEXT: [[C2:%.*]] = icmp sge i32 [[PHI]], 100 -; IS__TUNIT_OPM-NEXT: ret i1 [[C2]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@ctx_adjustment -; IS__TUNIT_NPM-SAME: (i32 [[V:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 -; IS__TUNIT_NPM-NEXT: br i1 [[C1]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] -; IS__TUNIT_NPM: if.true: -; IS__TUNIT_NPM-NEXT: br label [[END:%.*]] -; IS__TUNIT_NPM: if.false: -; IS__TUNIT_NPM-NEXT: br label [[END]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: ret i1 true -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ctx_adjustment -; IS__CGSCC_OPM-SAME: (i32 [[V:%.*]]) #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 -; IS__CGSCC_OPM-NEXT: br i1 [[C1]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] -; IS__CGSCC_OPM: if.true: -; IS__CGSCC_OPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_OPM: if.false: -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: [[PHI:%.*]] = phi i32 [ [[V]], [[IF_TRUE]] ], [ 100, [[IF_FALSE]] ] -; IS__CGSCC_OPM-NEXT: [[C2:%.*]] = icmp sge i32 [[PHI]], 100 -; IS__CGSCC_OPM-NEXT: ret i1 [[C2]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ctx_adjustment -; IS__CGSCC_NPM-SAME: (i32 [[V:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 -; IS__CGSCC_NPM-NEXT: br i1 [[C1]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] -; IS__CGSCC_NPM: if.true: -; IS__CGSCC_NPM-NEXT: br label [[END:%.*]] -; IS__CGSCC_NPM: if.false: -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret i1 true +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ctx_adjustment +; NOT_CGSCC_NPM-SAME: (i32 [[V:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 +; NOT_CGSCC_NPM-NEXT: br i1 [[C1]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] +; NOT_CGSCC_NPM: if.true: +; NOT_CGSCC_NPM-NEXT: br label [[END:%.*]] +; NOT_CGSCC_NPM: if.false: +; NOT_CGSCC_NPM-NEXT: br label [[END]] +; NOT_CGSCC_NPM: end: +; NOT_CGSCC_NPM-NEXT: ret i1 true +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ctx_adjustment +; NOT_TUNIT_NPM-SAME: (i32 [[V:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 +; NOT_TUNIT_NPM-NEXT: br i1 [[C1]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] +; NOT_TUNIT_NPM: if.true: +; NOT_TUNIT_NPM-NEXT: br label [[END:%.*]] +; NOT_TUNIT_NPM: if.false: +; NOT_TUNIT_NPM-NEXT: br label [[END]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: ret i1 true ; %c1 = icmp sge i32 %V, 100 br i1 %c1, label %if.true, label %if.false @@ -1430,70 +1152,47 @@ define i32 @func(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@func -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[RET:%.*]] = select i1 [[C]], i32 0, i32 1 -; IS__TUNIT____-NEXT: ret i32 [[RET]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@func -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[RET:%.*]] = select i1 [[C]], i32 0, i32 1 -; IS__CGSCC____-NEXT: ret i32 [[RET]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@func +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = select i1 [[C]], i32 0, i32 1 +; NOT_CGSCC_NPM-NEXT: ret i32 [[RET]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@func +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = select i1 [[C]], i32 0, i32 1 +; NOT_TUNIT_NPM-NEXT: ret i32 [[RET]] ; %ret = select i1 %c, i32 0, i32 1 ret i32 %ret } define i32 @simplify_callsite_argument(i1 %d) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@simplify_callsite_argument -; IS__TUNIT_OPM-SAME: (i1 [[D:%.*]]) #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = select i1 [[D]], i1 true, i1 false -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT_OPM: t: -; IS__TUNIT_OPM-NEXT: [[RET1:%.*]] = call noundef i32 @func(i1 noundef [[C]]) #[[ATTR1]], !range [[RNG3]] -; IS__TUNIT_OPM-NEXT: ret i32 [[RET1]] -; IS__TUNIT_OPM: f: -; IS__TUNIT_OPM-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR1]], !range [[RNG3]] -; IS__TUNIT_OPM-NEXT: ret i32 [[RET2]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@simplify_callsite_argument -; IS__TUNIT_NPM-SAME: (i1 [[D:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = select i1 [[D]], i1 true, i1 false -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT_NPM: t: -; IS__TUNIT_NPM-NEXT: [[RET1:%.*]] = call noundef i32 @func(i1 noundef true) #[[ATTR1]], !range [[RNG4]] -; IS__TUNIT_NPM-NEXT: ret i32 [[RET1]] -; IS__TUNIT_NPM: f: -; IS__TUNIT_NPM-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR1]], !range [[RNG4]] -; IS__TUNIT_NPM-NEXT: ret i32 [[RET2]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@simplify_callsite_argument -; IS__CGSCC_OPM-SAME: (i1 [[D:%.*]]) #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = select i1 [[D]], i1 true, i1 false -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_OPM: t: -; IS__CGSCC_OPM-NEXT: [[RET1:%.*]] = call noundef i32 @func(i1 noundef [[C]]) #[[ATTR5]], !range [[RNG4]] -; IS__CGSCC_OPM-NEXT: ret i32 [[RET1]] -; IS__CGSCC_OPM: f: -; IS__CGSCC_OPM-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR5]], !range [[RNG4]] -; IS__CGSCC_OPM-NEXT: ret i32 [[RET2]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@simplify_callsite_argument -; IS__CGSCC_NPM-SAME: (i1 [[D:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = select i1 [[D]], i1 true, i1 false -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_NPM: t: -; IS__CGSCC_NPM-NEXT: [[RET1:%.*]] = call noundef i32 @func(i1 noundef true) #[[ATTR3]], !range [[RNG4]] -; IS__CGSCC_NPM-NEXT: ret i32 [[RET1]] -; IS__CGSCC_NPM: f: -; IS__CGSCC_NPM-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR3]], !range [[RNG4]] -; IS__CGSCC_NPM-NEXT: ret i32 [[RET2]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@simplify_callsite_argument +; NOT_CGSCC_NPM-SAME: (i1 [[D:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = select i1 [[D]], i1 true, i1 false +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: [[RET1:%.*]] = call noundef i32 @func(i1 noundef true) #[[ATTR1]], !range [[RNG4]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[RET1]] +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR1]], !range [[RNG4]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[RET2]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@simplify_callsite_argument +; NOT_TUNIT_NPM-SAME: (i1 [[D:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = select i1 [[D]], i1 true, i1 false +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: [[RET1:%.*]] = call noundef i32 @func(i1 noundef true) #[[ATTR3]], !range [[RNG4]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[RET1]] +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR3]], !range [[RNG4]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[RET2]] ; %c = select i1 %d, i1 true, i1 false br i1 %c, label %t, label %f @@ -1507,37 +1206,37 @@ define internal i32 @less_than_65536(i32 %arg) { ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@less_than_65536 -; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[SHRINKED:%.*]] = udiv i32 undef, 65536 -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@less_than_65536 +; NOT_TUNIT_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[SHRINKED:%.*]] = udiv i32 undef, 65536 +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %shrinked = udiv i32 %arg, 65536 ret i32 %shrinked } define internal i1 @is_less_than_65536(i32 %arg) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@is_less_than_65536 -; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp ult i32 undef, 65536 -; IS__CGSCC____-NEXT: ret i1 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@is_less_than_65536 +; NOT_TUNIT_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp ult i32 undef, 65536 +; NOT_TUNIT_NPM-NEXT: ret i1 undef ; %cmp = icmp ult i32 %arg, 65536 ret i1 %cmp } define i1 @check_divided_range(i32 %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@check_divided_range -; IS__TUNIT____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 true +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@check_divided_range +; NOT_CGSCC_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i1 true ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@check_divided_range -; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 true +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@check_divided_range +; NOT_TUNIT_NPM-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i1 true ; %csret1 = call i32 @less_than_65536(i32 0) %csret2 = call i32 @less_than_65536(i32 %arg) @@ -1549,36 +1248,36 @@ define internal i32 @cast_and_return(i1 %c) { ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cast_and_return -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[RET:%.*]] = zext i1 undef to i32 -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cast_and_return +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = zext i1 undef to i32 +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %ret = zext i1 %c to i32 ret i32 %ret } define internal i1 @is_less_than_3(i32 %c) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@is_less_than_3 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@is_less_than_3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i1 undef ; %cmp = icmp slt i32 %c, 3 ret i1 %cmp } define i1 @check_casted_range(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@check_casted_range -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 true +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@check_casted_range +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i1 true ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@check_casted_range -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 true +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@check_casted_range +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i1 true ; %csret1 = call i32 @cast_and_return(i1 true) %csret2 = call i32 @cast_and_return(i1 %c) @@ -1588,34 +1287,34 @@ } define internal i32 @less_than_100_1(i32 %c) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@less_than_100_1 -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ -; IS__CGSCC____-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__CGSCC____-NEXT: i32 1, label [[ONONE:%.*]] -; IS__CGSCC____-NEXT: i32 2, label [[ONTWO:%.*]] -; IS__CGSCC____-NEXT: i32 3, label [[ONTHREE:%.*]] -; IS__CGSCC____-NEXT: i32 4, label [[ONFOUR:%.*]] -; IS__CGSCC____-NEXT: i32 5, label [[ONFIVE:%.*]] -; IS__CGSCC____-NEXT: i32 6, label [[ONSIX:%.*]] -; IS__CGSCC____-NEXT: ] -; IS__CGSCC____: onzero: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: onone: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: ontwo: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: onthree: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: onfour: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: onfive: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: onsix: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: otherwise: -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@less_than_100_1 +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ +; NOT_TUNIT_NPM-NEXT: i32 0, label [[ONZERO:%.*]] +; NOT_TUNIT_NPM-NEXT: i32 1, label [[ONONE:%.*]] +; NOT_TUNIT_NPM-NEXT: i32 2, label [[ONTWO:%.*]] +; NOT_TUNIT_NPM-NEXT: i32 3, label [[ONTHREE:%.*]] +; NOT_TUNIT_NPM-NEXT: i32 4, label [[ONFOUR:%.*]] +; NOT_TUNIT_NPM-NEXT: i32 5, label [[ONFIVE:%.*]] +; NOT_TUNIT_NPM-NEXT: i32 6, label [[ONSIX:%.*]] +; NOT_TUNIT_NPM-NEXT: ] +; NOT_TUNIT_NPM: onzero: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: onone: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: ontwo: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: onthree: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: onfour: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: onfive: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: onsix: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: otherwise: +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; switch i32 %c, label %otherwise [ i32 0, label %onzero i32 1, label %onone @@ -1643,25 +1342,25 @@ } define internal i1 @is_less_than_100_1(i32 %c) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@is_less_than_100_1 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@is_less_than_100_1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i1 undef ; %cmp = icmp slt i32 %c, 100 ret i1 %cmp } define i1 @propagate_range1(i32 %c){ -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@propagate_range1 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 true +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@propagate_range1 +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i1 true ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@propagate_range1 -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 true +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@propagate_range1 +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i1 true ; %csret = call i32 @less_than_100_1(i32 %c) %true = call i1 @is_less_than_100_1(i32 %csret) @@ -1670,34 +1369,34 @@ define internal i32 @less_than_100_2(i32 %c) { ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@less_than_100_2 -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ -; IS__CGSCC____-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__CGSCC____-NEXT: i32 1, label [[ONONE:%.*]] -; IS__CGSCC____-NEXT: i32 2, label [[ONTWO:%.*]] -; IS__CGSCC____-NEXT: i32 3, label [[ONTHREE:%.*]] -; IS__CGSCC____-NEXT: i32 4, label [[ONFOUR:%.*]] -; IS__CGSCC____-NEXT: i32 5, label [[ONFIVE:%.*]] -; IS__CGSCC____-NEXT: i32 6, label [[ONSIX:%.*]] -; IS__CGSCC____-NEXT: ] -; IS__CGSCC____: onzero: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: onone: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: ontwo: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: onthree: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: onfour: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: onfive: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: onsix: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: otherwise: -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@less_than_100_2 +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ +; NOT_TUNIT_NPM-NEXT: i32 0, label [[ONZERO:%.*]] +; NOT_TUNIT_NPM-NEXT: i32 1, label [[ONONE:%.*]] +; NOT_TUNIT_NPM-NEXT: i32 2, label [[ONTWO:%.*]] +; NOT_TUNIT_NPM-NEXT: i32 3, label [[ONTHREE:%.*]] +; NOT_TUNIT_NPM-NEXT: i32 4, label [[ONFOUR:%.*]] +; NOT_TUNIT_NPM-NEXT: i32 5, label [[ONFIVE:%.*]] +; NOT_TUNIT_NPM-NEXT: i32 6, label [[ONSIX:%.*]] +; NOT_TUNIT_NPM-NEXT: ] +; NOT_TUNIT_NPM: onzero: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: onone: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: ontwo: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: onthree: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: onfour: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: onfive: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: onsix: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: otherwise: +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; switch i32 %c, label %otherwise [ i32 0, label %onzero i32 1, label %onone @@ -1726,26 +1425,26 @@ 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: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp slt i32 undef, 100 -; IS__CGSCC____-NEXT: ret i1 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@is_less_than_100_2 +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 undef, 100 +; NOT_TUNIT_NPM-NEXT: ret i1 undef ; %cmp = icmp slt i32 %c, 100 ret i1 %cmp } define i1 @propagate_range2(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@propagate_range2 -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 true +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@propagate_range2 +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i1 true ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@propagate_range2 -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 true +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@propagate_range2 +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i1 true ; %csret1 = call i32 @less_than_100_2(i32 0) %true1 = call i1 @is_less_than_100_2(i32 %csret1) @@ -1756,22 +1455,12 @@ } define internal i1 @non_zero(i8 %v) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@non_zero -; IS__TUNIT_OPM-SAME: (i8 [[V:%.*]]) #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: [[R:%.*]] = icmp ne i8 [[V]], 0 -; IS__TUNIT_OPM-NEXT: ret i1 [[R]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@non_zero -; IS__CGSCC_OPM-SAME: (i8 [[V:%.*]]) #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: [[R:%.*]] = icmp ne i8 [[V]], 0 -; IS__CGSCC_OPM-NEXT: ret i1 [[R]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@non_zero -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret i1 undef +; +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_zero +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i1 undef ; %r = icmp ne i8 %v, 0 ret i1 %r @@ -1779,51 +1468,28 @@ ; Avoid range metadata for %l below define i1 @context(i8* %p) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@context -; IS__TUNIT_OPM-SAME: (i8* nocapture nofree noundef nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT_OPM: t: -; IS__TUNIT_OPM-NEXT: [[R:%.*]] = call i1 @non_zero(i8 [[L]]) #[[ATTR1]] -; IS__TUNIT_OPM-NEXT: ret i1 [[R]] -; IS__TUNIT_OPM: f: -; IS__TUNIT_OPM-NEXT: ret i1 false -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@context -; IS__TUNIT_NPM-SAME: (i8* nocapture nofree noundef nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT_NPM: t: -; IS__TUNIT_NPM-NEXT: ret i1 true -; IS__TUNIT_NPM: f: -; IS__TUNIT_NPM-NEXT: ret i1 false -; -; IS__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]]) #[[ATTR5]] -; IS__CGSCC_OPM-NEXT: ret i1 [[R]] -; IS__CGSCC_OPM: f: -; IS__CGSCC_OPM-NEXT: ret i1 false -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@context -; IS__CGSCC_NPM-SAME: (i8* nocapture nofree noundef nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_NPM: t: -; IS__CGSCC_NPM-NEXT: ret i1 true -; IS__CGSCC_NPM: f: -; IS__CGSCC_NPM-NEXT: ret i1 false +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@context +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree noundef nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: ret i1 true +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: ret i1 false +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@context +; NOT_TUNIT_NPM-SAME: (i8* nocapture nofree noundef nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: ret i1 true +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: ret i1 false ; %l = load i8, i8* %p %c = icmp slt i8 0, %l @@ -1906,44 +1572,19 @@ !0 = !{i32 0, i32 10} !1 = !{i32 10, i32 100} ;. -; IS__TUNIT_OPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } -; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind readonly willreturn } -;. -; IS__TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readonly willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nounwind readnone } -; IS__CGSCC_OPM: attributes #[[ATTR5]] = { readnone willreturn } -;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { readonly willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { readnone willreturn } -;. -; IS__TUNIT_OPM: [[RNG0]] = !{i32 0, i32 10} -; IS__TUNIT_OPM: [[RNG1]] = !{i32 10, i32 100} -; IS__TUNIT_OPM: [[RNG2]] = !{i32 200, i32 1091} -; IS__TUNIT_OPM: [[RNG3]] = !{i32 0, i32 2} -; IS__TUNIT_OPM: [[RNG4]] = !{i32 1, i32 3} +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readonly willreturn } ;. -; IS________NPM: [[RNG0]] = !{i32 0, i32 10} -; IS________NPM: [[RNG1]] = !{i32 10, i32 100} -; IS________NPM: [[META2:![0-9]+]] = !{i32 200, i32 1091} -; IS________NPM: [[META3:![0-9]+]] = !{i32 1, i32 -2147483648} -; IS________NPM: [[RNG4]] = !{i32 0, i32 2} -; IS________NPM: [[META5:![0-9]+]] = !{i32 1, i32 3} +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { readnone willreturn } ;. -; IS__CGSCC_OPM: [[RNG0]] = !{i32 0, i32 10} -; IS__CGSCC_OPM: [[RNG1]] = !{i32 10, i32 100} -; IS__CGSCC_OPM: [[RNG2]] = !{i32 200, i32 1091} -; IS__CGSCC_OPM: [[RNG3]] = !{i32 10, i32 21} -; IS__CGSCC_OPM: [[RNG4]] = !{i32 0, i32 2} -; IS__CGSCC_OPM: [[RNG5]] = !{i32 1, i32 3} +; CHECK: [[META0:![0-9]+]] = !{i32 0, i32 10} +; CHECK: [[META1:![0-9]+]] = !{i32 10, i32 100} +; CHECK: [[META2:![0-9]+]] = !{i32 200, i32 1091} +; CHECK: [[META3:![0-9]+]] = !{i32 1, i32 -2147483648} +; CHECK: [[RNG4]] = !{i32 0, i32 2} +; CHECK: [[META5:![0-9]+]] = !{i32 1, i32 3} ;. diff --git a/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll b/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll --- a/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll +++ b/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=20 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=20 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ; @@ -35,25 +33,25 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" define i32* @external_ret2_nrw(i32* %n0, i32* %r0, i32* %w0) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@external_ret2_nrw -; IS__TUNIT____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree [[W0]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rrw(i32* nofree align 4 [[R0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL3:%.*]] = call i32* @internal_ret1_rw(i32* nofree align 4 [[R0]], i32* nofree [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: ret i32* [[W0]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@external_ret2_nrw +; NOT_CGSCC_NPM-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree [[W0]]) #[[ATTR2:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rrw(i32* nofree align 4 [[R0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL2:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL3:%.*]] = call i32* @internal_ret1_rw(i32* nofree align 4 [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[W0]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@external_ret2_nrw -; IS__CGSCC____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree [[W0]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rrw(i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR3:[0-9]+]] -; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32* @internal_ret1_rw(i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: ret i32* [[W0]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@external_ret2_nrw +; NOT_TUNIT_NPM-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree [[W0]]) #[[ATTR2:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rrw(i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: [[CALL2:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR3:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[CALL3:%.*]] = call i32* @internal_ret1_rw(i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: ret i32* [[W0]] ; entry: %call = call i32* @internal_ret0_nw(i32* %n0, i32* %w0) @@ -64,55 +62,55 @@ } define internal i32* @internal_ret0_nw(i32* %n0, i32* %w0) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@internal_ret0_nw -; IS__TUNIT____-SAME: (i32* nofree returned [[N0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[R0:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: [[R1:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp ne i32* [[N0]], null -; IS__TUNIT____-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: store i32 3, i32* [[R0]], align 4 -; IS__TUNIT____-NEXT: store i32 5, i32* [[R1]], align 4 -; IS__TUNIT____-NEXT: store i32 1, i32* [[W0]], align 4 -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL4:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R1]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[N0]], [[IF_END]] ], [ [[N0]], [[IF_THEN]] ] -; IS__TUNIT____-NEXT: ret i32* [[N0]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@internal_ret0_nw +; NOT_CGSCC_NPM-SAME: (i32* nofree returned [[N0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[R0:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: [[R1:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32* [[N0]], null +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: store i32 3, i32* [[R0]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32 5, i32* [[R1]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[W0]], align 4 +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL2:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL4:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R1]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL5:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[N0]], [[IF_END]] ], [ [[N0]], [[IF_THEN]] ] +; NOT_CGSCC_NPM-NEXT: ret i32* [[N0]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@internal_ret0_nw -; IS__CGSCC____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[R0:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: [[R1:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp ne i32* [[N0]], null -; IS__CGSCC____-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: store i32 3, i32* [[R0]], align 4 -; IS__CGSCC____-NEXT: store i32 5, i32* [[R1]], align 4 -; IS__CGSCC____-NEXT: store i32 1, i32* [[W0]], align 4 -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] -; IS__CGSCC____-NEXT: [[CALL4:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R1]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] -; IS__CGSCC____-NEXT: [[CALL5:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[N0]], [[IF_END]] ], [ [[N0]], [[IF_THEN]] ] -; IS__CGSCC____-NEXT: ret i32* undef +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@internal_ret0_nw +; NOT_TUNIT_NPM-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[R0:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[R1:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32* [[N0]], null +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: store i32 3, i32* [[R0]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32 5, i32* [[R1]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[W0]], align 4 +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: [[CALL2:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: [[CALL4:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R1]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: [[CALL5:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[N0]], [[IF_END]] ], [ [[N0]], [[IF_THEN]] ] +; NOT_TUNIT_NPM-NEXT: ret i32* undef ; entry: %r0 = alloca i32, align 4 @@ -141,61 +139,61 @@ } define internal i32* @internal_ret1_rrw(i32* %r0, i32* %r1, i32* %w0) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@internal_ret1_rrw -; IS__TUNIT____-SAME: (i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree [[R1:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 -; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 -; IS__TUNIT____-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32, i32* [[R0]], align 4 -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = load i32, i32* [[R1]], align 4 -; IS__TUNIT____-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[TMP2]] -; IS__TUNIT____-NEXT: store i32 [[ADD]], i32* [[W0]], align 4 -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL3:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32* @external_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[R1]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[R1]], [[IF_END]] ], [ [[R1]], [[IF_THEN]] ] -; IS__TUNIT____-NEXT: ret i32* undef +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@internal_ret1_rrw +; NOT_CGSCC_NPM-SAME: (i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree [[R1:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[R0]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[R1]], align 4 +; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[TMP2]] +; NOT_CGSCC_NPM-NEXT: store i32 [[ADD]], i32* [[W0]], align 4 +; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL3:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL5:%.*]] = call i32* @external_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL6:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[R1]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL7:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL8:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[R1]], [[IF_END]] ], [ [[R1]], [[IF_THEN]] ] +; NOT_CGSCC_NPM-NEXT: ret i32* undef ; -; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@internal_ret1_rrw -; IS__CGSCC____-SAME: (i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree nonnull align 4 dereferenceable(4) [[R1:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 -; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 -; IS__CGSCC____-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = load i32, i32* [[R0]], align 4 -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = load i32, i32* [[R1]], align 4 -; IS__CGSCC____-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[TMP2]] -; IS__CGSCC____-NEXT: store i32 [[ADD]], i32* [[W0]], align 4 -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL5:%.*]] = call i32* @external_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL6:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[R1]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] -; IS__CGSCC____-NEXT: [[CALL7:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] -; IS__CGSCC____-NEXT: [[CALL8:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[R1]], [[IF_END]] ], [ [[R1]], [[IF_THEN]] ] -; IS__CGSCC____-NEXT: ret i32* undef +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@internal_ret1_rrw +; NOT_TUNIT_NPM-SAME: (i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree nonnull align 4 dereferenceable(4) [[R1:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[R0]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[R1]], align 4 +; NOT_TUNIT_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[TMP2]] +; NOT_TUNIT_NPM-NEXT: store i32 [[ADD]], i32* [[W0]], align 4 +; NOT_TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: [[CALL3:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: [[CALL5:%.*]] = call i32* @external_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: [[CALL6:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[R1]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: [[CALL7:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: [[CALL8:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[R1]], [[IF_END]] ], [ [[R1]], [[IF_THEN]] ] +; NOT_TUNIT_NPM-NEXT: ret i32* undef ; entry: %0 = load i32, i32* %r0, align 4 @@ -227,35 +225,35 @@ } define i32* @external_sink_ret2_nrw(i32* %n0, i32* %r0, i32* %w0) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@external_sink_ret2_nrw -; IS__TUNIT____-SAME: (i32* nofree [[N0:%.*]], i32* nocapture nofree readonly [[R0:%.*]], i32* nofree returned writeonly "no-capture-maybe-returned" [[W0:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp ne i32* [[N0]], null -; IS__TUNIT____-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 -; IS__TUNIT____-NEXT: store i32 [[TMP0]], i32* [[W0]], align 4 -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: ret i32* [[W0]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@external_sink_ret2_nrw +; NOT_CGSCC_NPM-SAME: (i32* nofree [[N0:%.*]], i32* nocapture nofree readonly [[R0:%.*]], i32* nofree returned writeonly "no-capture-maybe-returned" [[W0:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32* [[N0]], null +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP0]], i32* [[W0]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: ret i32* [[W0]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@external_sink_ret2_nrw -; IS__CGSCC____-SAME: (i32* nofree [[N0:%.*]], i32* nocapture nofree readonly [[R0:%.*]], i32* nofree returned writeonly "no-capture-maybe-returned" [[W0:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp ne i32* [[N0]], null -; IS__CGSCC____-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 -; IS__CGSCC____-NEXT: store i32 [[TMP0]], i32* [[W0]], align 4 -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: ret i32* [[W0]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@external_sink_ret2_nrw +; NOT_TUNIT_NPM-SAME: (i32* nofree [[N0:%.*]], i32* nocapture nofree readonly [[R0:%.*]], i32* nofree returned writeonly "no-capture-maybe-returned" [[W0:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32* [[N0]], null +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[W0]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: ret i32* [[W0]] ; entry: %tobool = icmp ne i32* %n0, null @@ -274,49 +272,49 @@ } define internal i32* @internal_ret1_rw(i32* %r0, i32* %w0) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@internal_ret1_rw -; IS__TUNIT____-SAME: (i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 -; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 -; IS__TUNIT____-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32, i32* [[R0]], align 4 -; IS__TUNIT____-NEXT: store i32 [[TMP1]], i32* [[W0]], align 4 -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[W0]], [[IF_END]] ], [ [[W0]], [[IF_THEN]] ] -; IS__TUNIT____-NEXT: ret i32* [[W0]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@internal_ret1_rw +; NOT_CGSCC_NPM-SAME: (i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[R0]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32 [[TMP1]], i32* [[W0]], align 4 +; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[W0]], [[IF_END]] ], [ [[W0]], [[IF_THEN]] ] +; NOT_CGSCC_NPM-NEXT: ret i32* [[W0]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@internal_ret1_rw -; IS__CGSCC____-SAME: (i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 -; IS__CGSCC____-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 -; IS__CGSCC____-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[TMP1:%.*]] = load i32, i32* [[R0]], align 4 -; IS__CGSCC____-NEXT: store i32 [[TMP1]], i32* [[W0]], align 4 -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] -; IS__CGSCC____-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[W0]], [[IF_END]] ], [ [[W0]], [[IF_THEN]] ] -; IS__CGSCC____-NEXT: ret i32* undef +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@internal_ret1_rw +; NOT_TUNIT_NPM-SAME: (i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[R0]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32 [[TMP1]], i32* [[W0]], align 4 +; NOT_TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i32* @internal_ret0_nw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: [[CALL3:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], i32* nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: [[CALL4:%.*]] = call i32* @external_ret2_nrw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[W0]], [[IF_END]] ], [ [[W0]], [[IF_THEN]] ] +; NOT_TUNIT_NPM-NEXT: ret i32* undef ; entry: %0 = load i32, i32* %r0, align 4 @@ -342,21 +340,21 @@ } define i32* @external_source_ret2_nrw(i32* %n0, i32* %r0, i32* %w0) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@external_source_ret2_nrw -; IS__TUNIT____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR3:[0-9]+]] -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: ret i32* [[W0]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@external_source_ret2_nrw +; NOT_CGSCC_NPM-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR3:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[W0]] ; -; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@external_source_ret2_nrw -; IS__CGSCC____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR4:[0-9]+]] -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR3]] -; IS__CGSCC____-NEXT: ret i32* [[W0]] +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@external_source_ret2_nrw +; NOT_TUNIT_NPM-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR4:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR3]] +; NOT_TUNIT_NPM-NEXT: ret i32* [[W0]] ; entry: %call = call i32* @external_sink_ret2_nrw(i32* %n0, i32* %r0, i32* %w0) @@ -367,14 +365,14 @@ ; Verify that we see only expected attribute sets, the above lines only check ; for a subset relation. ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind } -; IS__TUNIT____: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind } -; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind } -; IS__CGSCC____: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { nofree nosync nounwind } -; IS__CGSCC____: attributes #[[ATTR3]] = { nounwind } -; IS__CGSCC____: attributes #[[ATTR4]] = { nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { nounwind willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/readattrs.ll b/llvm/test/Transforms/Attributor/readattrs.ll --- a/llvm/test/Transforms/Attributor/readattrs.ll +++ b/llvm/test/Transforms/Attributor/readattrs.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 @@ -28,34 +26,34 @@ } define i8* @test2(i8* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2 -; IS__TUNIT____-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: store i32 0, i32* @x, align 4 -; IS__TUNIT____-NEXT: ret i8* [[P]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC____-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 0, i32* @x, align 4 -; IS__CGSCC____-NEXT: ret i8* [[P]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_CGSCC_NPM-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* @x, align 4 +; NOT_CGSCC_NPM-NEXT: ret i8* [[P]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test2 +; NOT_TUNIT_NPM-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* @x, align 4 +; NOT_TUNIT_NPM-NEXT: ret i8* [[P]] ; store i32 0, i32* @x ret i8* %p } define i1 @test3(i8* %p, i8* %q) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test3 -; IS__TUNIT____-SAME: (i8* nofree readnone [[P:%.*]], i8* nofree readnone [[Q:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = icmp ult i8* [[P]], [[Q]] -; IS__TUNIT____-NEXT: ret i1 [[A]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test3 -; IS__CGSCC____-SAME: (i8* nofree readnone [[P:%.*]], i8* nofree readnone [[Q:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = icmp ult i8* [[P]], [[Q]] -; IS__CGSCC____-NEXT: ret i1 [[A]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test3 +; NOT_CGSCC_NPM-SAME: (i8* nofree readnone [[P:%.*]], i8* nofree readnone [[Q:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = icmp ult i8* [[P]], [[Q]] +; NOT_CGSCC_NPM-NEXT: ret i1 [[A]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test3 +; NOT_TUNIT_NPM-SAME: (i8* nofree readnone [[P:%.*]], i8* nofree readnone [[Q:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = icmp ult i8* [[P]], [[Q]] +; NOT_TUNIT_NPM-NEXT: ret i1 [[A]] ; %A = icmp ult i8* %p, %q ret i1 %A @@ -76,17 +74,17 @@ ; Missed optz'n: we could make %q readnone, but don't break test6! define void @test5(i8** %p, i8* %q) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test5 -; IS__TUNIT____-SAME: (i8** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[P:%.*]], i8* nofree writeonly [[Q:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: store i8* [[Q]], i8** [[P]], align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test5 -; IS__CGSCC____-SAME: (i8** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[P:%.*]], i8* nofree writeonly [[Q:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: store i8* [[Q]], i8** [[P]], align 8 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test5 +; NOT_CGSCC_NPM-SAME: (i8** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[P:%.*]], i8* nofree writeonly [[Q:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: store i8* [[Q]], i8** [[P]], align 8 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test5 +; NOT_TUNIT_NPM-SAME: (i8** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[P:%.*]], i8* nofree writeonly [[Q:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: store i8* [[Q]], i8** [[P]], align 8 +; NOT_TUNIT_NPM-NEXT: ret void ; store i8* %q, i8** %p ret void @@ -108,50 +106,50 @@ ; inalloca parameters are always considered written define void @test7_1(i32* inalloca(i32) %a) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test7_1 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly inalloca(i32) dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test7_1 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly inalloca(i32) dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test7_1 -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly inalloca(i32) dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test7_1 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull writeonly inalloca(i32) dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret void ; ret void } define i32* @test8_1(i32* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test8_1 -; IS__TUNIT____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32* [[P]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test8_1 -; IS__CGSCC____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32* [[P]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test8_1 +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32* [[P]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test8_1 +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32* [[P]] ; entry: ret i32* %p } define void @test8_2(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test8_2 -; IS__TUNIT____-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: store i32 10, i32* [[P]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test8_2 -; IS__CGSCC____-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: store i32 10, i32* [[P]], align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test8_2 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: store i32 10, i32* [[P]], align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test8_2 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: store i32 10, i32* [[P]], align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %call = call i32* @test8_1(i32* %p) @@ -165,17 +163,17 @@ ; CHECK-NOT: readnone ; CHECK-NOT: readonly define void @test9(<4 x i32*> %ptrs, <4 x i32>%val) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test9 -; IS__TUNIT____-SAME: (<4 x i32*> [[PTRS:%.*]], <4 x i32> [[VAL:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: call void @llvm.masked.scatter.v4i32.v4p0i32(<4 x i32> [[VAL]], <4 x i32*> [[PTRS]], i32 noundef 4, <4 x i1> noundef ) #[[ATTR10:[0-9]+]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test9 -; IS__CGSCC____-SAME: (<4 x i32*> [[PTRS:%.*]], <4 x i32> [[VAL:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC____-NEXT: call void @llvm.masked.scatter.v4i32.v4p0i32(<4 x i32> [[VAL]], <4 x i32*> [[PTRS]], i32 noundef 4, <4 x i1> noundef ) #[[ATTR11:[0-9]+]] -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test9 +; NOT_CGSCC_NPM-SAME: (<4 x i32*> [[PTRS:%.*]], <4 x i32> [[VAL:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: call void @llvm.masked.scatter.v4i32.v4p0i32(<4 x i32> [[VAL]], <4 x i32*> [[PTRS]], i32 noundef 4, <4 x i1> noundef ) #[[ATTR10:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test9 +; NOT_TUNIT_NPM-SAME: (<4 x i32*> [[PTRS:%.*]], <4 x i32> [[VAL:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: call void @llvm.masked.scatter.v4i32.v4p0i32(<4 x i32> [[VAL]], <4 x i32*> [[PTRS]], i32 noundef 4, <4 x i1> noundef ) #[[ATTR11:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @llvm.masked.scatter.v4i32.v4p0i32(<4 x i32>%val, <4 x i32*> %ptrs, i32 4, <4 x i1>) ret void @@ -184,17 +182,17 @@ ; CHECK: declare <4 x i32> @llvm.masked.gather declare <4 x i32> @llvm.masked.gather.v4i32.v4p0i32(<4 x i32*>, i32, <4 x i1>, <4 x i32>) define <4 x i32> @test10(<4 x i32*> %ptrs) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test10 -; IS__TUNIT____-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT____-NEXT: [[RES:%.*]] = call <4 x i32> @llvm.masked.gather.v4i32.v4p0i32(<4 x i32*> [[PTRS]], i32 noundef 4, <4 x i1> noundef , <4 x i32> undef) #[[ATTR11:[0-9]+]] -; IS__TUNIT____-NEXT: ret <4 x i32> [[RES]] -; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test10 -; IS__CGSCC____-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC____-NEXT: [[RES:%.*]] = call <4 x i32> @llvm.masked.gather.v4i32.v4p0i32(<4 x i32*> [[PTRS]], i32 noundef 4, <4 x i1> noundef , <4 x i32> undef) #[[ATTR12:[0-9]+]] -; IS__CGSCC____-NEXT: ret <4 x i32> [[RES]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test10 +; NOT_CGSCC_NPM-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[RES:%.*]] = call <4 x i32> @llvm.masked.gather.v4i32.v4p0i32(<4 x i32*> [[PTRS]], i32 noundef 4, <4 x i1> noundef , <4 x i32> undef) #[[ATTR11:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret <4 x i32> [[RES]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test10 +; NOT_TUNIT_NPM-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR5:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[RES:%.*]] = call <4 x i32> @llvm.masked.gather.v4i32.v4p0i32(<4 x i32*> [[PTRS]], i32 noundef 4, <4 x i1> noundef , <4 x i32> undef) #[[ATTR12:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret <4 x i32> [[RES]] ; %res = call <4 x i32> @llvm.masked.gather.v4i32.v4p0i32(<4 x i32*> %ptrs, i32 4, <4 x i1>, <4 x i32>undef) ret <4 x i32> %res @@ -203,17 +201,17 @@ ; CHECK: declare <4 x i32> @test11_1 declare <4 x i32> @test11_1(<4 x i32*>) argmemonly nounwind readonly define <4 x i32> @test11_2(<4 x i32*> %ptrs) { -; IS__TUNIT____: Function Attrs: argmemonly nounwind readonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test11_2 -; IS__TUNIT____-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__TUNIT____-NEXT: [[RES:%.*]] = call <4 x i32> @test11_1(<4 x i32*> [[PTRS]]) #[[ATTR9:[0-9]+]] -; IS__TUNIT____-NEXT: ret <4 x i32> [[RES]] -; -; IS__CGSCC____: Function Attrs: argmemonly nounwind readonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test11_2 -; IS__CGSCC____-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC____-NEXT: [[RES:%.*]] = call <4 x i32> @test11_1(<4 x i32*> [[PTRS]]) #[[ATTR10:[0-9]+]] -; IS__CGSCC____-NEXT: ret <4 x i32> [[RES]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nounwind readonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test11_2 +; NOT_CGSCC_NPM-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR5:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[RES:%.*]] = call <4 x i32> @test11_1(<4 x i32*> [[PTRS]]) #[[ATTR9:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret <4 x i32> [[RES]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nounwind readonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test11_2 +; NOT_TUNIT_NPM-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR6:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[RES:%.*]] = call <4 x i32> @test11_1(<4 x i32*> [[PTRS]]) #[[ATTR10:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret <4 x i32> [[RES]] ; %res = call <4 x i32> @test11_1(<4 x i32*> %ptrs) ret <4 x i32> %res @@ -222,34 +220,34 @@ declare <4 x i32> @test12_1(<4 x i32*>) argmemonly nounwind ; CHECK-NOT: readnone define <4 x i32> @test12_2(<4 x i32*> %ptrs) { -; IS__TUNIT____: Function Attrs: argmemonly nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@test12_2 -; IS__TUNIT____-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: [[RES:%.*]] = call <4 x i32> @test12_1(<4 x i32*> [[PTRS]]) #[[ATTR12:[0-9]+]] -; IS__TUNIT____-NEXT: ret <4 x i32> [[RES]] -; -; IS__CGSCC____: Function Attrs: argmemonly nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@test12_2 -; IS__CGSCC____-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: [[RES:%.*]] = call <4 x i32> @test12_1(<4 x i32*> [[PTRS]]) #[[ATTR13:[0-9]+]] -; IS__CGSCC____-NEXT: ret <4 x i32> [[RES]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test12_2 +; NOT_CGSCC_NPM-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR6:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[RES:%.*]] = call <4 x i32> @test12_1(<4 x i32*> [[PTRS]]) #[[ATTR12:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret <4 x i32> [[RES]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test12_2 +; NOT_TUNIT_NPM-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[RES:%.*]] = call <4 x i32> @test12_1(<4 x i32*> [[PTRS]]) #[[ATTR13:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret <4 x i32> [[RES]] ; %res = call <4 x i32> @test12_1(<4 x i32*> %ptrs) ret <4 x i32> %res } define i32 @volatile_load(i32* %p) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nounwind willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@volatile_load -; IS__TUNIT____-SAME: (i32* nofree noundef align 4 [[P:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__TUNIT____-NEXT: [[LOAD:%.*]] = load volatile i32, i32* [[P]], align 4 -; IS__TUNIT____-NEXT: ret i32 [[LOAD]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@volatile_load -; IS__CGSCC____-SAME: (i32* nofree noundef align 4 [[P:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC____-NEXT: [[LOAD:%.*]] = load volatile i32, i32* [[P]], align 4 -; IS__CGSCC____-NEXT: ret i32 [[LOAD]] +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@volatile_load +; NOT_CGSCC_NPM-SAME: (i32* nofree noundef align 4 [[P:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[LOAD:%.*]] = load volatile i32, i32* [[P]], align 4 +; NOT_CGSCC_NPM-NEXT: ret i32 [[LOAD]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@volatile_load +; NOT_TUNIT_NPM-SAME: (i32* nofree noundef align 4 [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[LOAD:%.*]] = load volatile i32, i32* [[P]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 [[LOAD]] ; %load = load volatile i32, i32* %p ret i32 %load @@ -312,87 +310,87 @@ } define void @byval_not_readonly_2(i8* byval(i8) %written) readonly { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@byval_not_readonly_2 -; IS__TUNIT____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: store i8 0, i8* [[WRITTEN]], align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@byval_not_readonly_2 -; IS__CGSCC____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: store i8 0, i8* [[WRITTEN]], align 1 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@byval_not_readonly_2 +; NOT_CGSCC_NPM-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: store i8 0, i8* [[WRITTEN]], align 1 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@byval_not_readonly_2 +; NOT_TUNIT_NPM-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: store i8 0, i8* [[WRITTEN]], align 1 +; NOT_TUNIT_NPM-NEXT: ret void ; store i8 0, i8* %written ret void } define void @byval_not_readnone_1(i8* byval(i8) %written) readnone { -; IS__TUNIT____: Function Attrs: readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@byval_not_readnone_1 -; IS__TUNIT____-SAME: (i8* noalias nonnull byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__TUNIT____-NEXT: call void @escape_i8(i8* nonnull dereferenceable(1) [[WRITTEN]]) -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@byval_not_readnone_1 -; IS__CGSCC____-SAME: (i8* noalias nonnull byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC____-NEXT: call void @escape_i8(i8* nonnull dereferenceable(1) [[WRITTEN]]) -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@byval_not_readnone_1 +; NOT_CGSCC_NPM-SAME: (i8* noalias nonnull byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: call void @escape_i8(i8* nonnull dereferenceable(1) [[WRITTEN]]) +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@byval_not_readnone_1 +; NOT_TUNIT_NPM-SAME: (i8* noalias nonnull byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR9:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: call void @escape_i8(i8* nonnull dereferenceable(1) [[WRITTEN]]) +; NOT_TUNIT_NPM-NEXT: ret void ; call void @escape_i8(i8* %written) ret void } define void @byval_not_readnone_2(i8* byval(i8) %written) readnone { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@byval_not_readnone_2 -; IS__TUNIT____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: store i8 0, i8* [[WRITTEN]], align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@byval_not_readnone_2 -; IS__CGSCC____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: store i8 0, i8* [[WRITTEN]], align 1 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@byval_not_readnone_2 +; NOT_CGSCC_NPM-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: store i8 0, i8* [[WRITTEN]], align 1 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@byval_not_readnone_2 +; NOT_TUNIT_NPM-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: store i8 0, i8* [[WRITTEN]], align 1 +; NOT_TUNIT_NPM-NEXT: ret void ; store i8 0, i8* %written ret void } define void @byval_no_fnarg(i8* byval(i8) %written) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@byval_no_fnarg -; IS__TUNIT____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: store i8 0, i8* [[WRITTEN]], align 1 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@byval_no_fnarg -; IS__CGSCC____-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: store i8 0, i8* [[WRITTEN]], align 1 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@byval_no_fnarg +; NOT_CGSCC_NPM-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: store i8 0, i8* [[WRITTEN]], align 1 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@byval_no_fnarg +; NOT_TUNIT_NPM-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: store i8 0, i8* [[WRITTEN]], align 1 +; NOT_TUNIT_NPM-NEXT: ret void ; store i8 0, i8* %written ret void } define void @testbyval(i8* %read_only) { -; IS__TUNIT____-LABEL: define {{[^@]+}}@testbyval -; IS__TUNIT____-SAME: (i8* nocapture readonly [[READ_ONLY:%.*]]) { -; IS__TUNIT____-NEXT: call void @byval_not_readonly_1(i8* nocapture readonly byval(i8) [[READ_ONLY]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: call void @byval_not_readnone_1(i8* noalias nocapture readnone byval(i8) [[READ_ONLY]]) -; IS__TUNIT____-NEXT: call void @byval_no_fnarg(i8* nocapture nofree readonly byval(i8) [[READ_ONLY]]) #[[ATTR13:[0-9]+]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____-LABEL: define {{[^@]+}}@testbyval -; IS__CGSCC____-SAME: (i8* nocapture noundef nonnull readonly dereferenceable(1) [[READ_ONLY:%.*]]) { -; IS__CGSCC____-NEXT: call void @byval_not_readonly_1(i8* noalias nocapture noundef nonnull readonly byval(i8) dereferenceable(1) [[READ_ONLY]]) #[[ATTR2]] -; IS__CGSCC____-NEXT: call void @byval_not_readnone_1(i8* noalias nocapture noundef nonnull readnone byval(i8) dereferenceable(1) [[READ_ONLY]]) -; IS__CGSCC____-NEXT: call void @byval_no_fnarg(i8* noalias nocapture nofree noundef nonnull readnone byval(i8) dereferenceable(1) [[READ_ONLY]]) #[[ATTR14:[0-9]+]] -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@testbyval +; NOT_CGSCC_NPM-SAME: (i8* nocapture readonly [[READ_ONLY:%.*]]) { +; NOT_CGSCC_NPM-NEXT: call void @byval_not_readonly_1(i8* nocapture readonly byval(i8) [[READ_ONLY]]) #[[ATTR2]] +; NOT_CGSCC_NPM-NEXT: call void @byval_not_readnone_1(i8* noalias nocapture readnone byval(i8) [[READ_ONLY]]) +; NOT_CGSCC_NPM-NEXT: call void @byval_no_fnarg(i8* nocapture nofree readonly byval(i8) [[READ_ONLY]]) #[[ATTR13:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@testbyval +; NOT_TUNIT_NPM-SAME: (i8* nocapture noundef nonnull readonly dereferenceable(1) [[READ_ONLY:%.*]]) { +; NOT_TUNIT_NPM-NEXT: call void @byval_not_readonly_1(i8* noalias nocapture noundef nonnull readonly byval(i8) dereferenceable(1) [[READ_ONLY]]) #[[ATTR2]] +; NOT_TUNIT_NPM-NEXT: call void @byval_not_readnone_1(i8* noalias nocapture noundef nonnull readnone byval(i8) dereferenceable(1) [[READ_ONLY]]) +; NOT_TUNIT_NPM-NEXT: call void @byval_no_fnarg(i8* noalias nocapture nofree noundef nonnull readnone byval(i8) dereferenceable(1) [[READ_ONLY]]) #[[ATTR14:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @byval_not_readonly_1(i8* byval(i8) %read_only) call void @byval_not_readonly_2(i8* byval(i8) %read_only) @@ -408,19 +406,19 @@ declare void @val_use(i8 %ptr) readonly nounwind define void @ptr_uses(i8* %ptr) { -; IS__TUNIT____: Function Attrs: nounwind readonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@ptr_uses -; IS__TUNIT____-SAME: (i8* nocapture readonly [[PTR:%.*]]) #[[ATTR9]] { -; IS__TUNIT____-NEXT: [[CALL_PTR:%.*]] = call i8* @maybe_returned_ptr(i8* readonly [[PTR]]) #[[ATTR9]] -; IS__TUNIT____-NEXT: [[CALL_VAL:%.*]] = call i8 @maybe_returned_val(i8* readonly [[CALL_PTR]]) #[[ATTR9]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nounwind readonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@ptr_uses -; IS__CGSCC____-SAME: (i8* nocapture readonly [[PTR:%.*]]) #[[ATTR10]] { -; IS__CGSCC____-NEXT: [[CALL_PTR:%.*]] = call i8* @maybe_returned_ptr(i8* readonly [[PTR]]) #[[ATTR10]] -; IS__CGSCC____-NEXT: [[CALL_VAL:%.*]] = call i8 @maybe_returned_val(i8* readonly [[CALL_PTR]]) #[[ATTR10]] -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nounwind readonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ptr_uses +; NOT_CGSCC_NPM-SAME: (i8* nocapture readonly [[PTR:%.*]]) #[[ATTR9]] { +; NOT_CGSCC_NPM-NEXT: [[CALL_PTR:%.*]] = call i8* @maybe_returned_ptr(i8* readonly [[PTR]]) #[[ATTR9]] +; NOT_CGSCC_NPM-NEXT: [[CALL_VAL:%.*]] = call i8 @maybe_returned_val(i8* readonly [[CALL_PTR]]) #[[ATTR9]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nounwind readonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ptr_uses +; NOT_TUNIT_NPM-SAME: (i8* nocapture readonly [[PTR:%.*]]) #[[ATTR10]] { +; NOT_TUNIT_NPM-NEXT: [[CALL_PTR:%.*]] = call i8* @maybe_returned_ptr(i8* readonly [[PTR]]) #[[ATTR10]] +; NOT_TUNIT_NPM-NEXT: [[CALL_VAL:%.*]] = call i8 @maybe_returned_val(i8* readonly [[CALL_PTR]]) #[[ATTR10]] +; NOT_TUNIT_NPM-NEXT: ret void ; %call_ptr = call i8* @maybe_returned_ptr(i8* %ptr) %call_val = call i8 @maybe_returned_val(i8* %call_ptr) @@ -458,50 +456,50 @@ @constant_mem = external dso_local constant i32, align 4 define i32 @read_only_constant_mem() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@read_only_constant_mem -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[L:%.*]] = load i32, i32* @constant_mem, align 4 -; IS__TUNIT____-NEXT: ret i32 [[L]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@read_only_constant_mem -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @constant_mem, align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@read_only_constant_mem +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* @constant_mem, align 4 +; NOT_CGSCC_NPM-NEXT: ret i32 [[L]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@read_only_constant_mem +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @constant_mem, align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 [[L]] ; %l = load i32, i32* @constant_mem ret i32 %l } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { readonly } -; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR5]] = { argmemonly nounwind readonly } -; IS__TUNIT____: attributes #[[ATTR6]] = { argmemonly nounwind } -; IS__TUNIT____: attributes #[[ATTR7]] = { argmemonly nofree nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR8]] = { readnone } -; IS__TUNIT____: attributes #[[ATTR9]] = { nounwind readonly } -; IS__TUNIT____: attributes #[[ATTR10]] = { willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR11]] = { readonly willreturn } -; IS__TUNIT____: attributes #[[ATTR12]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR13]] = { nounwind writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { readonly } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nounwind readonly } +; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { argmemonly nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { argmemonly nofree nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { nounwind readonly } +; NOT_CGSCC_NPM: attributes #[[ATTR10]] = { willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR11]] = { readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR12]] = { nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR13]] = { nounwind writeonly } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { readonly } -; IS__CGSCC____: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR5]] = { nofree nosync nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR6]] = { argmemonly nounwind readonly } -; IS__CGSCC____: attributes #[[ATTR7]] = { argmemonly nounwind } -; IS__CGSCC____: attributes #[[ATTR8]] = { argmemonly nofree norecurse nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR9]] = { readnone } -; IS__CGSCC____: attributes #[[ATTR10]] = { nounwind readonly } -; IS__CGSCC____: attributes #[[ATTR11]] = { willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR12]] = { readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR13]] = { nounwind } -; IS__CGSCC____: attributes #[[ATTR14]] = { nounwind writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { readonly } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR5]] = { nofree nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR6]] = { argmemonly nounwind readonly } +; NOT_TUNIT_NPM: attributes #[[ATTR7]] = { argmemonly nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR8]] = { argmemonly nofree norecurse nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR9]] = { readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR10]] = { nounwind readonly } +; NOT_TUNIT_NPM: attributes #[[ATTR11]] = { willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR12]] = { readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR13]] = { nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR14]] = { nounwind writeonly } ;. diff --git a/llvm/test/Transforms/Attributor/reduced/register_benchmark_test.ll b/llvm/test/Transforms/Attributor/reduced/register_benchmark_test.ll --- a/llvm/test/Transforms/Attributor/reduced/register_benchmark_test.ll +++ b/llvm/test/Transforms/Attributor/reduced/register_benchmark_test.ll @@ -1,6 +1,4 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s ; RUN: opt -passes=attributor -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s ; RUN: opt -passes='attributor-cgscc' -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s diff --git a/llvm/test/Transforms/Attributor/returned.ll b/llvm/test/Transforms/Attributor/returned.ll --- a/llvm/test/Transforms/Attributor/returned.ll +++ b/llvm/test/Transforms/Attributor/returned.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=9 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ; ; Test cases specifically designed for the "returned" argument attribute. @@ -43,36 +41,36 @@ ; CHECK: @[[_ZTI1Y:[a-zA-Z0-9_$"\\.-]+]] = external dso_local constant { i8*, i8*, i8* }, align 8 ;. define i32 @sink_r0(i32 %r) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@sink_r0 -; IS__TUNIT____-SAME: (i32 returned [[R:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 [[R]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@sink_r0 -; IS__CGSCC____-SAME: (i32 returned [[R:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 [[R]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@sink_r0 +; NOT_CGSCC_NPM-SAME: (i32 returned [[R:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32 [[R]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@sink_r0 +; NOT_TUNIT_NPM-SAME: (i32 returned [[R:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 [[R]] ; entry: ret i32 %r } define i32 @scc_r1(i32 %a, i32 %r, i32 %b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@scc_r1 -; IS__TUNIT____-SAME: (i32 [[A:%.*]], i32 returned [[R:%.*]], i32 [[B:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR6:[0-9]+]] -; IS__TUNIT____-NEXT: ret i32 [[R]] -; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@scc_r1 -; IS__CGSCC____-SAME: (i32 [[A:%.*]], i32 returned [[R:%.*]], i32 [[B:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR7:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32 [[R]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@scc_r1 +; NOT_CGSCC_NPM-SAME: (i32 [[A:%.*]], i32 returned [[R:%.*]], i32 [[B:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR6:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[R]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@scc_r1 +; NOT_TUNIT_NPM-SAME: (i32 [[A:%.*]], i32 returned [[R:%.*]], i32 [[B:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR7:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[R]] ; entry: %call = call i32 @sink_r0(i32 %r) @@ -81,75 +79,75 @@ } define i32 @scc_r2(i32 %a, i32 %b, i32 %r) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@scc_r2 -; IS__TUNIT____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 returned [[R:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] -; IS__TUNIT____-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] -; IS__TUNIT____: if.then3: -; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: if.end12: -; IS__TUNIT____-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] -; IS__TUNIT____-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; IS__TUNIT____: cond.true: -; IS__TUNIT____-NEXT: br label [[COND_END:%.*]] -; IS__TUNIT____: cond.false: -; IS__TUNIT____-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: br label [[COND_END]] -; IS__TUNIT____: cond.end: -; IS__TUNIT____-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] -; IS__TUNIT____-NEXT: ret i32 [[R]] -; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@scc_r2 -; IS__CGSCC____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 returned [[R:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] -; IS__CGSCC____: if.then3: -; IS__CGSCC____-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: if.end12: -; IS__CGSCC____-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; IS__CGSCC____: cond.true: -; IS__CGSCC____-NEXT: br label [[COND_END:%.*]] -; IS__CGSCC____: cond.false: -; IS__CGSCC____-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[COND_END]] -; IS__CGSCC____: cond.end: -; IS__CGSCC____-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] -; IS__CGSCC____-NEXT: ret i32 [[R]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@scc_r2 +; NOT_CGSCC_NPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 returned [[R:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] +; NOT_CGSCC_NPM: if.then3: +; NOT_CGSCC_NPM-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: if.end12: +; NOT_CGSCC_NPM-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; NOT_CGSCC_NPM: cond.true: +; NOT_CGSCC_NPM-NEXT: br label [[COND_END:%.*]] +; NOT_CGSCC_NPM: cond.false: +; NOT_CGSCC_NPM-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[COND_END]] +; NOT_CGSCC_NPM: cond.end: +; NOT_CGSCC_NPM-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] +; NOT_CGSCC_NPM-NEXT: ret i32 [[R]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@scc_r2 +; NOT_TUNIT_NPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 returned [[R:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] +; NOT_TUNIT_NPM: if.then3: +; NOT_TUNIT_NPM-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: if.end12: +; NOT_TUNIT_NPM-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; NOT_TUNIT_NPM: cond.true: +; NOT_TUNIT_NPM-NEXT: br label [[COND_END:%.*]] +; NOT_TUNIT_NPM: cond.false: +; NOT_TUNIT_NPM-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: br label [[COND_END]] +; NOT_TUNIT_NPM: cond.end: +; NOT_TUNIT_NPM-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] +; NOT_TUNIT_NPM-NEXT: ret i32 [[R]] ; entry: %cmp = icmp sgt i32 %a, %b @@ -196,67 +194,67 @@ } define i32 @scc_rX(i32 %a, i32 %b, i32 %r) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@scc_rX -; IS__TUNIT____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[R:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] -; IS__TUNIT____-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] -; IS__TUNIT____: if.then3: -; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[B]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[B]], i32 undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: if.end12: -; IS__TUNIT____-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] -; IS__TUNIT____-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; IS__TUNIT____: cond.true: -; IS__TUNIT____-NEXT: br label [[COND_END:%.*]] -; IS__TUNIT____: cond.false: -; IS__TUNIT____-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: br label [[COND_END]] -; IS__TUNIT____: cond.end: -; IS__TUNIT____-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[B]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] -; IS__TUNIT____-NEXT: ret i32 [[RETVAL_0]] -; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@scc_rX -; IS__CGSCC____-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[R:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] -; IS__CGSCC____: if.then3: -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: if.end12: -; IS__CGSCC____-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] -; IS__CGSCC____-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; IS__CGSCC____: cond.true: -; IS__CGSCC____-NEXT: br label [[COND_END:%.*]] -; IS__CGSCC____: cond.false: -; IS__CGSCC____-NEXT: br label [[COND_END]] -; IS__CGSCC____: cond.end: -; IS__CGSCC____-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[B]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] -; IS__CGSCC____-NEXT: ret i32 [[RETVAL_0]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@scc_rX +; NOT_CGSCC_NPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[R:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] +; NOT_CGSCC_NPM: if.then3: +; NOT_CGSCC_NPM-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[CALL8:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[B]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[B]], i32 undef) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: if.end12: +; NOT_CGSCC_NPM-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; NOT_CGSCC_NPM: cond.true: +; NOT_CGSCC_NPM-NEXT: br label [[COND_END:%.*]] +; NOT_CGSCC_NPM: cond.false: +; NOT_CGSCC_NPM-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[COND_END]] +; NOT_CGSCC_NPM: cond.end: +; NOT_CGSCC_NPM-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[B]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] +; NOT_CGSCC_NPM-NEXT: ret i32 [[RETVAL_0]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@scc_rX +; NOT_TUNIT_NPM-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[R:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] +; NOT_TUNIT_NPM: if.then3: +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: if.end12: +; NOT_TUNIT_NPM-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; NOT_TUNIT_NPM: cond.true: +; NOT_TUNIT_NPM-NEXT: br label [[COND_END:%.*]] +; NOT_TUNIT_NPM: cond.false: +; NOT_TUNIT_NPM-NEXT: br label [[COND_END]] +; NOT_TUNIT_NPM: cond.end: +; NOT_TUNIT_NPM-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[B]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] +; NOT_TUNIT_NPM-NEXT: ret i32 [[RETVAL_0]] ; entry: %cmp = icmp sgt i32 %a, %b @@ -324,36 +322,36 @@ ; return a == b ? r : ptr_scc_r2(a, b, r); ; } define double* @ptr_sink_r0(double* %r) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ptr_sink_r0 -; IS__TUNIT____-SAME: (double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret double* [[R]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ptr_sink_r0 -; IS__CGSCC____-SAME: (double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret double* [[R]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ptr_sink_r0 +; NOT_CGSCC_NPM-SAME: (double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret double* [[R]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ptr_sink_r0 +; NOT_TUNIT_NPM-SAME: (double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret double* [[R]] ; entry: ret double* %r } define double* @ptr_scc_r1(double* %a, double* %r, double* %b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@ptr_scc_r1 -; IS__TUNIT____-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]], double* nocapture nofree readnone [[B:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: ret double* [[R]] -; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@ptr_scc_r1 -; IS__CGSCC____-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]], double* nocapture nofree readnone [[B:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: ret double* [[R]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ptr_scc_r1 +; NOT_CGSCC_NPM-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]], double* nocapture nofree readnone [[B:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: ret double* [[R]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ptr_scc_r1 +; NOT_TUNIT_NPM-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]], double* nocapture nofree readnone [[B:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: ret double* [[R]] ; entry: %call = call double* @ptr_sink_r0(double* %r) @@ -362,75 +360,75 @@ } define double* @ptr_scc_r2(double* %a, double* %b, double* %r) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@ptr_scc_r2 -; IS__TUNIT____-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nocapture nofree readnone [[B:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp ugt double* [[A]], [[B]] -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: br label [[RETURN:%.*]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: [[CMP2:%.*]] = icmp ult double* [[A]], [[B]] -; IS__TUNIT____-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] -; IS__TUNIT____: if.then3: -; IS__TUNIT____-NEXT: [[CALL5:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[B]], double* noalias nocapture nofree readnone undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR6]] -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: if.end12: -; IS__TUNIT____-NEXT: [[CMP13:%.*]] = icmp eq double* [[A]], [[B]] -; IS__TUNIT____-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; IS__TUNIT____: cond.true: -; IS__TUNIT____-NEXT: br label [[COND_END:%.*]] -; IS__TUNIT____: cond.false: -; IS__TUNIT____-NEXT: [[CALL14:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: br label [[COND_END]] -; IS__TUNIT____: cond.end: -; IS__TUNIT____-NEXT: [[COND:%.*]] = phi double* [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] -; IS__TUNIT____-NEXT: br label [[RETURN]] -; IS__TUNIT____: return: -; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi double* [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] -; IS__TUNIT____-NEXT: ret double* [[R]] -; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@ptr_scc_r2 -; IS__CGSCC____-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nocapture nofree readnone [[B:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp ugt double* [[A]], [[B]] -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[RETURN:%.*]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[CMP2:%.*]] = icmp ult double* [[A]], [[B]] -; IS__CGSCC____-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] -; IS__CGSCC____: if.then3: -; IS__CGSCC____-NEXT: [[CALL5:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[B]], double* noalias nocapture nofree readnone undef) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: if.end12: -; IS__CGSCC____-NEXT: [[CMP13:%.*]] = icmp eq double* [[A]], [[B]] -; IS__CGSCC____-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; IS__CGSCC____: cond.true: -; IS__CGSCC____-NEXT: br label [[COND_END:%.*]] -; IS__CGSCC____: cond.false: -; IS__CGSCC____-NEXT: [[CALL14:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[COND_END]] -; IS__CGSCC____: cond.end: -; IS__CGSCC____-NEXT: [[COND:%.*]] = phi double* [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] -; IS__CGSCC____-NEXT: br label [[RETURN]] -; IS__CGSCC____: return: -; IS__CGSCC____-NEXT: [[RETVAL_0:%.*]] = phi double* [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] -; IS__CGSCC____-NEXT: ret double* [[R]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ptr_scc_r2 +; NOT_CGSCC_NPM-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nocapture nofree readnone [[B:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp ugt double* [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp ult double* [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] +; NOT_CGSCC_NPM: if.then3: +; NOT_CGSCC_NPM-NEXT: [[CALL5:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[B]], double* noalias nocapture nofree readnone undef) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: if.end12: +; NOT_CGSCC_NPM-NEXT: [[CMP13:%.*]] = icmp eq double* [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; NOT_CGSCC_NPM: cond.true: +; NOT_CGSCC_NPM-NEXT: br label [[COND_END:%.*]] +; NOT_CGSCC_NPM: cond.false: +; NOT_CGSCC_NPM-NEXT: [[CALL14:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[COND_END]] +; NOT_CGSCC_NPM: cond.end: +; NOT_CGSCC_NPM-NEXT: [[COND:%.*]] = phi double* [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] +; NOT_CGSCC_NPM-NEXT: br label [[RETURN]] +; NOT_CGSCC_NPM: return: +; NOT_CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi double* [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] +; NOT_CGSCC_NPM-NEXT: ret double* [[R]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ptr_scc_r2 +; NOT_TUNIT_NPM-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nocapture nofree readnone [[B:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp ugt double* [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: br label [[RETURN:%.*]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: [[CMP2:%.*]] = icmp ult double* [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] +; NOT_TUNIT_NPM: if.then3: +; NOT_TUNIT_NPM-NEXT: [[CALL5:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[B]], double* noalias nocapture nofree readnone undef) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: if.end12: +; NOT_TUNIT_NPM-NEXT: [[CMP13:%.*]] = icmp eq double* [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; NOT_TUNIT_NPM: cond.true: +; NOT_TUNIT_NPM-NEXT: br label [[COND_END:%.*]] +; NOT_TUNIT_NPM: cond.false: +; NOT_TUNIT_NPM-NEXT: [[CALL14:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: br label [[COND_END]] +; NOT_TUNIT_NPM: cond.end: +; NOT_TUNIT_NPM-NEXT: [[COND:%.*]] = phi double* [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] +; NOT_TUNIT_NPM-NEXT: br label [[RETURN]] +; NOT_TUNIT_NPM: return: +; NOT_TUNIT_NPM-NEXT: [[RETVAL_0:%.*]] = phi double* [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] +; NOT_TUNIT_NPM-NEXT: ret double* [[R]] ; entry: %cmp = icmp ugt double* %a, %b @@ -484,17 +482,17 @@ ; } ; define i32* @rt0(i32* %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@rt0 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@rt0 -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@rt0 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@rt0 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: %v = load i32, i32* %a, align 4 @@ -511,17 +509,17 @@ ; } ; define i32* @rt1(i32* %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@rt1 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@rt1 -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@rt1 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@rt1 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: %v = load i32, i32* %a, align 4 @@ -534,19 +532,19 @@ ; TEST another SCC test ; define i32* @rt2_helper(i32* %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@rt2_helper -; IS__TUNIT____-SAME: (i32* nofree readnone returned [[A:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt2(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: ret i32* [[A]] -; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@rt2_helper -; IS__CGSCC____-SAME: (i32* nofree readnone returned [[A:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @rt2(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: ret i32* [[A]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@rt2_helper +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone returned [[A:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @rt2(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[A]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@rt2_helper +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone returned [[A:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @rt2(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: ret i32* [[A]] ; entry: %call = call i32* @rt2(i32* %a, i32* %a) @@ -554,31 +552,31 @@ } define i32* @rt2(i32* %a, i32 *%b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@rt2 -; IS__TUNIT____-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt2_helper(i32* noalias nofree readnone [[A]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: br label [[IF_END]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ] -; IS__TUNIT____-NEXT: ret i32* [[SEL]] -; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@rt2 -; IS__CGSCC____-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @rt2_helper(i32* noalias nofree readnone [[A]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[IF_END]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ] -; IS__CGSCC____-NEXT: ret i32* [[SEL]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@rt2 +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @rt2_helper(i32* noalias nofree readnone [[A]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[IF_END]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ] +; NOT_CGSCC_NPM-NEXT: ret i32* [[SEL]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@rt2 +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @rt2_helper(i32* noalias nofree readnone [[A]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: br label [[IF_END]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ] +; NOT_TUNIT_NPM-NEXT: ret i32* [[SEL]] ; entry: %cmp = icmp eq i32* %a, null @@ -596,19 +594,19 @@ ; TEST another SCC test ; define i32* @rt3_helper(i32* %a, i32* %b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@rt3_helper -; IS__TUNIT____-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: ret i32* [[B]] -; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@rt3_helper -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: ret i32* [[B]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@rt3_helper +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[B]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@rt3_helper +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: ret i32* [[B]] ; entry: %call = call i32* @rt3(i32* %a, i32* %b) @@ -616,31 +614,31 @@ } define i32* @rt3(i32* %a, i32 *%b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@rt3 -; 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: [[CMP:%.*]] = icmp eq i32* [[A]], null -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @rt3_helper(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: br label [[IF_END]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ] -; IS__TUNIT____-NEXT: ret i32* [[B]] -; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@rt3 -; IS__CGSCC____-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @rt3_helper(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[IF_END]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ] -; IS__CGSCC____-NEXT: ret i32* [[B]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@rt3 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @rt3_helper(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[IF_END]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ] +; NOT_CGSCC_NPM-NEXT: ret i32* [[B]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@rt3 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @rt3_helper(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: br label [[IF_END]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ] +; NOT_TUNIT_NPM-NEXT: ret i32* [[B]] ; entry: %cmp = icmp eq i32* %a, null @@ -667,17 +665,17 @@ declare void @unknown_fn(i32* (i32*)*) #0 define i32* @calls_unknown_fn(i32* %r) #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@calls_unknown_fn -; IS__TUNIT____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: tail call void @unknown_fn(i32* (i32*)* noundef nonnull @calls_unknown_fn) #[[ATTR7:[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) #[[ATTR8:[0-9]+]] -; IS__CGSCC____-NEXT: ret i32* [[R]] +; NOT_CGSCC_NPM: Function Attrs: noinline nounwind uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@calls_unknown_fn +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: tail call void @unknown_fn(i32* (i32*)* noundef nonnull @calls_unknown_fn) #[[ATTR7:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[R]] +; +; NOT_TUNIT_NPM: Function Attrs: noinline nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@calls_unknown_fn +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: tail call void @unknown_fn(i32* (i32*)* noundef nonnull @calls_unknown_fn) #[[ATTR8:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32* [[R]] ; tail call void @unknown_fn(i32* (i32*)* nonnull @calls_unknown_fn) ret i32* %r @@ -698,36 +696,36 @@ ; Verify the maybe-redefined function is not annotated: ; define linkonce_odr i32* @maybe_redefined_fn(i32* %r) #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@maybe_redefined_fn -; IS__TUNIT____-SAME: (i32* [[R:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32* [[R]] -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@maybe_redefined_fn -; IS__CGSCC____-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32* [[R]] +; NOT_CGSCC_NPM: Function Attrs: noinline nounwind uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@maybe_redefined_fn +; NOT_CGSCC_NPM-SAME: (i32* [[R:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32* [[R]] +; +; NOT_TUNIT_NPM: Function Attrs: noinline nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@maybe_redefined_fn +; NOT_TUNIT_NPM-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32* [[R]] ; entry: ret i32* %r } define i32* @calls_maybe_redefined_fn(i32* %r) #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn -; IS__TUNIT____-SAME: (i32* returned [[R:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) #[[ATTR7]] -; IS__TUNIT____-NEXT: ret i32* [[R]] -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn -; IS__CGSCC____-SAME: (i32* returned [[R:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) #[[ATTR8]] -; IS__CGSCC____-NEXT: ret i32* [[R]] +; NOT_CGSCC_NPM: Function Attrs: noinline nounwind uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn +; NOT_CGSCC_NPM-SAME: (i32* returned [[R:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[R]] +; +; NOT_TUNIT_NPM: Function Attrs: noinline nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn +; NOT_TUNIT_NPM-SAME: (i32* returned [[R:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) #[[ATTR8]] +; NOT_TUNIT_NPM-NEXT: ret i32* [[R]] ; entry: %call = call i32* @maybe_redefined_fn(i32* %r) @@ -747,36 +745,36 @@ ; Verify the maybe-redefined function is not annotated: ; define linkonce_odr i32* @maybe_redefined_fn2(i32* %r) #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@maybe_redefined_fn2 -; IS__TUNIT____-SAME: (i32* [[R:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32* [[R]] -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@maybe_redefined_fn2 -; IS__CGSCC____-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32* [[R]] +; NOT_CGSCC_NPM: Function Attrs: noinline nounwind uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@maybe_redefined_fn2 +; NOT_CGSCC_NPM-SAME: (i32* [[R:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32* [[R]] +; +; NOT_TUNIT_NPM: Function Attrs: noinline nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@maybe_redefined_fn2 +; NOT_TUNIT_NPM-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32* [[R]] ; entry: ret i32* %r } define i32* @calls_maybe_redefined_fn2(i32* %r) #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2 -; IS__TUNIT____-SAME: (i32* [[R:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) #[[ATTR7]] -; IS__TUNIT____-NEXT: ret i32* [[CALL]] -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2 -; IS__CGSCC____-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) #[[ATTR8]] -; IS__CGSCC____-NEXT: ret i32* [[CALL]] +; NOT_CGSCC_NPM: Function Attrs: noinline nounwind uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2 +; NOT_CGSCC_NPM-SAME: (i32* [[R:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[CALL]] +; +; NOT_TUNIT_NPM: Function Attrs: noinline nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2 +; NOT_TUNIT_NPM-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) #[[ATTR8]] +; NOT_TUNIT_NPM-NEXT: ret i32* [[CALL]] ; entry: %call = call i32* @maybe_redefined_fn2(i32* %r) @@ -794,27 +792,27 @@ ; } ; define double @select_and_phi(double %b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@select_and_phi -; IS__TUNIT____-SAME: (double returned [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CMP:%.*]] = fcmp ogt double [[B]], 0.000000e+00 -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: br label [[IF_END]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: ret double [[B]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@select_and_phi -; IS__CGSCC____-SAME: (double returned [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = fcmp ogt double [[B]], 0.000000e+00 -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: br label [[IF_END]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: ret double [[B]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@select_and_phi +; NOT_CGSCC_NPM-SAME: (double returned [[B:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = fcmp ogt double [[B]], 0.000000e+00 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: br label [[IF_END]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: ret double [[B]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@select_and_phi +; NOT_TUNIT_NPM-SAME: (double returned [[B:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = fcmp ogt double [[B]], 0.000000e+00 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: br label [[IF_END]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: ret double [[B]] ; entry: %cmp = fcmp ogt double %b, 0.000000e+00 @@ -841,31 +839,31 @@ ; } ; define double @recursion_select_and_phi(i32 %a, double %b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@recursion_select_and_phi -; IS__TUNIT____-SAME: (i32 [[A:%.*]], double returned [[B:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[DEC:%.*]] = add nsw i32 [[A]], -1 -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 0 -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) #[[ATTR6]] -; IS__TUNIT____-NEXT: br label [[IF_END]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: ret double [[B]] -; -; IS__CGSCC____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@recursion_select_and_phi -; IS__CGSCC____-SAME: (i32 [[A:%.*]], double returned [[B:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[DEC:%.*]] = add nsw i32 [[A]], -1 -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 0 -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: br label [[IF_END]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: ret double [[B]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@recursion_select_and_phi +; NOT_CGSCC_NPM-SAME: (i32 [[A:%.*]], double returned [[B:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[DEC:%.*]] = add nsw i32 [[A]], -1 +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) #[[ATTR6]] +; NOT_CGSCC_NPM-NEXT: br label [[IF_END]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: ret double [[B]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@recursion_select_and_phi +; NOT_TUNIT_NPM-SAME: (i32 [[A:%.*]], double returned [[B:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[DEC:%.*]] = add nsw i32 [[A]], -1 +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: br label [[IF_END]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: ret double [[B]] ; entry: %dec = add nsw i32 %a, -1 @@ -891,19 +889,19 @@ ; } ; define double* @bitcast(i32* %b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bitcast -; IS__TUNIT____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__TUNIT____-NEXT: ret double* [[BC0]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bitcast -; IS__CGSCC____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__CGSCC____-NEXT: ret double* [[BC0]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bitcast +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; NOT_CGSCC_NPM-NEXT: ret double* [[BC0]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bitcast +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; NOT_TUNIT_NPM-NEXT: ret double* [[BC0]] ; entry: %bc0 = bitcast i32* %b to double* @@ -921,43 +919,43 @@ ; } ; define double* @bitcasts_select_and_phi(i32* %b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@bitcasts_select_and_phi -; IS__TUNIT____-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: if.then: -; IS__TUNIT____-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* -; IS__TUNIT____-NEXT: br label [[IF_END]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: [[PHI:%.*]] = phi double* [ [[BC1]], [[IF_THEN]] ], [ [[BC0]], [[ENTRY:%.*]] ] -; IS__TUNIT____-NEXT: [[BC2:%.*]] = bitcast double* [[PHI]] to i8* -; IS__TUNIT____-NEXT: [[BC3:%.*]] = bitcast i32* [[B]] to i8* -; IS__TUNIT____-NEXT: [[CMP2:%.*]] = icmp ne double* [[BC0]], null -; IS__TUNIT____-NEXT: [[SEL:%.*]] = select i1 [[CMP2]], i8* [[BC2]], i8* [[BC3]] -; IS__TUNIT____-NEXT: [[BC4:%.*]] = bitcast i8* [[SEL]] to double* -; IS__TUNIT____-NEXT: ret double* [[BC4]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@bitcasts_select_and_phi -; IS__CGSCC____-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: if.then: -; IS__CGSCC____-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* -; IS__CGSCC____-NEXT: br label [[IF_END]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: [[PHI:%.*]] = phi double* [ [[BC1]], [[IF_THEN]] ], [ [[BC0]], [[ENTRY:%.*]] ] -; IS__CGSCC____-NEXT: [[BC2:%.*]] = bitcast double* [[PHI]] to i8* -; IS__CGSCC____-NEXT: [[BC3:%.*]] = bitcast i32* [[B]] to i8* -; IS__CGSCC____-NEXT: [[CMP2:%.*]] = icmp ne double* [[BC0]], null -; IS__CGSCC____-NEXT: [[SEL:%.*]] = select i1 [[CMP2]], i8* [[BC2]], i8* [[BC3]] -; IS__CGSCC____-NEXT: [[BC4:%.*]] = bitcast i8* [[SEL]] to double* -; IS__CGSCC____-NEXT: ret double* [[BC4]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bitcasts_select_and_phi +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* +; NOT_CGSCC_NPM-NEXT: br label [[IF_END]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: [[PHI:%.*]] = phi double* [ [[BC1]], [[IF_THEN]] ], [ [[BC0]], [[ENTRY:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[BC2:%.*]] = bitcast double* [[PHI]] to i8* +; NOT_CGSCC_NPM-NEXT: [[BC3:%.*]] = bitcast i32* [[B]] to i8* +; NOT_CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp ne double* [[BC0]], null +; NOT_CGSCC_NPM-NEXT: [[SEL:%.*]] = select i1 [[CMP2]], i8* [[BC2]], i8* [[BC3]] +; NOT_CGSCC_NPM-NEXT: [[BC4:%.*]] = bitcast i8* [[SEL]] to double* +; NOT_CGSCC_NPM-NEXT: ret double* [[BC4]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bitcasts_select_and_phi +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* +; NOT_TUNIT_NPM-NEXT: br label [[IF_END]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: [[PHI:%.*]] = phi double* [ [[BC1]], [[IF_THEN]] ], [ [[BC0]], [[ENTRY:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[BC2:%.*]] = bitcast double* [[PHI]] to i8* +; NOT_TUNIT_NPM-NEXT: [[BC3:%.*]] = bitcast i32* [[B]] to i8* +; NOT_TUNIT_NPM-NEXT: [[CMP2:%.*]] = icmp ne double* [[BC0]], null +; NOT_TUNIT_NPM-NEXT: [[SEL:%.*]] = select i1 [[CMP2]], i8* [[BC2]], i8* [[BC3]] +; NOT_TUNIT_NPM-NEXT: [[BC4:%.*]] = bitcast i8* [[SEL]] to double* +; NOT_TUNIT_NPM-NEXT: ret double* [[BC4]] ; entry: %bc0 = bitcast i32* %b to double* @@ -990,39 +988,39 @@ ; } ; define double* @ret_arg_arg_undef(i32* %b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_arg_arg_undef -; IS__TUNIT____-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: ret_arg0: -; IS__TUNIT____-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* -; IS__TUNIT____-NEXT: ret double* [[BC1]] -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_ARG1:%.*]], label [[RET_UNDEF:%.*]] -; IS__TUNIT____: ret_arg1: -; IS__TUNIT____-NEXT: ret double* [[BC0]] -; IS__TUNIT____: ret_undef: -; IS__TUNIT____-NEXT: ret double* undef -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_arg_arg_undef -; IS__CGSCC____-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: ret_arg0: -; IS__CGSCC____-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* -; IS__CGSCC____-NEXT: ret double* [[BC1]] -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_ARG1:%.*]], label [[RET_UNDEF:%.*]] -; IS__CGSCC____: ret_arg1: -; IS__CGSCC____-NEXT: ret double* [[BC0]] -; IS__CGSCC____: ret_undef: -; IS__CGSCC____-NEXT: ret double* undef +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ret_arg_arg_undef +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[IF_END:%.*]] +; NOT_CGSCC_NPM: ret_arg0: +; NOT_CGSCC_NPM-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* +; NOT_CGSCC_NPM-NEXT: ret double* [[BC1]] +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[RET_ARG1:%.*]], label [[RET_UNDEF:%.*]] +; NOT_CGSCC_NPM: ret_arg1: +; NOT_CGSCC_NPM-NEXT: ret double* [[BC0]] +; NOT_CGSCC_NPM: ret_undef: +; NOT_CGSCC_NPM-NEXT: ret double* undef +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ret_arg_arg_undef +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[IF_END:%.*]] +; NOT_TUNIT_NPM: ret_arg0: +; NOT_TUNIT_NPM-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* +; NOT_TUNIT_NPM-NEXT: ret double* [[BC1]] +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[RET_ARG1:%.*]], label [[RET_UNDEF:%.*]] +; NOT_TUNIT_NPM: ret_arg1: +; NOT_TUNIT_NPM-NEXT: ret double* [[BC0]] +; NOT_TUNIT_NPM: ret_undef: +; NOT_TUNIT_NPM-NEXT: ret double* undef ; entry: %bc0 = bitcast i32* %b to double* @@ -1055,39 +1053,39 @@ ; } ; define double* @ret_undef_arg_arg(i32* %b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_undef_arg_arg -; IS__TUNIT____-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_UNDEF:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: ret_undef: -; IS__TUNIT____-NEXT: ret double* undef -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[RET_ARG1:%.*]] -; IS__TUNIT____: ret_arg0: -; IS__TUNIT____-NEXT: ret double* [[BC0]] -; IS__TUNIT____: ret_arg1: -; IS__TUNIT____-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* -; IS__TUNIT____-NEXT: ret double* [[BC1]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_undef_arg_arg -; IS__CGSCC____-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_UNDEF:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: ret_undef: -; IS__CGSCC____-NEXT: ret double* undef -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[RET_ARG1:%.*]] -; IS__CGSCC____: ret_arg0: -; IS__CGSCC____-NEXT: ret double* [[BC0]] -; IS__CGSCC____: ret_arg1: -; IS__CGSCC____-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* -; IS__CGSCC____-NEXT: ret double* [[BC1]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ret_undef_arg_arg +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[RET_UNDEF:%.*]], label [[IF_END:%.*]] +; NOT_CGSCC_NPM: ret_undef: +; NOT_CGSCC_NPM-NEXT: ret double* undef +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[RET_ARG1:%.*]] +; NOT_CGSCC_NPM: ret_arg0: +; NOT_CGSCC_NPM-NEXT: ret double* [[BC0]] +; NOT_CGSCC_NPM: ret_arg1: +; NOT_CGSCC_NPM-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* +; NOT_CGSCC_NPM-NEXT: ret double* [[BC1]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ret_undef_arg_arg +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[RET_UNDEF:%.*]], label [[IF_END:%.*]] +; NOT_TUNIT_NPM: ret_undef: +; NOT_TUNIT_NPM-NEXT: ret double* undef +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[RET_ARG1:%.*]] +; NOT_TUNIT_NPM: ret_arg0: +; NOT_TUNIT_NPM-NEXT: ret double* [[BC0]] +; NOT_TUNIT_NPM: ret_arg1: +; NOT_TUNIT_NPM-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* +; NOT_TUNIT_NPM-NEXT: ret double* [[BC1]] ; entry: %bc0 = bitcast i32* %b to double* @@ -1120,37 +1118,37 @@ ; } ; define double* @ret_undef_arg_undef(i32* %b) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_undef_arg_undef -; IS__TUNIT____-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_UNDEF0:%.*]], label [[IF_END:%.*]] -; IS__TUNIT____: ret_undef0: -; IS__TUNIT____-NEXT: ret double* undef -; IS__TUNIT____: if.end: -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNDEF1:%.*]] -; IS__TUNIT____: ret_arg: -; IS__TUNIT____-NEXT: ret double* [[BC0]] -; IS__TUNIT____: ret_undef1: -; IS__TUNIT____-NEXT: ret double* undef -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_undef_arg_undef -; IS__CGSCC____-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_UNDEF0:%.*]], label [[IF_END:%.*]] -; IS__CGSCC____: ret_undef0: -; IS__CGSCC____-NEXT: ret double* undef -; IS__CGSCC____: if.end: -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNDEF1:%.*]] -; IS__CGSCC____: ret_arg: -; IS__CGSCC____-NEXT: ret double* [[BC0]] -; IS__CGSCC____: ret_undef1: -; IS__CGSCC____-NEXT: ret double* undef +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ret_undef_arg_undef +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[RET_UNDEF0:%.*]], label [[IF_END:%.*]] +; NOT_CGSCC_NPM: ret_undef0: +; NOT_CGSCC_NPM-NEXT: ret double* undef +; NOT_CGSCC_NPM: if.end: +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNDEF1:%.*]] +; NOT_CGSCC_NPM: ret_arg: +; NOT_CGSCC_NPM-NEXT: ret double* [[BC0]] +; NOT_CGSCC_NPM: ret_undef1: +; NOT_CGSCC_NPM-NEXT: ret double* undef +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ret_undef_arg_undef +; NOT_TUNIT_NPM-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[RET_UNDEF0:%.*]], label [[IF_END:%.*]] +; NOT_TUNIT_NPM: ret_undef0: +; NOT_TUNIT_NPM-NEXT: ret double* undef +; NOT_TUNIT_NPM: if.end: +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNDEF1:%.*]] +; NOT_TUNIT_NPM: ret_arg: +; NOT_TUNIT_NPM-NEXT: ret double* [[BC0]] +; NOT_TUNIT_NPM: ret_undef1: +; NOT_TUNIT_NPM-NEXT: ret double* undef ; entry: %bc0 = bitcast i32* %b to double* @@ -1183,29 +1181,29 @@ declare i32* @unknown(i32*) define i32* @ret_arg_or_unknown(i32* %b) #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_arg_or_unknown -; IS__TUNIT____-SAME: (i32* [[B:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] -; IS__TUNIT____: ret_arg: -; IS__TUNIT____-NEXT: ret i32* [[B]] -; IS__TUNIT____: ret_unknown: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) -; IS__TUNIT____-NEXT: ret i32* [[CALL]] -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_arg_or_unknown -; IS__CGSCC____-SAME: (i32* [[B:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] -; IS__CGSCC____: ret_arg: -; IS__CGSCC____-NEXT: ret i32* [[B]] -; IS__CGSCC____: ret_unknown: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) -; IS__CGSCC____-NEXT: ret i32* [[CALL]] +; NOT_CGSCC_NPM: Function Attrs: noinline nounwind uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ret_arg_or_unknown +; NOT_CGSCC_NPM-SAME: (i32* [[B:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; NOT_CGSCC_NPM: ret_arg: +; NOT_CGSCC_NPM-NEXT: ret i32* [[B]] +; NOT_CGSCC_NPM: ret_unknown: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) +; NOT_CGSCC_NPM-NEXT: ret i32* [[CALL]] +; +; NOT_TUNIT_NPM: Function Attrs: noinline nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ret_arg_or_unknown +; NOT_TUNIT_NPM-SAME: (i32* [[B:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; NOT_TUNIT_NPM: ret_arg: +; NOT_TUNIT_NPM-NEXT: ret i32* [[B]] +; NOT_TUNIT_NPM: ret_unknown: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) +; NOT_TUNIT_NPM-NEXT: ret i32* [[CALL]] ; entry: %cmp = icmp eq i32* %b, null @@ -1220,35 +1218,35 @@ } define i32* @ret_arg_or_unknown_through_phi(i32* %b) #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi -; IS__TUNIT____-SAME: (i32* [[B:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null -; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] -; IS__TUNIT____: ret_arg: -; IS__TUNIT____-NEXT: br label [[R:%.*]] -; IS__TUNIT____: ret_unknown: -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) -; IS__TUNIT____-NEXT: br label [[R]] -; IS__TUNIT____: r: -; IS__TUNIT____-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ] -; IS__TUNIT____-NEXT: ret i32* [[PHI]] -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi -; IS__CGSCC____-SAME: (i32* [[B:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null -; IS__CGSCC____-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] -; IS__CGSCC____: ret_arg: -; IS__CGSCC____-NEXT: br label [[R:%.*]] -; IS__CGSCC____: ret_unknown: -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) -; IS__CGSCC____-NEXT: br label [[R]] -; IS__CGSCC____: r: -; IS__CGSCC____-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ] -; IS__CGSCC____-NEXT: ret i32* [[PHI]] +; NOT_CGSCC_NPM: Function Attrs: noinline nounwind uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi +; NOT_CGSCC_NPM-SAME: (i32* [[B:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; NOT_CGSCC_NPM: ret_arg: +; NOT_CGSCC_NPM-NEXT: br label [[R:%.*]] +; NOT_CGSCC_NPM: ret_unknown: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) +; NOT_CGSCC_NPM-NEXT: br label [[R]] +; NOT_CGSCC_NPM: r: +; NOT_CGSCC_NPM-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ] +; NOT_CGSCC_NPM-NEXT: ret i32* [[PHI]] +; +; NOT_TUNIT_NPM: Function Attrs: noinline nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi +; NOT_TUNIT_NPM-SAME: (i32* [[B:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; NOT_TUNIT_NPM: ret_arg: +; NOT_TUNIT_NPM-NEXT: br label [[R:%.*]] +; NOT_TUNIT_NPM: ret_unknown: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) +; NOT_TUNIT_NPM-NEXT: br label [[R]] +; NOT_TUNIT_NPM: r: +; NOT_TUNIT_NPM-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ] +; NOT_TUNIT_NPM-NEXT: ret i32* [[PHI]] ; entry: %cmp = icmp eq i32* %b, null @@ -1269,21 +1267,21 @@ ; TEST inconsistent IR in dead code. ; define i32 @deadblockcall1(i32 %A) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@deadblockcall1 -; IS__TUNIT____-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 [[A]] -; IS__TUNIT____: unreachableblock: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@deadblockcall1 -; IS__CGSCC____-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 [[A]] -; IS__CGSCC____: unreachableblock: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@deadblockcall1 +; NOT_CGSCC_NPM-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32 [[A]] +; NOT_CGSCC_NPM: unreachableblock: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@deadblockcall1 +; NOT_TUNIT_NPM-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 [[A]] +; NOT_TUNIT_NPM: unreachableblock: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: ret i32 %A @@ -1295,25 +1293,25 @@ declare i32 @deadblockcall_helper(i32 returned %A); define i32 @deadblockcall2(i32 %A) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@deadblockcall2 -; IS__TUNIT____-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: ret i32 [[A]] -; IS__TUNIT____: unreachableblock1: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: unreachableblock2: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@deadblockcall2 -; IS__CGSCC____-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: ret i32 [[A]] -; IS__CGSCC____: unreachableblock1: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: unreachableblock2: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@deadblockcall2 +; NOT_CGSCC_NPM-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: ret i32 [[A]] +; NOT_CGSCC_NPM: unreachableblock1: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: unreachableblock2: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@deadblockcall2 +; NOT_TUNIT_NPM-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: ret i32 [[A]] +; NOT_TUNIT_NPM: unreachableblock1: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: unreachableblock2: +; NOT_TUNIT_NPM-NEXT: unreachable ; entry: ret i32 %A @@ -1326,29 +1324,29 @@ } define i32 @deadblockphi1(i32 %A) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@deadblockphi1 -; IS__TUNIT____-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[R:%.*]] -; IS__TUNIT____: unreachableblock1: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: unreachableblock2: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: r: -; IS__TUNIT____-NEXT: ret i32 [[A]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@deadblockphi1 -; IS__CGSCC____-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[R:%.*]] -; IS__CGSCC____: unreachableblock1: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: unreachableblock2: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: r: -; IS__CGSCC____-NEXT: ret i32 [[A]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@deadblockphi1 +; NOT_CGSCC_NPM-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[R:%.*]] +; NOT_CGSCC_NPM: unreachableblock1: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: unreachableblock2: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: r: +; NOT_CGSCC_NPM-NEXT: ret i32 [[A]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@deadblockphi1 +; NOT_TUNIT_NPM-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[R:%.*]] +; NOT_TUNIT_NPM: unreachableblock1: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: unreachableblock2: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: r: +; NOT_TUNIT_NPM-NEXT: ret i32 [[A]] ; entry: br label %r @@ -1364,33 +1362,33 @@ } define i32 @deadblockphi2(i32 %A) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@deadblockphi2 -; IS__TUNIT____-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[R:%.*]] -; IS__TUNIT____: unreachableblock1: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: unreachableblock2: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: unreachableblock3: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: r: -; IS__TUNIT____-NEXT: ret i32 [[A]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@deadblockphi2 -; IS__CGSCC____-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[R:%.*]] -; IS__CGSCC____: unreachableblock1: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: unreachableblock2: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: unreachableblock3: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: r: -; IS__CGSCC____-NEXT: ret i32 [[A]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@deadblockphi2 +; NOT_CGSCC_NPM-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[R:%.*]] +; NOT_CGSCC_NPM: unreachableblock1: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: unreachableblock2: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: unreachableblock3: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: r: +; NOT_CGSCC_NPM-NEXT: ret i32 [[A]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@deadblockphi2 +; NOT_TUNIT_NPM-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[R:%.*]] +; NOT_TUNIT_NPM: unreachableblock1: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: unreachableblock2: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: unreachableblock3: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: r: +; NOT_TUNIT_NPM-NEXT: ret i32 [[A]] ; entry: br label %r @@ -1411,35 +1409,35 @@ declare void @noreturn() noreturn; define i32 @deadblockphi3(i32 %A, i1 %c) #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@deadblockphi3 -; IS__TUNIT____-SAME: (i32 returned [[A:%.*]], i1 [[C:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] -; IS__TUNIT____: unreachablecall: -; IS__TUNIT____-NEXT: call void @noreturn() #[[ATTR4:[0-9]+]] -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: unreachableblock2: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: unreachableblock3: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: r: -; IS__TUNIT____-NEXT: ret i32 [[A]] -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@deadblockphi3 -; IS__CGSCC____-SAME: (i32 returned [[A:%.*]], i1 [[C:%.*]]) #[[ATTR4]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] -; IS__CGSCC____: unreachablecall: -; IS__CGSCC____-NEXT: call void @noreturn() #[[ATTR5:[0-9]+]] -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: unreachableblock2: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: unreachableblock3: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: r: -; IS__CGSCC____-NEXT: ret i32 [[A]] +; NOT_CGSCC_NPM: Function Attrs: noinline nounwind uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@deadblockphi3 +; NOT_CGSCC_NPM-SAME: (i32 returned [[A:%.*]], i1 [[C:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] +; NOT_CGSCC_NPM: unreachablecall: +; NOT_CGSCC_NPM-NEXT: call void @noreturn() #[[ATTR4:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: unreachableblock2: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: unreachableblock3: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: r: +; NOT_CGSCC_NPM-NEXT: ret i32 [[A]] +; +; NOT_TUNIT_NPM: Function Attrs: noinline nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@deadblockphi3 +; NOT_TUNIT_NPM-SAME: (i32 returned [[A:%.*]], i1 [[C:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] +; NOT_TUNIT_NPM: unreachablecall: +; NOT_TUNIT_NPM-NEXT: call void @noreturn() #[[ATTR5:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: unreachableblock2: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: unreachableblock3: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: r: +; NOT_TUNIT_NPM-NEXT: ret i32 [[A]] ; entry: br i1 %c, label %r, label %unreachablecall @@ -1528,43 +1526,43 @@ @G = external global i8 define i32* @ret_const() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_const -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* bitcast (i8* @G to i32*) +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ret_const +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32* bitcast (i8* @G to i32*) ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_const -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* bitcast (i8* @G to i32*) +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ret_const +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32* bitcast (i8* @G to i32*) ; %bc = bitcast i8* @G to i32* ret i32* %bc } define i32* @use_const() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@use_const -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* bitcast (i8* @G to i32*) +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@use_const +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32* bitcast (i8* @G to i32*) ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@use_const -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* bitcast (i8* @G to i32*) +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@use_const +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32* bitcast (i8* @G to i32*) ; %c = call i32* @ret_const() ret i32* %c } define i32* @dont_use_const() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@dont_use_const -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* bitcast (i8* @G to i32*) +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@dont_use_const +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32* bitcast (i8* @G to i32*) ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@dont_use_const -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* bitcast (i8* @G to i32*) +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@dont_use_const +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32* bitcast (i8* @G to i32*) ; %c = musttail call i32* @ret_const() ret i32* %c @@ -1615,23 +1613,23 @@ attributes #0 = { noinline nounwind uwtable } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } -; IS__TUNIT____: attributes #[[ATTR3]] = { noinline nounwind uwtable } -; IS__TUNIT____: attributes #[[ATTR4]] = { noreturn } -; IS__TUNIT____: attributes #[[ATTR5:[0-9]+]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR6]] = { nofree nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR7]] = { nounwind } -; IS__TUNIT____: attributes #[[ATTR8:[0-9]+]] = { nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { noinline nounwind uwtable } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { noreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR5:[0-9]+]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { nofree nosync nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR8:[0-9]+]] = { nounwind readnone } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { nofree noinline nosync nounwind readnone uwtable } -; IS__CGSCC____: attributes #[[ATTR3]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } -; IS__CGSCC____: attributes #[[ATTR4]] = { noinline nounwind uwtable } -; IS__CGSCC____: attributes #[[ATTR5]] = { noreturn } -; IS__CGSCC____: attributes #[[ATTR6:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR7]] = { nofree nosync nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR8]] = { nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree noinline nosync nounwind readnone uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { noinline nounwind uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR5]] = { noreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR6:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR8]] = { nounwind } ;. diff --git a/llvm/test/Transforms/Attributor/undefined_behavior.ll b/llvm/test/Transforms/Attributor/undefined_behavior.ll --- a/llvm/test/Transforms/Attributor/undefined_behavior.ll +++ b/llvm/test/Transforms/Attributor/undefined_behavior.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -13,30 +11,30 @@ ; -- Load tests -- define void @load_wholly_unreachable() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@load_wholly_unreachable -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@load_wholly_unreachable +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@load_wholly_unreachable -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@load_wholly_unreachable +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %a = load i32, i32* null ret void } define void @loads_wholly_unreachable() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@loads_wholly_unreachable -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@loads_wholly_unreachable +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@loads_wholly_unreachable -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@loads_wholly_unreachable +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %a = load i32, i32* null %b = load i32, i32* null @@ -45,23 +43,23 @@ define void @load_single_bb_unreachable(i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@load_single_bb_unreachable -; IS__TUNIT____-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@load_single_bb_unreachable -; IS__CGSCC____-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@load_single_bb_unreachable +; NOT_CGSCC_NPM-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: e: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@load_single_bb_unreachable +; NOT_TUNIT_NPM-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: e: +; NOT_TUNIT_NPM-NEXT: ret void ; br i1 %cond, label %t, label %e t: @@ -74,39 +72,39 @@ ; Note that while the load is removed (because it's unused), the block ; is not changed to unreachable define void @load_null_pointer_is_defined() null_pointer_is_valid { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind null_pointer_is_valid readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@load_null_pointer_is_defined -; IS__TUNIT____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind null_pointer_is_valid readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@load_null_pointer_is_defined +; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@load_null_pointer_is_defined -; IS__CGSCC____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@load_null_pointer_is_defined +; NOT_TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret void ; %a = load i32, i32* null ret void } define internal i32* @ret_null() { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_null -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ret_null +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32* undef ; ret i32* null } define void @load_null_propagated() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@load_null_propagated -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@load_null_propagated +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@load_null_propagated -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@load_null_propagated +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %ptr = call i32* @ret_null() %a = load i32, i32* %ptr @@ -116,55 +114,55 @@ ; -- Store tests -- define void @store_wholly_unreachable() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@store_wholly_unreachable -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@store_wholly_unreachable +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@store_wholly_unreachable -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@store_wholly_unreachable +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; store i32 5, i32* null ret void } define void @store_wholly_unreachable_volatile() { -; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@store_wholly_unreachable_volatile -; IS__TUNIT____-SAME: () #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: store volatile i32 5, i32* null, align 4294967296 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@store_wholly_unreachable_volatile -; IS__CGSCC____-SAME: () #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: store volatile i32 5, i32* null, align 4294967296 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@store_wholly_unreachable_volatile +; NOT_CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: store volatile i32 5, i32* null, align 4294967296 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@store_wholly_unreachable_volatile +; NOT_TUNIT_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: store volatile i32 5, i32* null, align 4294967296 +; NOT_TUNIT_NPM-NEXT: ret void ; store volatile i32 5, i32* null ret void } define void @store_single_bb_unreachable(i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@store_single_bb_unreachable -; IS__TUNIT____-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@store_single_bb_unreachable -; IS__CGSCC____-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@store_single_bb_unreachable +; NOT_CGSCC_NPM-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: e: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@store_single_bb_unreachable +; NOT_TUNIT_NPM-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: e: +; NOT_TUNIT_NPM-NEXT: ret void ; br i1 %cond, label %t, label %e t: @@ -175,17 +173,17 @@ } define void @store_null_pointer_is_defined() null_pointer_is_valid { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind null_pointer_is_valid willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@store_null_pointer_is_defined -; IS__TUNIT____-SAME: () #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: store i32 5, i32* null, align 4294967296 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@store_null_pointer_is_defined -; IS__CGSCC____-SAME: () #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 5, i32* null, align 4294967296 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind null_pointer_is_valid willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@store_null_pointer_is_defined +; NOT_CGSCC_NPM-SAME: () #[[ATTR3:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: store i32 5, i32* null, align 4294967296 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@store_null_pointer_is_defined +; NOT_TUNIT_NPM-SAME: () #[[ATTR3:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: store i32 5, i32* null, align 4294967296 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32 5, i32* null ret void @@ -195,15 +193,15 @@ ; ATTRIBUTOR-LABEL: @store_null_propagated( ; ATTRIBUTOR-NEXT: unreachable ; -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@store_null_propagated -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@store_null_propagated +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@store_null_propagated -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@store_null_propagated +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %ptr = call i32* @ret_null() store i32 5, i32* %ptr @@ -213,38 +211,38 @@ ; -- AtomicRMW tests -- define void @atomicrmw_wholly_unreachable() { -; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomicrmw_wholly_unreachable -; IS__TUNIT____-SAME: () #[[ATTR2]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@atomicrmw_wholly_unreachable +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomicrmw_wholly_unreachable -; IS__CGSCC____-SAME: () #[[ATTR2]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@atomicrmw_wholly_unreachable +; NOT_TUNIT_NPM-SAME: () #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %a = atomicrmw add i32* null, i32 1 acquire ret void } define void @atomicrmw_single_bb_unreachable(i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomicrmw_single_bb_unreachable -; IS__TUNIT____-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomicrmw_single_bb_unreachable -; IS__CGSCC____-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@atomicrmw_single_bb_unreachable +; NOT_CGSCC_NPM-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: e: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@atomicrmw_single_bb_unreachable +; NOT_TUNIT_NPM-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: e: +; NOT_TUNIT_NPM-NEXT: ret void ; br i1 %cond, label %t, label %e t: @@ -255,17 +253,17 @@ } define void @atomicrmw_null_pointer_is_defined() null_pointer_is_valid { -; IS__TUNIT____: Function Attrs: nofree nounwind null_pointer_is_valid willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomicrmw_null_pointer_is_defined -; IS__TUNIT____-SAME: () #[[ATTR4:[0-9]+]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = atomicrmw add i32* null, i32 1 acquire, align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind null_pointer_is_valid willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomicrmw_null_pointer_is_defined -; IS__CGSCC____-SAME: () #[[ATTR4:[0-9]+]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = atomicrmw add i32* null, i32 1 acquire, align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nounwind null_pointer_is_valid willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@atomicrmw_null_pointer_is_defined +; NOT_CGSCC_NPM-SAME: () #[[ATTR4:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = atomicrmw add i32* null, i32 1 acquire, align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nounwind null_pointer_is_valid willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@atomicrmw_null_pointer_is_defined +; NOT_TUNIT_NPM-SAME: () #[[ATTR4:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = atomicrmw add i32* null, i32 1 acquire, align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; %a = atomicrmw add i32* null, i32 1 acquire ret void @@ -275,15 +273,15 @@ ; ATTRIBUTOR-LABEL: @atomicrmw_null_propagated( ; ATTRIBUTOR-NEXT: unreachable ; -; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomicrmw_null_propagated -; IS__TUNIT____-SAME: () #[[ATTR2]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@atomicrmw_null_propagated +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomicrmw_null_propagated -; IS__CGSCC____-SAME: () #[[ATTR2]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@atomicrmw_null_propagated +; NOT_TUNIT_NPM-SAME: () #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %ptr = call i32* @ret_null() %a = atomicrmw add i32* %ptr, i32 1 acquire @@ -293,38 +291,38 @@ ; -- AtomicCmpXchg tests -- define void @atomiccmpxchg_wholly_unreachable() { -; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomiccmpxchg_wholly_unreachable -; IS__TUNIT____-SAME: () #[[ATTR2]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@atomiccmpxchg_wholly_unreachable +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomiccmpxchg_wholly_unreachable -; IS__CGSCC____-SAME: () #[[ATTR2]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@atomiccmpxchg_wholly_unreachable +; NOT_TUNIT_NPM-SAME: () #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %a = cmpxchg i32* null, i32 2, i32 3 acq_rel monotonic ret void } define void @atomiccmpxchg_single_bb_unreachable(i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomiccmpxchg_single_bb_unreachable -; IS__TUNIT____-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomiccmpxchg_single_bb_unreachable -; IS__CGSCC____-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@atomiccmpxchg_single_bb_unreachable +; NOT_CGSCC_NPM-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: e: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@atomiccmpxchg_single_bb_unreachable +; NOT_TUNIT_NPM-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: e: +; NOT_TUNIT_NPM-NEXT: ret void ; br i1 %cond, label %t, label %e t: @@ -335,17 +333,17 @@ } define void @atomiccmpxchg_null_pointer_is_defined() null_pointer_is_valid { -; IS__TUNIT____: Function Attrs: nofree nounwind null_pointer_is_valid willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomiccmpxchg_null_pointer_is_defined -; IS__TUNIT____-SAME: () #[[ATTR4]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = cmpxchg i32* null, i32 2, i32 3 acq_rel monotonic, align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind null_pointer_is_valid willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomiccmpxchg_null_pointer_is_defined -; IS__CGSCC____-SAME: () #[[ATTR4]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = cmpxchg i32* null, i32 2, i32 3 acq_rel monotonic, align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nounwind null_pointer_is_valid willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@atomiccmpxchg_null_pointer_is_defined +; NOT_CGSCC_NPM-SAME: () #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = cmpxchg i32* null, i32 2, i32 3 acq_rel monotonic, align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nounwind null_pointer_is_valid willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@atomiccmpxchg_null_pointer_is_defined +; NOT_TUNIT_NPM-SAME: () #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = cmpxchg i32* null, i32 2, i32 3 acq_rel monotonic, align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; %a = cmpxchg i32* null, i32 2, i32 3 acq_rel monotonic ret void @@ -355,15 +353,15 @@ ; ATTRIBUTOR-LABEL: @atomiccmpxchg_null_propagated( ; ATTRIBUTOR-NEXT: unreachable ; -; IS__TUNIT____: Function Attrs: nofree nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@atomiccmpxchg_null_propagated -; IS__TUNIT____-SAME: () #[[ATTR2]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@atomiccmpxchg_null_propagated +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@atomiccmpxchg_null_propagated -; IS__CGSCC____-SAME: () #[[ATTR2]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@atomiccmpxchg_null_propagated +; NOT_TUNIT_NPM-SAME: () #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %ptr = call i32* @ret_null() %a = cmpxchg i32* %ptr, i32 2, i32 3 acq_rel monotonic @@ -375,23 +373,23 @@ ; Note: The unreachable on %t and %e is _not_ from AAUndefinedBehavior define i32 @cond_br_on_undef() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cond_br_on_undef -; IS__TUNIT____-SAME: () #[[ATTR5:[0-9]+]] { -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cond_br_on_undef -; IS__CGSCC____-SAME: () #[[ATTR5:[0-9]+]] { -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@cond_br_on_undef +; NOT_CGSCC_NPM-SAME: () #[[ATTR5:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: e: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cond_br_on_undef +; NOT_TUNIT_NPM-SAME: () #[[ATTR5:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: e: +; NOT_TUNIT_NPM-NEXT: unreachable ; br i1 undef, label %t, label %e t: @@ -404,31 +402,31 @@ ; Valid branch - verify that this is not converted ; to unreachable. define void @cond_br_on_undef2(i1 %cond) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cond_br_on_undef2 -; IS__TUNIT____-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: br i1 [[COND]], label [[T1:%.*]], label [[E1:%.*]] -; IS__TUNIT____: t1: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: t2: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e2: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e1: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cond_br_on_undef2 -; IS__CGSCC____-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: br i1 [[COND]], label [[T1:%.*]], label [[E1:%.*]] -; IS__CGSCC____: t1: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: t2: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e2: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e1: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@cond_br_on_undef2 +; NOT_CGSCC_NPM-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[COND]], label [[T1:%.*]], label [[E1:%.*]] +; NOT_CGSCC_NPM: t1: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: t2: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: e2: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: e1: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cond_br_on_undef2 +; NOT_TUNIT_NPM-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[COND]], label [[T1:%.*]], label [[E1:%.*]] +; NOT_TUNIT_NPM: t1: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: t2: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: e2: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: e1: +; NOT_TUNIT_NPM-NEXT: ret void ; br i1 %cond, label %t1, label %e1 t1: @@ -442,37 +440,37 @@ } define i1 @ret_undef() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_undef -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i1 undef +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ret_undef +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i1 undef ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_undef -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i1 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ret_undef +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i1 undef ; ret i1 undef } define void @cond_br_on_undef_interproc() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc -; IS__TUNIT____-SAME: () #[[ATTR5]] { -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc -; IS__CGSCC____-SAME: () #[[ATTR5]] { -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc +; NOT_CGSCC_NPM-SAME: () #[[ATTR5]] { +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: e: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc +; NOT_TUNIT_NPM-SAME: () #[[ATTR5]] { +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: e: +; NOT_TUNIT_NPM-NEXT: unreachable ; %cond = call i1 @ret_undef() br i1 %cond, label %t, label %e @@ -483,23 +481,23 @@ } define i1 @ret_undef2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_undef2 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: br i1 true, label [[T:%.*]], label [[E:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: ret i1 undef -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret_undef2 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: br i1 true, label [[T:%.*]], label [[E:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i1 undef -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ret_undef2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: br i1 true, label [[T:%.*]], label [[E:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: ret i1 undef +; NOT_CGSCC_NPM: e: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ret_undef2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: br i1 true, label [[T:%.*]], label [[E:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: ret i1 undef +; NOT_TUNIT_NPM: e: +; NOT_TUNIT_NPM-NEXT: unreachable ; br i1 true, label %t, label %e t: @@ -510,23 +508,23 @@ ; More complicated interproc deduction of undef define void @cond_br_on_undef_interproc2() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc2 -; IS__TUNIT____-SAME: () #[[ATTR5]] { -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc2 -; IS__CGSCC____-SAME: () #[[ATTR5]] { -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR5]] { +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: e: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR5]] { +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: e: +; NOT_TUNIT_NPM-NEXT: unreachable ; %cond = call i1 @ret_undef2() br i1 %cond, label %t, label %e @@ -539,23 +537,23 @@ ; Branch on undef that depends on propagation of ; undef of a previous instruction. define i32 @cond_br_on_undef3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cond_br_on_undef3 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: br label [[T:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: ret i32 1 -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cond_br_on_undef3 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: br label [[T:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i32 1 -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@cond_br_on_undef3 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: br label [[T:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: ret i32 1 +; NOT_CGSCC_NPM: e: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cond_br_on_undef3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: br label [[T:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: ret i32 1 +; NOT_TUNIT_NPM: e: +; NOT_TUNIT_NPM-NEXT: unreachable ; %cond = icmp ne i32 1, undef br i1 %cond, label %t, label %e @@ -568,23 +566,23 @@ ; Branch on undef because of uninitialized value. ; FIXME: Currently it doesn't propagate the undef. define i32 @cond_br_on_undef_uninit() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@cond_br_on_undef_uninit -; IS__TUNIT____-SAME: () #[[ATTR5]] { -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: e: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cond_br_on_undef_uninit -; IS__CGSCC____-SAME: () #[[ATTR5]] { -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: e: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@cond_br_on_undef_uninit +; NOT_CGSCC_NPM-SAME: () #[[ATTR5]] { +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: e: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cond_br_on_undef_uninit +; NOT_TUNIT_NPM-SAME: () #[[ATTR5]] { +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: e: +; NOT_TUNIT_NPM-NEXT: unreachable ; %alloc = alloca i1 %cond = load i1, i1* %alloc @@ -601,15 +599,15 @@ ; MODULE-NOT: @callee( define internal i32 @callee(i1 %C, i32* %A) { ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@callee -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: T: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: F: -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callee +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: T: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: F: +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; entry: %A.0 = load i32, i32* null @@ -623,15 +621,15 @@ } define i32 @foo() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 1 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32 1 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 1 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@foo +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32 1 ; %X = call i32 @callee(i1 false, i32* null) ret i32 %X @@ -642,67 +640,67 @@ ; Tests for argument position define void @arg_nonnull_1(i32* nonnull %a) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_1 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_1 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@arg_nonnull_1 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[A]], align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@arg_nonnull_1 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[A]], align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32 0, i32* %a ret void } define void @arg_nonnull_1_noundef_1(i32* nonnull noundef %a) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_1_noundef_1 -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6]] { -; IS__TUNIT____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_1_noundef_1 -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6]] { -; IS__CGSCC____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@arg_nonnull_1_noundef_1 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6]] { +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[A]], align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@arg_nonnull_1_noundef_1 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[A]], align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32 0, i32* %a ret void } define void @arg_nonnull_12(i32* nonnull %a, i32* nonnull %b, i32* %c) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_12 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { -; IS__TUNIT____-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null -; IS__TUNIT____-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: br label [[RET:%.*]] -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: store i32 1, i32* [[B]], align 4 -; IS__TUNIT____-NEXT: br label [[RET]] -; IS__TUNIT____: ret: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_12 -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { -; IS__CGSCC____-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null -; IS__CGSCC____-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: br label [[RET:%.*]] -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: store i32 1, i32* [[B]], align 4 -; IS__CGSCC____-NEXT: br label [[RET]] -; IS__CGSCC____: ret: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@arg_nonnull_12 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { +; NOT_CGSCC_NPM-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null +; NOT_CGSCC_NPM-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[A]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[RET:%.*]] +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[B]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[RET]] +; NOT_CGSCC_NPM: ret: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@arg_nonnull_12 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null +; NOT_TUNIT_NPM-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[A]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[RET:%.*]] +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[B]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[RET]] +; NOT_TUNIT_NPM: ret: +; NOT_TUNIT_NPM-NEXT: ret void ; %d = icmp eq i32* %c, null br i1 %d, label %t, label %f @@ -717,33 +715,33 @@ } define void @arg_nonnull_12_noundef_2(i32* nonnull %a, i32* noundef nonnull %b, i32* %c) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_12_noundef_2 -; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree noundef nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { -; IS__TUNIT____-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null -; IS__TUNIT____-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: br label [[RET:%.*]] -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: store i32 1, i32* [[B]], align 4 -; IS__TUNIT____-NEXT: br label [[RET]] -; IS__TUNIT____: ret: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_12_noundef_2 -; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree noundef nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { -; IS__CGSCC____-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null -; IS__CGSCC____-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: br label [[RET:%.*]] -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: store i32 1, i32* [[B]], align 4 -; IS__CGSCC____-NEXT: br label [[RET]] -; IS__CGSCC____: ret: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@arg_nonnull_12_noundef_2 +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree noundef nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { +; NOT_CGSCC_NPM-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null +; NOT_CGSCC_NPM-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[A]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[RET:%.*]] +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[B]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[RET]] +; NOT_CGSCC_NPM: ret: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@arg_nonnull_12_noundef_2 +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree noundef nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null +; NOT_TUNIT_NPM-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* [[A]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[RET:%.*]] +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[B]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[RET]] +; NOT_TUNIT_NPM: ret: +; NOT_TUNIT_NPM-NEXT: ret void ; %d = icmp eq i32* %c, null br i1 %d, label %t, label %f @@ -759,30 +757,30 @@ ; Pass null directly to argument with nonnull attribute define void @arg_nonnull_violation1_1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_violation1_1 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@arg_nonnull_violation1_1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_violation1_1 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@arg_nonnull_violation1_1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; call void @arg_nonnull_1(i32* null) ret void } define void @arg_nonnull_violation1_2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_violation1_2 -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@arg_nonnull_violation1_2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_violation1_2 -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@arg_nonnull_violation1_2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; call void @arg_nonnull_1_noundef_1(i32* null) ret void @@ -790,15 +788,15 @@ ; A case that depends on value simplification define void @arg_nonnull_violation2_1(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_violation2_1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@arg_nonnull_violation2_1 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_violation2_1 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@arg_nonnull_violation2_1 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %null = getelementptr i32, i32* null, i32 0 %mustnull = select i1 %c, i32* null, i32* %null @@ -807,15 +805,15 @@ } define void @arg_nonnull_violation2_2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_violation2_2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@arg_nonnull_violation2_2 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: unreachable ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_violation2_2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@arg_nonnull_violation2_2 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; %null = getelementptr i32, i32* null, i32 0 %mustnull = select i1 %c, i32* null, i32* %null @@ -825,33 +823,33 @@ ; Cases for single and multiple violation at a callsite define void @arg_nonnull_violation3_1(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_violation3_1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7:[0-9]+]] -; IS__TUNIT____-NEXT: call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR7]] -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: ret: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_violation3_1 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7:[0-9]+]] -; IS__CGSCC____-NEXT: call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR7]] -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: ret: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@arg_nonnull_violation3_1 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: ret: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@arg_nonnull_violation3_1 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: ret: +; NOT_TUNIT_NPM-NEXT: ret void ; %ptr = alloca i32 br i1 %c, label %t, label %f @@ -872,33 +870,33 @@ } define void @arg_nonnull_violation3_2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_violation3_2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7]] -; IS__TUNIT____-NEXT: call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR7]] -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: ret: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_violation3_2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7]] -; IS__CGSCC____-NEXT: call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR7]] -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: ret: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@arg_nonnull_violation3_2 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: ret: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@arg_nonnull_violation3_2 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR7]] +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: ret: +; NOT_TUNIT_NPM-NEXT: ret void ; %ptr = alloca i32 br i1 %c, label %t, label %f @@ -921,35 +919,35 @@ ; Tests for returned position define nonnull i32* @returned_nonnnull(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@returned_nonnnull -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ -; IS__TUNIT____-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__TUNIT____-NEXT: i32 1, label [[ONONE:%.*]] -; IS__TUNIT____-NEXT: ] -; IS__TUNIT____: onzero: -; IS__TUNIT____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: ret i32* [[PTR]] -; IS__TUNIT____: onone: -; IS__TUNIT____-NEXT: ret i32* null -; IS__TUNIT____: ondefault: -; IS__TUNIT____-NEXT: ret i32* undef -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@returned_nonnnull -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ -; IS__CGSCC____-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__CGSCC____-NEXT: i32 1, label [[ONONE:%.*]] -; IS__CGSCC____-NEXT: ] -; IS__CGSCC____: onzero: -; IS__CGSCC____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: ret i32* [[PTR]] -; IS__CGSCC____: onone: -; IS__CGSCC____-NEXT: ret i32* null -; IS__CGSCC____: ondefault: -; IS__CGSCC____-NEXT: ret i32* undef +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@returned_nonnnull +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ +; NOT_CGSCC_NPM-NEXT: i32 0, label [[ONZERO:%.*]] +; NOT_CGSCC_NPM-NEXT: i32 1, label [[ONONE:%.*]] +; NOT_CGSCC_NPM-NEXT: ] +; NOT_CGSCC_NPM: onzero: +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: ret i32* [[PTR]] +; NOT_CGSCC_NPM: onone: +; NOT_CGSCC_NPM-NEXT: ret i32* null +; NOT_CGSCC_NPM: ondefault: +; NOT_CGSCC_NPM-NEXT: ret i32* undef +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@returned_nonnnull +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ +; NOT_TUNIT_NPM-NEXT: i32 0, label [[ONZERO:%.*]] +; NOT_TUNIT_NPM-NEXT: i32 1, label [[ONONE:%.*]] +; NOT_TUNIT_NPM-NEXT: ] +; NOT_TUNIT_NPM: onzero: +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: ret i32* [[PTR]] +; NOT_TUNIT_NPM: onone: +; NOT_TUNIT_NPM-NEXT: ret i32* null +; NOT_TUNIT_NPM: ondefault: +; NOT_TUNIT_NPM-NEXT: ret i32* undef ; switch i32 %c, label %ondefault [ i32 0, label %onzero i32 1, label %onone ] @@ -963,35 +961,35 @@ } define noundef i32* @returned_noundef(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@returned_noundef -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ -; IS__TUNIT____-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__TUNIT____-NEXT: i32 1, label [[ONONE:%.*]] -; IS__TUNIT____-NEXT: ] -; IS__TUNIT____: onzero: -; IS__TUNIT____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: ret i32* [[PTR]] -; IS__TUNIT____: onone: -; IS__TUNIT____-NEXT: ret i32* null -; IS__TUNIT____: ondefault: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@returned_noundef -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ -; IS__CGSCC____-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__CGSCC____-NEXT: i32 1, label [[ONONE:%.*]] -; IS__CGSCC____-NEXT: ] -; IS__CGSCC____: onzero: -; IS__CGSCC____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: ret i32* [[PTR]] -; IS__CGSCC____: onone: -; IS__CGSCC____-NEXT: ret i32* null -; IS__CGSCC____: ondefault: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@returned_noundef +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ +; NOT_CGSCC_NPM-NEXT: i32 0, label [[ONZERO:%.*]] +; NOT_CGSCC_NPM-NEXT: i32 1, label [[ONONE:%.*]] +; NOT_CGSCC_NPM-NEXT: ] +; NOT_CGSCC_NPM: onzero: +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: ret i32* [[PTR]] +; NOT_CGSCC_NPM: onone: +; NOT_CGSCC_NPM-NEXT: ret i32* null +; NOT_CGSCC_NPM: ondefault: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@returned_noundef +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ +; NOT_TUNIT_NPM-NEXT: i32 0, label [[ONZERO:%.*]] +; NOT_TUNIT_NPM-NEXT: i32 1, label [[ONONE:%.*]] +; NOT_TUNIT_NPM-NEXT: ] +; NOT_TUNIT_NPM: onzero: +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: ret i32* [[PTR]] +; NOT_TUNIT_NPM: onone: +; NOT_TUNIT_NPM-NEXT: ret i32* null +; NOT_TUNIT_NPM: ondefault: +; NOT_TUNIT_NPM-NEXT: unreachable ; switch i32 %c, label %ondefault [ i32 0, label %onzero i32 1, label %onone ] @@ -1005,35 +1003,35 @@ } define nonnull noundef i32* @returned_nonnnull_noundef(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@returned_nonnnull_noundef -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ -; IS__TUNIT____-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__TUNIT____-NEXT: i32 1, label [[ONONE:%.*]] -; IS__TUNIT____-NEXT: ] -; IS__TUNIT____: onzero: -; IS__TUNIT____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: ret i32* [[PTR]] -; IS__TUNIT____: onone: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: ondefault: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@returned_nonnnull_noundef -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ -; IS__CGSCC____-NEXT: i32 0, label [[ONZERO:%.*]] -; IS__CGSCC____-NEXT: i32 1, label [[ONONE:%.*]] -; IS__CGSCC____-NEXT: ] -; IS__CGSCC____: onzero: -; IS__CGSCC____-NEXT: [[PTR:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: ret i32* [[PTR]] -; IS__CGSCC____: onone: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: ondefault: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@returned_nonnnull_noundef +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ +; NOT_CGSCC_NPM-NEXT: i32 0, label [[ONZERO:%.*]] +; NOT_CGSCC_NPM-NEXT: i32 1, label [[ONONE:%.*]] +; NOT_CGSCC_NPM-NEXT: ] +; NOT_CGSCC_NPM: onzero: +; NOT_CGSCC_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: ret i32* [[PTR]] +; NOT_CGSCC_NPM: onone: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: ondefault: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@returned_nonnnull_noundef +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ +; NOT_TUNIT_NPM-NEXT: i32 0, label [[ONZERO:%.*]] +; NOT_TUNIT_NPM-NEXT: i32 1, label [[ONONE:%.*]] +; NOT_TUNIT_NPM-NEXT: ] +; NOT_TUNIT_NPM: onzero: +; NOT_TUNIT_NPM-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: ret i32* [[PTR]] +; NOT_TUNIT_NPM: onone: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: ondefault: +; NOT_TUNIT_NPM-NEXT: unreachable ; switch i32 %c, label %ondefault [ i32 0, label %onzero i32 1, label %onone ] @@ -1047,15 +1045,15 @@ } define noundef i32 @returned_nonnnull_noundef_int() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@returned_nonnnull_noundef_int -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@returned_nonnnull_noundef_int +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@returned_nonnnull_noundef_int -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@returned_nonnnull_noundef_int +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; ret i32 0 } @@ -1082,78 +1080,78 @@ } define i32 @argument_noundef1(i32 noundef %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@argument_noundef1 -; IS__TUNIT____-SAME: (i32 noundef returned [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 [[C]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@argument_noundef1 +; NOT_CGSCC_NPM-SAME: (i32 noundef returned [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32 [[C]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@argument_noundef1 -; IS__CGSCC____-SAME: (i32 noundef returned [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 [[C]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@argument_noundef1 +; NOT_TUNIT_NPM-SAME: (i32 noundef returned [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32 [[C]] ; ret i32 %c } define i32 @violate_noundef_nonpointer() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@violate_noundef_nonpointer -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32 undef +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@violate_noundef_nonpointer +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32 undef ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@violate_noundef_nonpointer -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@violate_noundef_nonpointer +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %ret = call i32 @argument_noundef1(i32 undef) ret i32 %ret } define i32* @argument_noundef2(i32* noundef %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@argument_noundef2 -; IS__TUNIT____-SAME: (i32* nofree noundef readnone returned "no-capture-maybe-returned" [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* [[C]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@argument_noundef2 +; NOT_CGSCC_NPM-SAME: (i32* nofree noundef readnone returned "no-capture-maybe-returned" [[C:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32* [[C]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@argument_noundef2 -; IS__CGSCC____-SAME: (i32* nofree noundef readnone returned "no-capture-maybe-returned" [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* [[C]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@argument_noundef2 +; NOT_TUNIT_NPM-SAME: (i32* nofree noundef readnone returned "no-capture-maybe-returned" [[C:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32* [[C]] ; ret i32* %c } define i32* @violate_noundef_pointer() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@violate_noundef_pointer -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i32* undef +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@violate_noundef_pointer +; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret i32* undef ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@violate_noundef_pointer -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret i32* undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@violate_noundef_pointer +; NOT_TUNIT_NPM-SAME: () #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret i32* undef ; %ret = call i32* @argument_noundef2(i32* undef) ret i32* %ret } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind null_pointer_is_valid readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nosync nounwind null_pointer_is_valid willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR4]] = { nofree nounwind null_pointer_is_valid willreturn } -; IS__TUNIT____: attributes #[[ATTR5]] = { nofree noreturn nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR6]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT____: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind null_pointer_is_valid readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind null_pointer_is_valid willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nofree nounwind null_pointer_is_valid willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { nofree noreturn nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn writeonly } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { nofree norecurse nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind null_pointer_is_valid willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR4]] = { nofree norecurse nounwind null_pointer_is_valid willreturn } -; IS__CGSCC____: attributes #[[ATTR5]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR7]] = { nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree norecurse nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind null_pointer_is_valid willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { nofree norecurse nounwind null_pointer_is_valid willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR5]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR7]] = { nounwind willreturn writeonly } ;. diff --git a/llvm/test/Transforms/Attributor/value-simplify-instances.ll b/llvm/test/Transforms/Attributor/value-simplify-instances.ll --- a/llvm/test/Transforms/Attributor/value-simplify-instances.ll +++ b/llvm/test/Transforms/Attributor/value-simplify-instances.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=14 -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=14 -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:o-i64:64-f80:128-n8:16:32:64-S128" @@ -15,44 +13,44 @@ ; CHECK: @[[G3:[a-zA-Z0-9_$"\\.-]+]] = private global i1 undef ;. define internal i1 @recursive_inst_comparator(i1* %a, i1* %b) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_inst_comparator -; IS__TUNIT____-SAME: (i1* noalias nofree readnone [[A:%.*]], i1* noalias nofree readnone [[B:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[B]] -; IS__TUNIT____-NEXT: ret i1 [[CMP]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_inst_comparator +; NOT_CGSCC_NPM-SAME: (i1* noalias nofree readnone [[A:%.*]], i1* noalias nofree readnone [[B:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[B]] +; NOT_CGSCC_NPM-NEXT: ret i1 [[CMP]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_inst_comparator -; IS__CGSCC____-SAME: (i1* noalias nofree readnone [[A:%.*]], i1* noalias nofree readnone [[B:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[B]] -; IS__CGSCC____-NEXT: ret i1 [[CMP]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@recursive_inst_comparator +; NOT_TUNIT_NPM-SAME: (i1* noalias nofree readnone [[A:%.*]], i1* noalias nofree readnone [[B:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[B]] +; NOT_TUNIT_NPM-NEXT: ret i1 [[CMP]] ; %cmp = icmp eq i1* %a, %b ret i1 %cmp } define internal i1 @recursive_inst_generator(i1 %c, i1* %p) { -; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_inst_generator -; IS__TUNIT____-SAME: (i1 [[C:%.*]], i1* nofree [[P:%.*]]) { -; IS__TUNIT____-NEXT: [[A:%.*]] = call i1* @geti1Ptr() -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[P]]) #[[ATTR4:[0-9]+]] -; IS__TUNIT____-NEXT: ret i1 [[R1]] -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, i1* nofree [[A]]) -; IS__TUNIT____-NEXT: ret i1 [[R2]] +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_inst_generator +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]], i1* nofree [[P:%.*]]) { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = call i1* @geti1Ptr() +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[P]]) #[[ATTR4:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret i1 [[R1]] +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, i1* nofree [[A]]) +; NOT_CGSCC_NPM-NEXT: ret i1 [[R2]] ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_inst_generator -; IS__CGSCC____-SAME: (i1 [[C:%.*]], i1* nofree [[P:%.*]]) { -; IS__CGSCC____-NEXT: [[A:%.*]] = call i1* @geti1Ptr() -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[P]]) -; IS__CGSCC____-NEXT: ret i1 [[R1]] -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, i1* nofree [[A]]) -; IS__CGSCC____-NEXT: ret i1 [[R2]] +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@recursive_inst_generator +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]], i1* nofree [[P:%.*]]) { +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = call i1* @geti1Ptr() +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[P]]) +; NOT_TUNIT_NPM-NEXT: ret i1 [[R1]] +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, i1* nofree [[A]]) +; NOT_TUNIT_NPM-NEXT: ret i1 [[R2]] ; %a = call i1* @geti1Ptr() br i1 %c, label %t, label %f @@ -135,17 +133,17 @@ ; FIXME: This should *not* return true. define i1 @recursive_alloca_compare_caller(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 [[C]], i1* undef) #[[ATTR1]] -; IS__TUNIT____-NEXT: ret i1 [[CALL]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 [[C]], i1* undef) #[[ATTR1]] +; NOT_CGSCC_NPM-NEXT: ret i1 [[CALL]] ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 [[C]], i1* undef) #[[ATTR4:[0-9]+]] -; IS__CGSCC____-NEXT: ret i1 [[CALL]] +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 [[C]], i1* undef) #[[ATTR4:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_alloca_compare(i1 %c, i1* undef) ret i1 %call @@ -180,17 +178,17 @@ } define i8 @recursive_alloca_load_return_caller(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_alloca_load_return_caller -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 [[C]], i8* undef, i8 noundef 42) #[[ATTR3]] -; IS__TUNIT____-NEXT: ret i8 [[CALL]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_alloca_load_return_caller +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 [[C]], i8* undef, i8 noundef 42) #[[ATTR3]] +; NOT_CGSCC_NPM-NEXT: ret i8 [[CALL]] ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone -; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_alloca_load_return_caller -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 [[C]], i8* undef, i8 noundef 42) #[[ATTR5:[0-9]+]] -; IS__CGSCC____-NEXT: ret i8 [[CALL]] +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@recursive_alloca_load_return_caller +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 [[C]], i8* undef, i8 noundef 42) #[[ATTR5:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i8 [[CALL]] ; %call = call i8 @recursive_alloca_load_return(i1 %c, i8* undef, i8 42) ret i8 %call @@ -230,17 +228,17 @@ ; FIXME: This should *not* return true. define i1 @recursive_alloca_compare_caller_global1(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 [[C]]) #[[ATTR3]] -; IS__TUNIT____-NEXT: ret i1 [[CALL]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global1 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 [[C]]) #[[ATTR3]] +; NOT_CGSCC_NPM-NEXT: ret i1 [[CALL]] ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global1 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 [[C]]) #[[ATTR5]] -; IS__CGSCC____-NEXT: ret i1 [[CALL]] +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global1 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 [[C]]) #[[ATTR5]] +; NOT_TUNIT_NPM-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_alloca_compare_global1(i1 %c) ret i1 %call @@ -275,17 +273,17 @@ ; FIXME: This should *not* return true. define i1 @recursive_alloca_compare_caller_global2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 [[C]]) #[[ATTR3]] -; IS__TUNIT____-NEXT: ret i1 [[CALL]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global2 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 [[C]]) #[[ATTR3]] +; NOT_CGSCC_NPM-NEXT: ret i1 [[CALL]] ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 [[C]]) #[[ATTR5]] -; IS__CGSCC____-NEXT: ret i1 [[CALL]] +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global2 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 [[C]]) #[[ATTR5]] +; NOT_TUNIT_NPM-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_alloca_compare_global2(i1 %c) ret i1 %call @@ -318,32 +316,32 @@ ; FIXME: This should *not* return true. define i1 @recursive_inst_compare_caller_global3(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind -; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_inst_compare_caller_global3 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 [[C]]) #[[ATTR3]] -; IS__TUNIT____-NEXT: ret i1 [[CALL]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_inst_compare_caller_global3 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 [[C]]) #[[ATTR3]] +; NOT_CGSCC_NPM-NEXT: ret i1 [[CALL]] ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind -; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_inst_compare_caller_global3 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 [[C]]) #[[ATTR5]] -; IS__CGSCC____-NEXT: ret i1 [[CALL]] +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@recursive_inst_compare_caller_global3 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 [[C]]) #[[ATTR5]] +; NOT_TUNIT_NPM-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_inst_compare_global3(i1 %c) ret i1 %call } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone } -; IS__TUNIT____: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind } -; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nosync nounwind } -; IS__TUNIT____: attributes #[[ATTR4]] = { nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nounwind readnone } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind } -; IS__CGSCC____: attributes #[[ATTR3]] = { nofree nosync nounwind } -; IS__CGSCC____: attributes #[[ATTR4]] = { nounwind readnone } -; IS__CGSCC____: attributes #[[ATTR5]] = { nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR5]] = { nounwind } ;. diff --git a/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll b/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll --- a/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll +++ b/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=53 -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=53 -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 ; %struct.S = type { i32, i32, i32, float, float, float } @@ -56,19 +54,19 @@ ; CHECK: @[[REC_STORAGE:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef ;. define void @write_arg(i32* %p, i32 %v) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@write_arg -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: store i32 [[V]], i32* [[P]], align 4, !tbaa [[TBAA3:![0-9]+]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_arg -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: store i32 [[V]], i32* [[P]], align 4, !tbaa [[TBAA3:![0-9]+]] -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@write_arg +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: store i32 [[V]], i32* [[P]], align 4, !tbaa [[TBAA3:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@write_arg +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: store i32 [[V]], i32* [[P]], align 4, !tbaa [[TBAA3:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret void ; entry: store i32 %v, i32* %p, align 4, !tbaa !3 @@ -109,149 +107,78 @@ ; return r; ; } define void @local_alloca_simplifiable_1(%struct.S* noalias sret(%struct.S) align 4 %agg.result) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1 -; IS__TUNIT_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4 -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR9:[0-9]+]] -; IS__TUNIT_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__TUNIT_OPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 -; IS__TUNIT_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 -; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR5:[0-9]+]] -; IS__TUNIT_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR5]] -; IS__TUNIT_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR5]] -; IS__TUNIT_OPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 -; IS__TUNIT_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]] -; IS__TUNIT_OPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 -; IS__TUNIT_OPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 -; IS__TUNIT_OPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]] -; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 -; IS__TUNIT_OPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 -; IS__TUNIT_OPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]] -; IS__TUNIT_OPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 -; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]] -; IS__TUNIT_OPM-NEXT: [[MUL11:%.*]] = shl nsw i32 2, 1 -; IS__TUNIT_OPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 -; IS__TUNIT_OPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]] -; IS__TUNIT_OPM-NEXT: [[ADD15:%.*]] = add nsw i32 3, 1 -; IS__TUNIT_OPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 -; IS__TUNIT_OPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]] -; IS__TUNIT_OPM-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR9]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1 -; IS__TUNIT_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4 -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR7:[0-9]+]] -; IS__TUNIT_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__TUNIT_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 -; IS__TUNIT_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 -; IS__TUNIT_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR4:[0-9]+]] -; IS__TUNIT_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR4]] -; IS__TUNIT_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR4]] -; IS__TUNIT_NPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 -; IS__TUNIT_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]] -; IS__TUNIT_NPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 -; IS__TUNIT_NPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 -; IS__TUNIT_NPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]] -; IS__TUNIT_NPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 -; IS__TUNIT_NPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 -; IS__TUNIT_NPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]] -; IS__TUNIT_NPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 -; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]] -; IS__TUNIT_NPM-NEXT: [[MUL11:%.*]] = shl nsw i32 2, 1 -; IS__TUNIT_NPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 -; IS__TUNIT_NPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]] -; IS__TUNIT_NPM-NEXT: [[ADD15:%.*]] = add nsw i32 3, 1 -; IS__TUNIT_NPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 -; IS__TUNIT_NPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]] -; IS__TUNIT_NPM-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR7]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1 -; IS__CGSCC_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4 -; IS__CGSCC_OPM-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR11:[0-9]+]] -; IS__CGSCC_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__CGSCC_OPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 -; IS__CGSCC_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 -; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR12:[0-9]+]] -; IS__CGSCC_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR12]] -; IS__CGSCC_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR12]] -; IS__CGSCC_OPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 -; IS__CGSCC_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 -; IS__CGSCC_OPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 -; IS__CGSCC_OPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 -; IS__CGSCC_OPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 -; IS__CGSCC_OPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[MUL11:%.*]] = shl nsw i32 2, 1 -; IS__CGSCC_OPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 -; IS__CGSCC_OPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[ADD15:%.*]] = add nsw i32 3, 1 -; IS__CGSCC_OPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 -; IS__CGSCC_OPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]] -; IS__CGSCC_OPM-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR11]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1 -; IS__CGSCC_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4 -; IS__CGSCC_NPM-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR9:[0-9]+]] -; IS__CGSCC_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__CGSCC_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 -; IS__CGSCC_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 -; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR10:[0-9]+]] -; IS__CGSCC_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR10]] -; IS__CGSCC_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR10]] -; IS__CGSCC_NPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 -; IS__CGSCC_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 -; IS__CGSCC_NPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 -; IS__CGSCC_NPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 -; IS__CGSCC_NPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 -; IS__CGSCC_NPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 -; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[MUL11:%.*]] = shl nsw i32 2, 1 -; IS__CGSCC_NPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 -; IS__CGSCC_NPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[ADD15:%.*]] = add nsw i32 3, 1 -; IS__CGSCC_NPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 -; IS__CGSCC_NPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]] -; IS__CGSCC_NPM-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR9]] -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1 +; NOT_CGSCC_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4 +; NOT_CGSCC_NPM-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR7:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; NOT_CGSCC_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; NOT_CGSCC_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; NOT_CGSCC_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; NOT_CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR4:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; NOT_CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; NOT_CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; NOT_CGSCC_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 +; NOT_CGSCC_NPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; NOT_CGSCC_NPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 +; NOT_CGSCC_NPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; NOT_CGSCC_NPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[MUL11:%.*]] = shl nsw i32 2, 1 +; NOT_CGSCC_NPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; NOT_CGSCC_NPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[ADD15:%.*]] = add nsw i32 3, 1 +; NOT_CGSCC_NPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; NOT_CGSCC_NPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1 +; NOT_TUNIT_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4 +; NOT_TUNIT_NPM-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR9:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; NOT_TUNIT_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; NOT_TUNIT_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; NOT_TUNIT_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; NOT_TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR10:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; NOT_TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR10]] +; NOT_TUNIT_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; NOT_TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR10]] +; NOT_TUNIT_NPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; NOT_TUNIT_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 +; NOT_TUNIT_NPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; NOT_TUNIT_NPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 +; NOT_TUNIT_NPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; NOT_TUNIT_NPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[MUL11:%.*]] = shl nsw i32 2, 1 +; NOT_TUNIT_NPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; NOT_TUNIT_NPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[ADD15:%.*]] = add nsw i32 3, 1 +; NOT_TUNIT_NPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; NOT_TUNIT_NPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR9]] +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %s = alloca %struct.S, align 4 @@ -326,329 +253,168 @@ ; } ; define void @local_alloca_simplifiable_2() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2 -; IS__TUNIT_OPM-SAME: () #[[ATTR2:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]]) -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_OPM: for.cond: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 -; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_INC]] -; IS__TUNIT_OPM: for.inc: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP15:![0-9]+]] -; IS__TUNIT_OPM: for.end: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND2:%.*]] -; IS__TUNIT_OPM: for.cond2: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] -; IS__TUNIT_OPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 -; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup4: -; IS__TUNIT_OPM-NEXT: br label [[FOR_END11:%.*]] -; IS__TUNIT_OPM: for.body5: -; IS__TUNIT_OPM-NEXT: [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float* -; IS__TUNIT_OPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 -; IS__TUNIT_OPM-NEXT: [[I18:%.*]] = or i64 [[I17]], 1 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_INC9]] -; IS__TUNIT_OPM: for.inc9: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP17:![0-9]+]] -; IS__TUNIT_OPM: for.end11: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND13:%.*]] -; IS__TUNIT_OPM: for.cond13: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC22:%.*]] ], [ 0, [[FOR_END11]] ] -; IS__TUNIT_OPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 -; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup15: -; IS__TUNIT_OPM-NEXT: br label [[FOR_END24:%.*]] -; IS__TUNIT_OPM: for.body16: -; IS__TUNIT_OPM-NEXT: [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64* -; IS__TUNIT_OPM-NEXT: [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 -; IS__TUNIT_OPM-NEXT: [[I21:%.*]] = add nuw nsw i64 [[I20]], 2 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_INC22]] -; IS__TUNIT_OPM: for.inc22: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP18:![0-9]+]] -; IS__TUNIT_OPM: for.end24: -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500 -; IS__TUNIT_OPM-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32* -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(524) [[I22]], i32 noundef 0) #[[ATTR6:[0-9]+]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND28:%.*]] -; IS__TUNIT_OPM: for.cond28: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ] -; IS__TUNIT_OPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 -; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY31:%.*]], label [[FOR_COND_CLEANUP30:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup30: -; IS__TUNIT_OPM-NEXT: br label [[FOR_END38:%.*]] -; IS__TUNIT_OPM: for.body31: -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__TUNIT_OPM-NEXT: store i8 0, i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA19:![0-9]+]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_INC36]] -; IS__TUNIT_OPM: for.inc36: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP20:![0-9]+]] -; IS__TUNIT_OPM: for.end38: -; IS__TUNIT_OPM-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I24]]) -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2 -; IS__TUNIT_NPM-SAME: () #[[ATTR2:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]]) #[[ATTR7]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_NPM: for.cond: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 -; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_INC]] -; IS__TUNIT_NPM: for.inc: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP15:![0-9]+]] -; IS__TUNIT_NPM: for.end: -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND2:%.*]] -; IS__TUNIT_NPM: for.cond2: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] -; IS__TUNIT_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 -; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup4: -; IS__TUNIT_NPM-NEXT: br label [[FOR_END11:%.*]] -; IS__TUNIT_NPM: for.body5: -; IS__TUNIT_NPM-NEXT: [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float* -; IS__TUNIT_NPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 -; IS__TUNIT_NPM-NEXT: [[I18:%.*]] = or i64 [[I17]], 1 -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_INC9]] -; IS__TUNIT_NPM: for.inc9: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP17:![0-9]+]] -; IS__TUNIT_NPM: for.end11: -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND13:%.*]] -; IS__TUNIT_NPM: for.cond13: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC22:%.*]] ], [ 0, [[FOR_END11]] ] -; IS__TUNIT_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 -; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup15: -; IS__TUNIT_NPM-NEXT: br label [[FOR_END24:%.*]] -; IS__TUNIT_NPM: for.body16: -; IS__TUNIT_NPM-NEXT: [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64* -; IS__TUNIT_NPM-NEXT: [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 -; IS__TUNIT_NPM-NEXT: [[I21:%.*]] = add nuw nsw i64 [[I20]], 2 -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_INC22]] -; IS__TUNIT_NPM: for.inc22: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP18:![0-9]+]] -; IS__TUNIT_NPM: for.end24: -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023 -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500 -; IS__TUNIT_NPM-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32* -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(524) [[I22]], i32 noundef 0) #[[ATTR4]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND28:%.*]] -; IS__TUNIT_NPM: for.cond28: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ] -; IS__TUNIT_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 -; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY31:%.*]], label [[FOR_COND_CLEANUP30:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup30: -; IS__TUNIT_NPM-NEXT: br label [[FOR_END38:%.*]] -; IS__TUNIT_NPM: for.body31: -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__TUNIT_NPM-NEXT: store i8 0, i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA19:![0-9]+]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_INC36]] -; IS__TUNIT_NPM: for.inc36: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP20:![0-9]+]] -; IS__TUNIT_NPM: for.end38: -; IS__TUNIT_NPM-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I24]]) #[[ATTR7]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2() { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 -; IS__CGSCC_OPM-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]]) -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_OPM: for.cond: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 -; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]] -; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15:![0-9]+]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_INC]] -; IS__CGSCC_OPM: for.inc: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]] -; IS__CGSCC_OPM: for.end: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2:%.*]] -; IS__CGSCC_OPM: for.cond2: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] -; IS__CGSCC_OPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 -; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup4: -; IS__CGSCC_OPM-NEXT: br label [[FOR_END11:%.*]] -; IS__CGSCC_OPM: for.body5: -; IS__CGSCC_OPM-NEXT: [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float* -; IS__CGSCC_OPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 -; IS__CGSCC_OPM-NEXT: [[I18:%.*]] = or i64 [[I17]], 1 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]] -; IS__CGSCC_OPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18:![0-9]+]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_INC9]] -; IS__CGSCC_OPM: for.inc9: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP19:![0-9]+]] -; IS__CGSCC_OPM: for.end11: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13:%.*]] -; IS__CGSCC_OPM: for.cond13: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC22:%.*]] ], [ 0, [[FOR_END11]] ] -; IS__CGSCC_OPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 -; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup15: -; IS__CGSCC_OPM-NEXT: br label [[FOR_END24:%.*]] -; IS__CGSCC_OPM: for.body16: -; IS__CGSCC_OPM-NEXT: [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64* -; IS__CGSCC_OPM-NEXT: [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 -; IS__CGSCC_OPM-NEXT: [[I21:%.*]] = add nuw nsw i64 [[I20]], 2 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]] -; IS__CGSCC_OPM-NEXT: store i64 0, i64* [[ARRAYIDX21]], align 16, !tbaa [[TBAA20:![0-9]+]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_INC22]] -; IS__CGSCC_OPM: for.inc22: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP22:![0-9]+]] -; IS__CGSCC_OPM: for.end24: -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023 -; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[ARRAYIDX25]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500 -; IS__CGSCC_OPM-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32* -; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I22]], i32 noundef 0) #[[ATTR13:[0-9]+]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND28:%.*]] -; IS__CGSCC_OPM: for.cond28: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ] -; IS__CGSCC_OPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 -; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY31:%.*]], label [[FOR_COND_CLEANUP30:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup30: -; IS__CGSCC_OPM-NEXT: br label [[FOR_END38:%.*]] -; IS__CGSCC_OPM: for.body31: -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX33:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC_OPM-NEXT: [[I23:%.*]] = load i8, i8* [[ARRAYIDX33]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC_OPM-NEXT: store i8 [[I23]], i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_INC36]] -; IS__CGSCC_OPM: for.inc36: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP23:![0-9]+]] -; IS__CGSCC_OPM: for.end38: -; IS__CGSCC_OPM-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nofree noundef nonnull [[I24]]) -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2() { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 -; IS__CGSCC_NPM-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 -; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]]) #[[ATTR9]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_NPM: for.cond: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 -; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]] -; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15:![0-9]+]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_INC]] -; IS__CGSCC_NPM: for.inc: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]] -; IS__CGSCC_NPM: for.end: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2:%.*]] -; IS__CGSCC_NPM: for.cond2: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] -; IS__CGSCC_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 -; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup4: -; IS__CGSCC_NPM-NEXT: br label [[FOR_END11:%.*]] -; IS__CGSCC_NPM: for.body5: -; IS__CGSCC_NPM-NEXT: [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float* -; IS__CGSCC_NPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 -; IS__CGSCC_NPM-NEXT: [[I18:%.*]] = or i64 [[I17]], 1 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]] -; IS__CGSCC_NPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18:![0-9]+]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_INC9]] -; IS__CGSCC_NPM: for.inc9: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP19:![0-9]+]] -; IS__CGSCC_NPM: for.end11: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13:%.*]] -; IS__CGSCC_NPM: for.cond13: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC22:%.*]] ], [ 0, [[FOR_END11]] ] -; IS__CGSCC_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 -; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup15: -; IS__CGSCC_NPM-NEXT: br label [[FOR_END24:%.*]] -; IS__CGSCC_NPM: for.body16: -; IS__CGSCC_NPM-NEXT: [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64* -; IS__CGSCC_NPM-NEXT: [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 -; IS__CGSCC_NPM-NEXT: [[I21:%.*]] = add nuw nsw i64 [[I20]], 2 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]] -; IS__CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX21]], align 16, !tbaa [[TBAA20:![0-9]+]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_INC22]] -; IS__CGSCC_NPM: for.inc22: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP22:![0-9]+]] -; IS__CGSCC_NPM: for.end24: -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023 -; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX25]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500 -; IS__CGSCC_NPM-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32* -; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I22]], i32 noundef 0) #[[ATTR11:[0-9]+]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND28:%.*]] -; IS__CGSCC_NPM: for.cond28: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ] -; IS__CGSCC_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 -; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY31:%.*]], label [[FOR_COND_CLEANUP30:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup30: -; IS__CGSCC_NPM-NEXT: br label [[FOR_END38:%.*]] -; IS__CGSCC_NPM: for.body31: -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX33:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC_NPM-NEXT: [[I23:%.*]] = load i8, i8* [[ARRAYIDX33]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC_NPM-NEXT: store i8 [[I23]], i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_INC36]] -; IS__CGSCC_NPM: for.inc36: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP23:![0-9]+]] -; IS__CGSCC_NPM: for.end38: -; IS__CGSCC_NPM-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 -; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nofree noundef nonnull [[I24]]) -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 +; NOT_CGSCC_NPM-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] +; NOT_CGSCC_NPM: for.cond: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 +; NOT_CGSCC_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_END:%.*]] +; NOT_CGSCC_NPM: for.body: +; NOT_CGSCC_NPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_INC]] +; NOT_CGSCC_NPM: for.inc: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP15:![0-9]+]] +; NOT_CGSCC_NPM: for.end: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND2:%.*]] +; NOT_CGSCC_NPM: for.cond2: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] +; NOT_CGSCC_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 +; NOT_CGSCC_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup4: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_END11:%.*]] +; NOT_CGSCC_NPM: for.body5: +; NOT_CGSCC_NPM-NEXT: [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float* +; NOT_CGSCC_NPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 +; NOT_CGSCC_NPM-NEXT: [[I18:%.*]] = or i64 [[I17]], 1 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_INC9]] +; NOT_CGSCC_NPM: for.inc9: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP17:![0-9]+]] +; NOT_CGSCC_NPM: for.end11: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND13:%.*]] +; NOT_CGSCC_NPM: for.cond13: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC22:%.*]] ], [ 0, [[FOR_END11]] ] +; NOT_CGSCC_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 +; NOT_CGSCC_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup15: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_END24:%.*]] +; NOT_CGSCC_NPM: for.body16: +; NOT_CGSCC_NPM-NEXT: [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64* +; NOT_CGSCC_NPM-NEXT: [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 +; NOT_CGSCC_NPM-NEXT: [[I21:%.*]] = add nuw nsw i64 [[I20]], 2 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_INC22]] +; NOT_CGSCC_NPM: for.inc22: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP18:![0-9]+]] +; NOT_CGSCC_NPM: for.end24: +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500 +; NOT_CGSCC_NPM-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32* +; NOT_CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(524) [[I22]], i32 noundef 0) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND28:%.*]] +; NOT_CGSCC_NPM: for.cond28: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ] +; NOT_CGSCC_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 +; NOT_CGSCC_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY31:%.*]], label [[FOR_COND_CLEANUP30:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup30: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_END38:%.*]] +; NOT_CGSCC_NPM: for.body31: +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] +; NOT_CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA19:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_INC36]] +; NOT_CGSCC_NPM: for.inc36: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP20:![0-9]+]] +; NOT_CGSCC_NPM: for.end38: +; NOT_CGSCC_NPM-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I24]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2() { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 +; NOT_TUNIT_NPM-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 +; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]]) #[[ATTR9]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] +; NOT_TUNIT_NPM: for.cond: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 +; NOT_TUNIT_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_END:%.*]] +; NOT_TUNIT_NPM: for.body: +; NOT_TUNIT_NPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]] +; NOT_TUNIT_NPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_INC]] +; NOT_TUNIT_NPM: for.inc: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]] +; NOT_TUNIT_NPM: for.end: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND2:%.*]] +; NOT_TUNIT_NPM: for.cond2: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] +; NOT_TUNIT_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 +; NOT_TUNIT_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup4: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_END11:%.*]] +; NOT_TUNIT_NPM: for.body5: +; NOT_TUNIT_NPM-NEXT: [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float* +; NOT_TUNIT_NPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 +; NOT_TUNIT_NPM-NEXT: [[I18:%.*]] = or i64 [[I17]], 1 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]] +; NOT_TUNIT_NPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_INC9]] +; NOT_TUNIT_NPM: for.inc9: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP19:![0-9]+]] +; NOT_TUNIT_NPM: for.end11: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND13:%.*]] +; NOT_TUNIT_NPM: for.cond13: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC22:%.*]] ], [ 0, [[FOR_END11]] ] +; NOT_TUNIT_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 +; NOT_TUNIT_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup15: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_END24:%.*]] +; NOT_TUNIT_NPM: for.body16: +; NOT_TUNIT_NPM-NEXT: [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64* +; NOT_TUNIT_NPM-NEXT: [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 +; NOT_TUNIT_NPM-NEXT: [[I21:%.*]] = add nuw nsw i64 [[I20]], 2 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]] +; NOT_TUNIT_NPM-NEXT: store i64 0, i64* [[ARRAYIDX21]], align 16, !tbaa [[TBAA20:![0-9]+]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_INC22]] +; NOT_TUNIT_NPM: for.inc22: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP22:![0-9]+]] +; NOT_TUNIT_NPM: for.end24: +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023 +; NOT_TUNIT_NPM-NEXT: store i8 0, i8* [[ARRAYIDX25]], align 1, !tbaa [[TBAA15]] +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500 +; NOT_TUNIT_NPM-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32* +; NOT_TUNIT_NPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I22]], i32 noundef 0) #[[ATTR11:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND28:%.*]] +; NOT_TUNIT_NPM: for.cond28: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ] +; NOT_TUNIT_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 +; NOT_TUNIT_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY31:%.*]], label [[FOR_COND_CLEANUP30:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup30: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_END38:%.*]] +; NOT_TUNIT_NPM: for.body31: +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX33:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[INDVARS_IV12]] +; NOT_TUNIT_NPM-NEXT: [[I23:%.*]] = load i8, i8* [[ARRAYIDX33]], align 1, !tbaa [[TBAA15]] +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] +; NOT_TUNIT_NPM-NEXT: store i8 [[I23]], i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA15]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_INC36]] +; NOT_TUNIT_NPM: for.inc36: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP23:![0-9]+]] +; NOT_TUNIT_NPM: for.end38: +; NOT_TUNIT_NPM-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 +; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nofree noundef nonnull [[I24]]) +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %Bytes = alloca [1024 x i8], align 16 @@ -761,27 +527,27 @@ ; } ; define i32 @local_alloca_simplifiable_3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3 -; IS__TUNIT____-SAME: () #[[ATTR3:[0-9]+]] { -; IS__TUNIT____-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__TUNIT____-NEXT: store i32 1, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: br label [[SPLIT:%.*]] -; IS__TUNIT____: split: -; IS__TUNIT____-NEXT: store i32 2, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: [[L:%.*]] = load i32, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: ret i32 [[L]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3 -; IS__CGSCC____-SAME: () #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: store i32 1, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: br label [[SPLIT:%.*]] -; IS__CGSCC____: split: -; IS__CGSCC____-NEXT: store i32 2, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3 +; NOT_CGSCC_NPM-SAME: () #[[ATTR3:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[A]], align 4 +; NOT_CGSCC_NPM-NEXT: br label [[SPLIT:%.*]] +; NOT_CGSCC_NPM: split: +; NOT_CGSCC_NPM-NEXT: store i32 2, i32* [[A]], align 4 +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[A]], align 4 +; NOT_CGSCC_NPM-NEXT: ret i32 [[L]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[A]], align 4 +; NOT_TUNIT_NPM-NEXT: br label [[SPLIT:%.*]] +; NOT_TUNIT_NPM: split: +; NOT_TUNIT_NPM-NEXT: store i32 2, i32* [[A]], align 4 +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* [[A]], align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 [[L]] ; %A = alloca i32, align 4 store i32 1, i32* %A @@ -797,15 +563,15 @@ ; } ; define i32 @local_alloca_simplifiable_4() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_4 -; IS__TUNIT____-SAME: () #[[ATTR3]] { -; IS__TUNIT____-NEXT: ret i32 undef +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_4 +; NOT_CGSCC_NPM-SAME: () #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: ret i32 undef ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_4 -; IS__CGSCC____-SAME: () #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_4 +; NOT_TUNIT_NPM-SAME: () #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %A = alloca i32, align 4 %l = load i32, i32* %A, align 4 @@ -819,77 +585,42 @@ ; return *p; ; } define i32 @multi_obj_simplifiable_1(i32 %cnd) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1 -; IS__TUNIT_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[L:%.*]] = alloca i32, align 4 -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]] -; IS__TUNIT_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] -; IS__TUNIT_OPM: cond.true: -; IS__TUNIT_OPM-NEXT: br label [[COND_END:%.*]] -; IS__TUNIT_OPM: cond.false: -; IS__TUNIT_OPM-NEXT: br label [[COND_END]] -; IS__TUNIT_OPM: cond.end: -; IS__TUNIT_OPM-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR9]] -; IS__TUNIT_OPM-NEXT: ret i32 5 -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1 -; IS__TUNIT_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR7]] -; IS__TUNIT_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] -; IS__TUNIT_NPM: cond.true: -; IS__TUNIT_NPM-NEXT: br label [[COND_END:%.*]] -; IS__TUNIT_NPM: cond.false: -; IS__TUNIT_NPM-NEXT: br label [[COND_END]] -; IS__TUNIT_NPM: cond.end: -; IS__TUNIT_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR7]] -; IS__TUNIT_NPM-NEXT: ret i32 5 -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1 -; IS__CGSCC_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[L:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]] -; IS__CGSCC_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] -; IS__CGSCC_OPM: cond.true: -; IS__CGSCC_OPM-NEXT: br label [[COND_END:%.*]] -; IS__CGSCC_OPM: cond.false: -; IS__CGSCC_OPM-NEXT: br label [[COND_END]] -; IS__CGSCC_OPM: cond.end: -; IS__CGSCC_OPM-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR11]] -; IS__CGSCC_OPM-NEXT: ret i32 5 -; -; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1 -; IS__CGSCC_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[L:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]] -; IS__CGSCC_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] -; IS__CGSCC_NPM: cond.true: -; IS__CGSCC_NPM-NEXT: br label [[COND_END:%.*]] -; IS__CGSCC_NPM: cond.false: -; IS__CGSCC_NPM-NEXT: br label [[COND_END]] -; IS__CGSCC_NPM: cond.end: -; IS__CGSCC_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR9]] -; IS__CGSCC_NPM-NEXT: ret i32 5 +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1 +; NOT_CGSCC_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] +; NOT_CGSCC_NPM: cond.true: +; NOT_CGSCC_NPM-NEXT: br label [[COND_END:%.*]] +; NOT_CGSCC_NPM: cond.false: +; NOT_CGSCC_NPM-NEXT: br label [[COND_END]] +; NOT_CGSCC_NPM: cond.end: +; NOT_CGSCC_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: ret i32 5 +; +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1 +; NOT_TUNIT_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]] +; NOT_TUNIT_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] +; NOT_TUNIT_NPM: cond.true: +; NOT_TUNIT_NPM-NEXT: br label [[COND_END:%.*]] +; NOT_TUNIT_NPM: cond.false: +; NOT_TUNIT_NPM-NEXT: br label [[COND_END]] +; NOT_TUNIT_NPM: cond.end: +; NOT_TUNIT_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR9]] +; NOT_TUNIT_NPM-NEXT: ret i32 5 ; entry: %L = alloca i32, align 4 @@ -923,77 +654,42 @@ ; } ; define i32 @multi_obj_simplifiable_2(i32 %cnd) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2 -; IS__TUNIT_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR4]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[L:%.*]] = alloca i32, align 4 -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]] -; IS__TUNIT_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] -; IS__TUNIT_OPM: cond.true: -; IS__TUNIT_OPM-NEXT: br label [[COND_END:%.*]] -; IS__TUNIT_OPM: cond.false: -; IS__TUNIT_OPM-NEXT: br label [[COND_END]] -; IS__TUNIT_OPM: cond.end: -; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR9]] -; IS__TUNIT_OPM-NEXT: ret i32 5 -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2 -; IS__TUNIT_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR7]] -; IS__TUNIT_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] -; IS__TUNIT_NPM: cond.true: -; IS__TUNIT_NPM-NEXT: br label [[COND_END:%.*]] -; IS__TUNIT_NPM: cond.false: -; IS__TUNIT_NPM-NEXT: br label [[COND_END]] -; IS__TUNIT_NPM: cond.end: -; IS__TUNIT_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR7]] -; IS__TUNIT_NPM-NEXT: ret i32 5 -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2 -; IS__CGSCC_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR3]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[L:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]] -; IS__CGSCC_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] -; IS__CGSCC_OPM: cond.true: -; IS__CGSCC_OPM-NEXT: br label [[COND_END:%.*]] -; IS__CGSCC_OPM: cond.false: -; IS__CGSCC_OPM-NEXT: br label [[COND_END]] -; IS__CGSCC_OPM: cond.end: -; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR11]] -; IS__CGSCC_OPM-NEXT: ret i32 5 -; -; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2 -; IS__CGSCC_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR3]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[L:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]] -; IS__CGSCC_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] -; IS__CGSCC_NPM: cond.true: -; IS__CGSCC_NPM-NEXT: br label [[COND_END:%.*]] -; IS__CGSCC_NPM: cond.false: -; IS__CGSCC_NPM-NEXT: br label [[COND_END]] -; IS__CGSCC_NPM: cond.end: -; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR9]] -; IS__CGSCC_NPM-NEXT: ret i32 5 +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2 +; NOT_CGSCC_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] +; NOT_CGSCC_NPM: cond.true: +; NOT_CGSCC_NPM-NEXT: br label [[COND_END:%.*]] +; NOT_CGSCC_NPM: cond.false: +; NOT_CGSCC_NPM-NEXT: br label [[COND_END]] +; NOT_CGSCC_NPM: cond.end: +; NOT_CGSCC_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: ret i32 5 +; +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2 +; NOT_TUNIT_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]] +; NOT_TUNIT_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] +; NOT_TUNIT_NPM: cond.true: +; NOT_TUNIT_NPM-NEXT: br label [[COND_END:%.*]] +; NOT_TUNIT_NPM: cond.false: +; NOT_TUNIT_NPM-NEXT: br label [[COND_END]] +; NOT_TUNIT_NPM: cond.end: +; NOT_TUNIT_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR9]] +; NOT_TUNIT_NPM-NEXT: ret i32 5 ; entry: %L = alloca i32, align 4 @@ -1036,105 +732,56 @@ ; } ; define void @static_global_simplifiable_1(%struct.S* noalias sret(%struct.S) align 4 %agg.result) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1 -; IS__TUNIT_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR5]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR5]] -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR5]] -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR5]] -; IS__TUNIT_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 -; IS__TUNIT_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] -; IS__TUNIT_OPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 -; IS__TUNIT_OPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 -; IS__TUNIT_OPM-NEXT: store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]] -; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 -; IS__TUNIT_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 -; IS__TUNIT_OPM-NEXT: store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]] -; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 -; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]] -; IS__TUNIT_OPM-NEXT: [[MUL1:%.*]] = shl nsw i32 2, 1 -; IS__TUNIT_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 -; IS__TUNIT_OPM-NEXT: store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]] -; IS__TUNIT_OPM-NEXT: [[ADD2:%.*]] = add nsw i32 3, 1 -; IS__TUNIT_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 -; IS__TUNIT_OPM-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1 -; IS__TUNIT_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR4]] -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR4]] -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR4]] -; IS__TUNIT_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 -; IS__TUNIT_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] -; IS__TUNIT_NPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 -; IS__TUNIT_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 -; IS__TUNIT_NPM-NEXT: store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]] -; IS__TUNIT_NPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 -; IS__TUNIT_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 -; IS__TUNIT_NPM-NEXT: store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]] -; IS__TUNIT_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 -; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]] -; IS__TUNIT_NPM-NEXT: [[MUL1:%.*]] = shl nsw i32 2, 1 -; IS__TUNIT_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 -; IS__TUNIT_NPM-NEXT: store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]] -; IS__TUNIT_NPM-NEXT: [[ADD2:%.*]] = add nsw i32 3, 1 -; IS__TUNIT_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 -; IS__TUNIT_NPM-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1 -; IS__CGSCC_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR12]] -; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR12]] -; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR12]] -; IS__CGSCC_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 -; IS__CGSCC_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] -; IS__CGSCC_OPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 -; IS__CGSCC_OPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 -; IS__CGSCC_OPM-NEXT: store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]] -; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 -; IS__CGSCC_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 -; IS__CGSCC_OPM-NEXT: store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]] -; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]] -; IS__CGSCC_OPM-NEXT: [[MUL1:%.*]] = shl nsw i32 2, 1 -; IS__CGSCC_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 -; IS__CGSCC_OPM-NEXT: store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]] -; IS__CGSCC_OPM-NEXT: [[ADD2:%.*]] = add nsw i32 3, 1 -; IS__CGSCC_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 -; IS__CGSCC_OPM-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1 -; IS__CGSCC_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR10]] -; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR10]] -; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR10]] -; IS__CGSCC_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 -; IS__CGSCC_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] -; IS__CGSCC_NPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 -; IS__CGSCC_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 -; IS__CGSCC_NPM-NEXT: store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]] -; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 -; IS__CGSCC_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 -; IS__CGSCC_NPM-NEXT: store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]] -; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 -; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]] -; IS__CGSCC_NPM-NEXT: [[MUL1:%.*]] = shl nsw i32 2, 1 -; IS__CGSCC_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 -; IS__CGSCC_NPM-NEXT: store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]] -; IS__CGSCC_NPM-NEXT: [[ADD2:%.*]] = add nsw i32 3, 1 -; IS__CGSCC_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 -; IS__CGSCC_NPM-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]] -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1 +; NOT_CGSCC_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; NOT_CGSCC_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] +; NOT_CGSCC_NPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 +; NOT_CGSCC_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; NOT_CGSCC_NPM-NEXT: store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]] +; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 +; NOT_CGSCC_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; NOT_CGSCC_NPM-NEXT: store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]] +; NOT_CGSCC_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]] +; NOT_CGSCC_NPM-NEXT: [[MUL1:%.*]] = shl nsw i32 2, 1 +; NOT_CGSCC_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; NOT_CGSCC_NPM-NEXT: store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]] +; NOT_CGSCC_NPM-NEXT: [[ADD2:%.*]] = add nsw i32 3, 1 +; NOT_CGSCC_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; NOT_CGSCC_NPM-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1 +; NOT_TUNIT_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR10]] +; NOT_TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR10]] +; NOT_TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR10]] +; NOT_TUNIT_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; NOT_TUNIT_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] +; NOT_TUNIT_NPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 +; NOT_TUNIT_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; NOT_TUNIT_NPM-NEXT: store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]] +; NOT_TUNIT_NPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 +; NOT_TUNIT_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; NOT_TUNIT_NPM-NEXT: store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]] +; NOT_TUNIT_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]] +; NOT_TUNIT_NPM-NEXT: [[MUL1:%.*]] = shl nsw i32 2, 1 +; NOT_TUNIT_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; NOT_TUNIT_NPM-NEXT: store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]] +; NOT_TUNIT_NPM-NEXT: [[ADD2:%.*]] = add nsw i32 3, 1 +; NOT_TUNIT_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; NOT_TUNIT_NPM-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]] +; NOT_TUNIT_NPM-NEXT: ret void ; entry: store float 0x3FF19999A0000000, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 3), align 4, !tbaa !7 @@ -1186,289 +833,148 @@ ; } ; define void @static_global_simplifiable_2() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2 -; IS__TUNIT_OPM-SAME: () #[[ATTR6]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_OPM: for.cond: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 -; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_INC]] -; IS__TUNIT_OPM: for.inc: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]] -; IS__TUNIT_OPM: for.end: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND2:%.*]] -; IS__TUNIT_OPM: for.cond2: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] -; IS__TUNIT_OPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 -; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup4: -; IS__TUNIT_OPM-NEXT: br label [[FOR_END11:%.*]] -; IS__TUNIT_OPM: for.body5: -; IS__TUNIT_OPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 -; IS__TUNIT_OPM-NEXT: [[I16:%.*]] = or i64 [[I15]], 1 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_INC9]] -; IS__TUNIT_OPM: for.inc9: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP22:![0-9]+]] -; IS__TUNIT_OPM: for.end11: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND13:%.*]] -; IS__TUNIT_OPM: for.cond13: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] -; IS__TUNIT_OPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 -; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup15: -; IS__TUNIT_OPM-NEXT: br label [[FOR_END23:%.*]] -; IS__TUNIT_OPM: for.body16: -; IS__TUNIT_OPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 -; IS__TUNIT_OPM-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_INC21]] -; IS__TUNIT_OPM: for.inc21: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP23:![0-9]+]] -; IS__TUNIT_OPM: for.end23: -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(524) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR6]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND25:%.*]] -; IS__TUNIT_OPM: for.cond25: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ] -; IS__TUNIT_OPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 -; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup27: -; IS__TUNIT_OPM-NEXT: br label [[FOR_END35:%.*]] -; IS__TUNIT_OPM: for.body28: -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__TUNIT_OPM-NEXT: store i8 0, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_INC33]] -; IS__TUNIT_OPM: for.inc33: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND25]], !llvm.loop [[LOOP24:![0-9]+]] -; IS__TUNIT_OPM: for.end35: -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2 -; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_NPM: for.cond: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 -; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_INC]] -; IS__TUNIT_NPM: for.inc: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]] -; IS__TUNIT_NPM: for.end: -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND2:%.*]] -; IS__TUNIT_NPM: for.cond2: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] -; IS__TUNIT_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 -; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup4: -; IS__TUNIT_NPM-NEXT: br label [[FOR_END11:%.*]] -; IS__TUNIT_NPM: for.body5: -; IS__TUNIT_NPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 -; IS__TUNIT_NPM-NEXT: [[I16:%.*]] = or i64 [[I15]], 1 -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_INC9]] -; IS__TUNIT_NPM: for.inc9: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP22:![0-9]+]] -; IS__TUNIT_NPM: for.end11: -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND13:%.*]] -; IS__TUNIT_NPM: for.cond13: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] -; IS__TUNIT_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 -; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup15: -; IS__TUNIT_NPM-NEXT: br label [[FOR_END23:%.*]] -; IS__TUNIT_NPM: for.body16: -; IS__TUNIT_NPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 -; IS__TUNIT_NPM-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2 -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_INC21]] -; IS__TUNIT_NPM: for.inc21: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP23:![0-9]+]] -; IS__TUNIT_NPM: for.end23: -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(524) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR4]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND25:%.*]] -; IS__TUNIT_NPM: for.cond25: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ] -; IS__TUNIT_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 -; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup27: -; IS__TUNIT_NPM-NEXT: br label [[FOR_END35:%.*]] -; IS__TUNIT_NPM: for.body28: -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__TUNIT_NPM-NEXT: store i8 0, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_INC33]] -; IS__TUNIT_NPM: for.inc33: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND25]], !llvm.loop [[LOOP24:![0-9]+]] -; IS__TUNIT_NPM: for.end35: -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2() { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_OPM: for.cond: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 -; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]] -; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_INC]] -; IS__CGSCC_OPM: for.inc: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]] -; IS__CGSCC_OPM: for.end: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2:%.*]] -; IS__CGSCC_OPM: for.cond2: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] -; IS__CGSCC_OPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 -; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup4: -; IS__CGSCC_OPM-NEXT: br label [[FOR_END11:%.*]] -; IS__CGSCC_OPM: for.body5: -; IS__CGSCC_OPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 -; IS__CGSCC_OPM-NEXT: [[I16:%.*]] = or i64 [[I15]], 1 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]] -; IS__CGSCC_OPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_INC9]] -; IS__CGSCC_OPM: for.inc9: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP25:![0-9]+]] -; IS__CGSCC_OPM: for.end11: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13:%.*]] -; IS__CGSCC_OPM: for.cond13: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] -; IS__CGSCC_OPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 -; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup15: -; IS__CGSCC_OPM-NEXT: br label [[FOR_END23:%.*]] -; IS__CGSCC_OPM: for.body16: -; IS__CGSCC_OPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 -; IS__CGSCC_OPM-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]] -; IS__CGSCC_OPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 16, !tbaa [[TBAA20]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_INC21]] -; IS__CGSCC_OPM: for.inc21: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP26:![0-9]+]] -; IS__CGSCC_OPM: for.end23: -; IS__CGSCC_OPM-NEXT: store i8 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 1023), align 1, !tbaa [[TBAA15]] -; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR13]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND25:%.*]] -; IS__CGSCC_OPM: for.cond25: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ] -; IS__CGSCC_OPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 -; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup27: -; IS__CGSCC_OPM-NEXT: br label [[FOR_END35:%.*]] -; IS__CGSCC_OPM: for.body28: -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX30:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC_OPM-NEXT: [[I19:%.*]] = load i8, i8* [[ARRAYIDX30]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC_OPM-NEXT: store i8 [[I19]], i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_INC33]] -; IS__CGSCC_OPM: for.inc33: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND25]], !llvm.loop [[LOOP27:![0-9]+]] -; IS__CGSCC_OPM: for.end35: -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2() { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_NPM: for.cond: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 -; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]] -; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_INC]] -; IS__CGSCC_NPM: for.inc: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]] -; IS__CGSCC_NPM: for.end: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2:%.*]] -; IS__CGSCC_NPM: for.cond2: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] -; IS__CGSCC_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 -; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup4: -; IS__CGSCC_NPM-NEXT: br label [[FOR_END11:%.*]] -; IS__CGSCC_NPM: for.body5: -; IS__CGSCC_NPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 -; IS__CGSCC_NPM-NEXT: [[I16:%.*]] = or i64 [[I15]], 1 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]] -; IS__CGSCC_NPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_INC9]] -; IS__CGSCC_NPM: for.inc9: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP25:![0-9]+]] -; IS__CGSCC_NPM: for.end11: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13:%.*]] -; IS__CGSCC_NPM: for.cond13: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] -; IS__CGSCC_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 -; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup15: -; IS__CGSCC_NPM-NEXT: br label [[FOR_END23:%.*]] -; IS__CGSCC_NPM: for.body16: -; IS__CGSCC_NPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 -; IS__CGSCC_NPM-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]] -; IS__CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 16, !tbaa [[TBAA20]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_INC21]] -; IS__CGSCC_NPM: for.inc21: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP26:![0-9]+]] -; IS__CGSCC_NPM: for.end23: -; IS__CGSCC_NPM-NEXT: store i8 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 1023), align 1, !tbaa [[TBAA15]] -; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR11]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND25:%.*]] -; IS__CGSCC_NPM: for.cond25: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ] -; IS__CGSCC_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 -; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup27: -; IS__CGSCC_NPM-NEXT: br label [[FOR_END35:%.*]] -; IS__CGSCC_NPM: for.body28: -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX30:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC_NPM-NEXT: [[I19:%.*]] = load i8, i8* [[ARRAYIDX30]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC_NPM-NEXT: store i8 [[I19]], i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_INC33]] -; IS__CGSCC_NPM: for.inc33: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND25]], !llvm.loop [[LOOP27:![0-9]+]] -; IS__CGSCC_NPM: for.end35: -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] +; NOT_CGSCC_NPM: for.cond: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 +; NOT_CGSCC_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_END:%.*]] +; NOT_CGSCC_NPM: for.body: +; NOT_CGSCC_NPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_INC]] +; NOT_CGSCC_NPM: for.inc: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]] +; NOT_CGSCC_NPM: for.end: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND2:%.*]] +; NOT_CGSCC_NPM: for.cond2: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] +; NOT_CGSCC_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 +; NOT_CGSCC_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup4: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_END11:%.*]] +; NOT_CGSCC_NPM: for.body5: +; NOT_CGSCC_NPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 +; NOT_CGSCC_NPM-NEXT: [[I16:%.*]] = or i64 [[I15]], 1 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_INC9]] +; NOT_CGSCC_NPM: for.inc9: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP22:![0-9]+]] +; NOT_CGSCC_NPM: for.end11: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND13:%.*]] +; NOT_CGSCC_NPM: for.cond13: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] +; NOT_CGSCC_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 +; NOT_CGSCC_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup15: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_END23:%.*]] +; NOT_CGSCC_NPM: for.body16: +; NOT_CGSCC_NPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 +; NOT_CGSCC_NPM-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_INC21]] +; NOT_CGSCC_NPM: for.inc21: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP23:![0-9]+]] +; NOT_CGSCC_NPM: for.end23: +; NOT_CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(524) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND25:%.*]] +; NOT_CGSCC_NPM: for.cond25: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ] +; NOT_CGSCC_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 +; NOT_CGSCC_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup27: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_END35:%.*]] +; NOT_CGSCC_NPM: for.body28: +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] +; NOT_CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_INC33]] +; NOT_CGSCC_NPM: for.inc33: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND25]], !llvm.loop [[LOOP24:![0-9]+]] +; NOT_CGSCC_NPM: for.end35: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2() { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] +; NOT_TUNIT_NPM: for.cond: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 +; NOT_TUNIT_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_END:%.*]] +; NOT_TUNIT_NPM: for.body: +; NOT_TUNIT_NPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]] +; NOT_TUNIT_NPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_INC]] +; NOT_TUNIT_NPM: for.inc: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]] +; NOT_TUNIT_NPM: for.end: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND2:%.*]] +; NOT_TUNIT_NPM: for.cond2: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] +; NOT_TUNIT_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 +; NOT_TUNIT_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup4: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_END11:%.*]] +; NOT_TUNIT_NPM: for.body5: +; NOT_TUNIT_NPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 +; NOT_TUNIT_NPM-NEXT: [[I16:%.*]] = or i64 [[I15]], 1 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]] +; NOT_TUNIT_NPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_INC9]] +; NOT_TUNIT_NPM: for.inc9: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP25:![0-9]+]] +; NOT_TUNIT_NPM: for.end11: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND13:%.*]] +; NOT_TUNIT_NPM: for.cond13: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] +; NOT_TUNIT_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 +; NOT_TUNIT_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup15: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_END23:%.*]] +; NOT_TUNIT_NPM: for.body16: +; NOT_TUNIT_NPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 +; NOT_TUNIT_NPM-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]] +; NOT_TUNIT_NPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 16, !tbaa [[TBAA20]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_INC21]] +; NOT_TUNIT_NPM: for.inc21: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP26:![0-9]+]] +; NOT_TUNIT_NPM: for.end23: +; NOT_TUNIT_NPM-NEXT: store i8 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 1023), align 1, !tbaa [[TBAA15]] +; NOT_TUNIT_NPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR11]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND25:%.*]] +; NOT_TUNIT_NPM: for.cond25: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ] +; NOT_TUNIT_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 +; NOT_TUNIT_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup27: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_END35:%.*]] +; NOT_TUNIT_NPM: for.body28: +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX30:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[INDVARS_IV12]] +; NOT_TUNIT_NPM-NEXT: [[I19:%.*]] = load i8, i8* [[ARRAYIDX30]], align 1, !tbaa [[TBAA15]] +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] +; NOT_TUNIT_NPM-NEXT: store i8 [[I19]], i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_INC33]] +; NOT_TUNIT_NPM: for.inc33: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND25]], !llvm.loop [[LOOP27:![0-9]+]] +; NOT_TUNIT_NPM: for.end35: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: br label %for.cond @@ -1569,26 +1075,20 @@ ; return Flag3; ; } define i32 @static_global_simplifiable_3() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_3 -; IS__TUNIT_OPM-SAME: () #[[ATTR4]] { -; IS__TUNIT_OPM-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]] -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]] -; IS__TUNIT_OPM-NEXT: ret i32 [[I]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_3 -; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]] -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]] -; IS__TUNIT_NPM-NEXT: ret i32 [[I]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@static_global_simplifiable_3 -; IS__CGSCC____-SAME: () #[[ATTR5:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]] -; IS__CGSCC____-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]] -; IS__CGSCC____-NEXT: ret i32 [[I]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_3 +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]] +; NOT_CGSCC_NPM-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[I]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR5:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]] +; NOT_TUNIT_NPM-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[I]] ; store i32 1, i32* @Flag3, align 4, !tbaa !3 %i = load i32, i32* @Flag3, align 4, !tbaa !3 @@ -1613,205 +1113,106 @@ ; } ; define void @noalias_arg_simplifiable_1(%struct.S* noalias sret(%struct.S) align 4 %agg.result, %struct.S* byval(%struct.S) align 8 %s) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1 -; IS__TUNIT_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__TUNIT_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] -; IS__TUNIT_OPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 -; IS__TUNIT_OPM-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]] -; IS__TUNIT_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 -; IS__TUNIT_OPM-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]] -; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR5]] -; IS__TUNIT_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR5]] -; IS__TUNIT_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR5]] -; IS__TUNIT_OPM-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]] -; IS__TUNIT_OPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 -; IS__TUNIT_OPM-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]] -; IS__TUNIT_OPM-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 -; IS__TUNIT_OPM-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]] -; IS__TUNIT_OPM-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00 -; IS__TUNIT_OPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 -; IS__TUNIT_OPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]] -; IS__TUNIT_OPM-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 -; IS__TUNIT_OPM-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]] -; IS__TUNIT_OPM-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__TUNIT_OPM-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]] -; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]] -; IS__TUNIT_OPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 -; IS__TUNIT_OPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]] -; IS__TUNIT_OPM-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__TUNIT_OPM-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]] -; IS__TUNIT_OPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 -; IS__TUNIT_OPM-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]] -; IS__TUNIT_OPM-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__TUNIT_OPM-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]] -; IS__TUNIT_OPM-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1 -; IS__TUNIT_OPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 -; IS__TUNIT_OPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]] -; IS__TUNIT_OPM-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__TUNIT_OPM-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]] -; IS__TUNIT_OPM-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__TUNIT_OPM-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]] -; IS__TUNIT_OPM-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]] -; IS__TUNIT_OPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 -; IS__TUNIT_OPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1 -; IS__TUNIT_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR1]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__TUNIT_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] -; IS__TUNIT_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 -; IS__TUNIT_NPM-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]] -; IS__TUNIT_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 -; IS__TUNIT_NPM-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]] -; IS__TUNIT_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR4]] -; IS__TUNIT_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR4]] -; IS__TUNIT_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR4]] -; IS__TUNIT_NPM-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]] -; IS__TUNIT_NPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 -; IS__TUNIT_NPM-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]] -; IS__TUNIT_NPM-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 -; IS__TUNIT_NPM-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]] -; IS__TUNIT_NPM-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00 -; IS__TUNIT_NPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 -; IS__TUNIT_NPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]] -; IS__TUNIT_NPM-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 -; IS__TUNIT_NPM-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]] -; IS__TUNIT_NPM-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__TUNIT_NPM-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]] -; IS__TUNIT_NPM-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]] -; IS__TUNIT_NPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 -; IS__TUNIT_NPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]] -; IS__TUNIT_NPM-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__TUNIT_NPM-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]] -; IS__TUNIT_NPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 -; IS__TUNIT_NPM-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]] -; IS__TUNIT_NPM-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]] -; IS__TUNIT_NPM-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1 -; IS__TUNIT_NPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 -; IS__TUNIT_NPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]] -; IS__TUNIT_NPM-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__TUNIT_NPM-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]] -; IS__TUNIT_NPM-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__TUNIT_NPM-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]] -; IS__TUNIT_NPM-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]] -; IS__TUNIT_NPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 -; IS__TUNIT_NPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1 -; IS__CGSCC_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__CGSCC_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] -; IS__CGSCC_OPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 -; IS__CGSCC_OPM-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]] -; IS__CGSCC_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 -; IS__CGSCC_OPM-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]] -; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR12]] -; IS__CGSCC_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR12]] -; IS__CGSCC_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR12]] -; IS__CGSCC_OPM-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__CGSCC_OPM-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]] -; IS__CGSCC_OPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 -; IS__CGSCC_OPM-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]] -; IS__CGSCC_OPM-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 -; IS__CGSCC_OPM-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]] -; IS__CGSCC_OPM-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00 -; IS__CGSCC_OPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 -; IS__CGSCC_OPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]] -; IS__CGSCC_OPM-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 -; IS__CGSCC_OPM-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]] -; IS__CGSCC_OPM-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__CGSCC_OPM-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]] -; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]] -; IS__CGSCC_OPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 -; IS__CGSCC_OPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]] -; IS__CGSCC_OPM-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__CGSCC_OPM-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]] -; IS__CGSCC_OPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 -; IS__CGSCC_OPM-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]] -; IS__CGSCC_OPM-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__CGSCC_OPM-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]] -; IS__CGSCC_OPM-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1 -; IS__CGSCC_OPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 -; IS__CGSCC_OPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]] -; IS__CGSCC_OPM-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__CGSCC_OPM-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]] -; IS__CGSCC_OPM-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__CGSCC_OPM-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]] -; IS__CGSCC_OPM-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]] -; IS__CGSCC_OPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 -; IS__CGSCC_OPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1 -; IS__CGSCC_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__CGSCC_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] -; IS__CGSCC_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 -; IS__CGSCC_NPM-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]] -; IS__CGSCC_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 -; IS__CGSCC_NPM-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]] -; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR10]] -; IS__CGSCC_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR10]] -; IS__CGSCC_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR10]] -; IS__CGSCC_NPM-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__CGSCC_NPM-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]] -; IS__CGSCC_NPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 -; IS__CGSCC_NPM-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]] -; IS__CGSCC_NPM-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 -; IS__CGSCC_NPM-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]] -; IS__CGSCC_NPM-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00 -; IS__CGSCC_NPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 -; IS__CGSCC_NPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]] -; IS__CGSCC_NPM-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 -; IS__CGSCC_NPM-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]] -; IS__CGSCC_NPM-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__CGSCC_NPM-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]] -; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]] -; IS__CGSCC_NPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 -; IS__CGSCC_NPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]] -; IS__CGSCC_NPM-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__CGSCC_NPM-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]] -; IS__CGSCC_NPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 -; IS__CGSCC_NPM-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]] -; IS__CGSCC_NPM-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__CGSCC_NPM-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]] -; IS__CGSCC_NPM-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1 -; IS__CGSCC_NPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 -; IS__CGSCC_NPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]] -; IS__CGSCC_NPM-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__CGSCC_NPM-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]] -; IS__CGSCC_NPM-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__CGSCC_NPM-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]] -; IS__CGSCC_NPM-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]] -; IS__CGSCC_NPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 -; IS__CGSCC_NPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]] -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1 +; NOT_CGSCC_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; NOT_CGSCC_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] +; NOT_CGSCC_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; NOT_CGSCC_NPM-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]] +; NOT_CGSCC_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; NOT_CGSCC_NPM-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]] +; NOT_CGSCC_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; NOT_CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; NOT_CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; NOT_CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; NOT_CGSCC_NPM-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]] +; NOT_CGSCC_NPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; NOT_CGSCC_NPM-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]] +; NOT_CGSCC_NPM-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; NOT_CGSCC_NPM-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]] +; NOT_CGSCC_NPM-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00 +; NOT_CGSCC_NPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; NOT_CGSCC_NPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]] +; NOT_CGSCC_NPM-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; NOT_CGSCC_NPM-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]] +; NOT_CGSCC_NPM-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; NOT_CGSCC_NPM-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]] +; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]] +; NOT_CGSCC_NPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; NOT_CGSCC_NPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]] +; NOT_CGSCC_NPM-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; NOT_CGSCC_NPM-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]] +; NOT_CGSCC_NPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; NOT_CGSCC_NPM-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]] +; NOT_CGSCC_NPM-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; NOT_CGSCC_NPM-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]] +; NOT_CGSCC_NPM-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1 +; NOT_CGSCC_NPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; NOT_CGSCC_NPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]] +; NOT_CGSCC_NPM-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; NOT_CGSCC_NPM-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]] +; NOT_CGSCC_NPM-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; NOT_CGSCC_NPM-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]] +; NOT_CGSCC_NPM-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]] +; NOT_CGSCC_NPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; NOT_CGSCC_NPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1 +; NOT_TUNIT_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR6:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; NOT_TUNIT_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] +; NOT_TUNIT_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; NOT_TUNIT_NPM-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]] +; NOT_TUNIT_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; NOT_TUNIT_NPM-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]] +; NOT_TUNIT_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; NOT_TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR10]] +; NOT_TUNIT_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; NOT_TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR10]] +; NOT_TUNIT_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; NOT_TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR10]] +; NOT_TUNIT_NPM-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; NOT_TUNIT_NPM-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]] +; NOT_TUNIT_NPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; NOT_TUNIT_NPM-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]] +; NOT_TUNIT_NPM-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; NOT_TUNIT_NPM-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]] +; NOT_TUNIT_NPM-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00 +; NOT_TUNIT_NPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; NOT_TUNIT_NPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]] +; NOT_TUNIT_NPM-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; NOT_TUNIT_NPM-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]] +; NOT_TUNIT_NPM-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; NOT_TUNIT_NPM-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]] +; NOT_TUNIT_NPM-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]] +; NOT_TUNIT_NPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; NOT_TUNIT_NPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]] +; NOT_TUNIT_NPM-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; NOT_TUNIT_NPM-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]] +; NOT_TUNIT_NPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; NOT_TUNIT_NPM-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]] +; NOT_TUNIT_NPM-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; NOT_TUNIT_NPM-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]] +; NOT_TUNIT_NPM-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1 +; NOT_TUNIT_NPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; NOT_TUNIT_NPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]] +; NOT_TUNIT_NPM-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; NOT_TUNIT_NPM-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]] +; NOT_TUNIT_NPM-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; NOT_TUNIT_NPM-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]] +; NOT_TUNIT_NPM-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]] +; NOT_TUNIT_NPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; NOT_TUNIT_NPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]] +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %f1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3 @@ -1876,323 +1277,165 @@ ; } ; define void @noalias_arg_simplifiable_2(i8* %Bytes) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2 -; IS__TUNIT_OPM-SAME: (i8* nocapture nofree [[BYTES:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_OPM: for.cond: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 -; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]] -; IS__TUNIT_OPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA19]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_INC]] -; IS__TUNIT_OPM: for.inc: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]] -; IS__TUNIT_OPM: for.end: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND2:%.*]] -; IS__TUNIT_OPM: for.cond2: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] -; IS__TUNIT_OPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 -; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup4: -; IS__TUNIT_OPM-NEXT: br label [[FOR_END11:%.*]] -; IS__TUNIT_OPM: for.body5: -; IS__TUNIT_OPM-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float* -; IS__TUNIT_OPM-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 -; IS__TUNIT_OPM-NEXT: [[I17:%.*]] = or i64 [[I16]], 1 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]] -; IS__TUNIT_OPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA26:![0-9]+]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_INC9]] -; IS__TUNIT_OPM: for.inc9: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP27:![0-9]+]] -; IS__TUNIT_OPM: for.end11: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND13:%.*]] -; IS__TUNIT_OPM: for.cond13: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] -; IS__TUNIT_OPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 -; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup15: -; IS__TUNIT_OPM-NEXT: br label [[FOR_END23:%.*]] -; IS__TUNIT_OPM: for.body16: -; IS__TUNIT_OPM-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64* -; IS__TUNIT_OPM-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 -; IS__TUNIT_OPM-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]] -; IS__TUNIT_OPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA28:![0-9]+]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_INC21]] -; IS__TUNIT_OPM: for.inc21: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]] -; IS__TUNIT_OPM: for.end23: -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023 -; IS__TUNIT_OPM-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA19]] -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500 -; IS__TUNIT_OPM-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32* -; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 [[I21]], i32 noundef 0) #[[ATTR6]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND27:%.*]] -; IS__TUNIT_OPM: for.cond27: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ] -; IS__TUNIT_OPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 -; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup29: -; IS__TUNIT_OPM-NEXT: br label [[FOR_END37:%.*]] -; IS__TUNIT_OPM: for.body30: -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]] -; IS__TUNIT_OPM-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]] -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__TUNIT_OPM-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA19]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_INC35]] -; IS__TUNIT_OPM: for.inc35: -; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]] -; IS__TUNIT_OPM: for.end37: -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2 -; IS__TUNIT_NPM-SAME: (i8* nocapture nofree [[BYTES:%.*]]) #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_NPM: for.cond: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 -; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]] -; IS__TUNIT_NPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA19]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_INC]] -; IS__TUNIT_NPM: for.inc: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]] -; IS__TUNIT_NPM: for.end: -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND2:%.*]] -; IS__TUNIT_NPM: for.cond2: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] -; IS__TUNIT_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 -; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup4: -; IS__TUNIT_NPM-NEXT: br label [[FOR_END11:%.*]] -; IS__TUNIT_NPM: for.body5: -; IS__TUNIT_NPM-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float* -; IS__TUNIT_NPM-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 -; IS__TUNIT_NPM-NEXT: [[I17:%.*]] = or i64 [[I16]], 1 -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]] -; IS__TUNIT_NPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA26:![0-9]+]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_INC9]] -; IS__TUNIT_NPM: for.inc9: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP27:![0-9]+]] -; IS__TUNIT_NPM: for.end11: -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND13:%.*]] -; IS__TUNIT_NPM: for.cond13: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] -; IS__TUNIT_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 -; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup15: -; IS__TUNIT_NPM-NEXT: br label [[FOR_END23:%.*]] -; IS__TUNIT_NPM: for.body16: -; IS__TUNIT_NPM-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64* -; IS__TUNIT_NPM-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 -; IS__TUNIT_NPM-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2 -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]] -; IS__TUNIT_NPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA28:![0-9]+]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_INC21]] -; IS__TUNIT_NPM: for.inc21: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]] -; IS__TUNIT_NPM: for.end23: -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023 -; IS__TUNIT_NPM-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA19]] -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500 -; IS__TUNIT_NPM-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32* -; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 [[I21]], i32 noundef 0) #[[ATTR4]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND27:%.*]] -; IS__TUNIT_NPM: for.cond27: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ] -; IS__TUNIT_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 -; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup29: -; IS__TUNIT_NPM-NEXT: br label [[FOR_END37:%.*]] -; IS__TUNIT_NPM: for.body30: -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]] -; IS__TUNIT_NPM-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]] -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__TUNIT_NPM-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA19]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_INC35]] -; IS__TUNIT_NPM: for.inc35: -; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]] -; IS__TUNIT_NPM: for.end37: -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2 -; IS__CGSCC_OPM-SAME: (i8* [[BYTES:%.*]]) { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_OPM: for.cond: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 -; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]] -; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_INC]] -; IS__CGSCC_OPM: for.inc: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP28:![0-9]+]] -; IS__CGSCC_OPM: for.end: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2:%.*]] -; IS__CGSCC_OPM: for.cond2: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] -; IS__CGSCC_OPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 -; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup4: -; IS__CGSCC_OPM-NEXT: br label [[FOR_END11:%.*]] -; IS__CGSCC_OPM: for.body5: -; IS__CGSCC_OPM-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float* -; IS__CGSCC_OPM-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 -; IS__CGSCC_OPM-NEXT: [[I17:%.*]] = or i64 [[I16]], 1 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]] -; IS__CGSCC_OPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_INC9]] -; IS__CGSCC_OPM: for.inc9: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP29:![0-9]+]] -; IS__CGSCC_OPM: for.end11: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13:%.*]] -; IS__CGSCC_OPM: for.cond13: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] -; IS__CGSCC_OPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 -; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup15: -; IS__CGSCC_OPM-NEXT: br label [[FOR_END23:%.*]] -; IS__CGSCC_OPM: for.body16: -; IS__CGSCC_OPM-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64* -; IS__CGSCC_OPM-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 -; IS__CGSCC_OPM-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]] -; IS__CGSCC_OPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA20]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_INC21]] -; IS__CGSCC_OPM: for.inc21: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]] -; IS__CGSCC_OPM: for.end23: -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023 -; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500 -; IS__CGSCC_OPM-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32* -; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I21]], i32 noundef 0) #[[ATTR13]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND27:%.*]] -; IS__CGSCC_OPM: for.cond27: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ] -; IS__CGSCC_OPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 -; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup29: -; IS__CGSCC_OPM-NEXT: br label [[FOR_END37:%.*]] -; IS__CGSCC_OPM: for.body30: -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]] -; IS__CGSCC_OPM-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC_OPM-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_INC35]] -; IS__CGSCC_OPM: for.inc35: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]] -; IS__CGSCC_OPM: for.end37: -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2 -; IS__CGSCC_NPM-SAME: (i8* [[BYTES:%.*]]) { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_NPM: for.cond: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 -; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]] -; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_INC]] -; IS__CGSCC_NPM: for.inc: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP28:![0-9]+]] -; IS__CGSCC_NPM: for.end: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2:%.*]] -; IS__CGSCC_NPM: for.cond2: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] -; IS__CGSCC_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 -; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup4: -; IS__CGSCC_NPM-NEXT: br label [[FOR_END11:%.*]] -; IS__CGSCC_NPM: for.body5: -; IS__CGSCC_NPM-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float* -; IS__CGSCC_NPM-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 -; IS__CGSCC_NPM-NEXT: [[I17:%.*]] = or i64 [[I16]], 1 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]] -; IS__CGSCC_NPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_INC9]] -; IS__CGSCC_NPM: for.inc9: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP29:![0-9]+]] -; IS__CGSCC_NPM: for.end11: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13:%.*]] -; IS__CGSCC_NPM: for.cond13: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] -; IS__CGSCC_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 -; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup15: -; IS__CGSCC_NPM-NEXT: br label [[FOR_END23:%.*]] -; IS__CGSCC_NPM: for.body16: -; IS__CGSCC_NPM-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64* -; IS__CGSCC_NPM-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 -; IS__CGSCC_NPM-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]] -; IS__CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA20]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_INC21]] -; IS__CGSCC_NPM: for.inc21: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]] -; IS__CGSCC_NPM: for.end23: -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023 -; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500 -; IS__CGSCC_NPM-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32* -; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I21]], i32 noundef 0) #[[ATTR11]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND27:%.*]] -; IS__CGSCC_NPM: for.cond27: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ] -; IS__CGSCC_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 -; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup29: -; IS__CGSCC_NPM-NEXT: br label [[FOR_END37:%.*]] -; IS__CGSCC_NPM: for.body30: -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]] -; IS__CGSCC_NPM-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC_NPM-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_INC35]] -; IS__CGSCC_NPM: for.inc35: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]] -; IS__CGSCC_NPM: for.end37: -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2 +; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree [[BYTES:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] +; NOT_CGSCC_NPM: for.cond: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 +; NOT_CGSCC_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_END:%.*]] +; NOT_CGSCC_NPM: for.body: +; NOT_CGSCC_NPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]] +; NOT_CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA19]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_INC]] +; NOT_CGSCC_NPM: for.inc: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]] +; NOT_CGSCC_NPM: for.end: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND2:%.*]] +; NOT_CGSCC_NPM: for.cond2: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] +; NOT_CGSCC_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 +; NOT_CGSCC_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup4: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_END11:%.*]] +; NOT_CGSCC_NPM: for.body5: +; NOT_CGSCC_NPM-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float* +; NOT_CGSCC_NPM-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 +; NOT_CGSCC_NPM-NEXT: [[I17:%.*]] = or i64 [[I16]], 1 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]] +; NOT_CGSCC_NPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA26:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_INC9]] +; NOT_CGSCC_NPM: for.inc9: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP27:![0-9]+]] +; NOT_CGSCC_NPM: for.end11: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND13:%.*]] +; NOT_CGSCC_NPM: for.cond13: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] +; NOT_CGSCC_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 +; NOT_CGSCC_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup15: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_END23:%.*]] +; NOT_CGSCC_NPM: for.body16: +; NOT_CGSCC_NPM-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64* +; NOT_CGSCC_NPM-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 +; NOT_CGSCC_NPM-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2 +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]] +; NOT_CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA28:![0-9]+]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_INC21]] +; NOT_CGSCC_NPM: for.inc21: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]] +; NOT_CGSCC_NPM: for.end23: +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023 +; NOT_CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA19]] +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500 +; NOT_CGSCC_NPM-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32* +; NOT_CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 [[I21]], i32 noundef 0) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND27:%.*]] +; NOT_CGSCC_NPM: for.cond27: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ] +; NOT_CGSCC_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 +; NOT_CGSCC_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup29: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_END37:%.*]] +; NOT_CGSCC_NPM: for.body30: +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]] +; NOT_CGSCC_NPM-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]] +; NOT_CGSCC_NPM-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] +; NOT_CGSCC_NPM-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA19]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_INC35]] +; NOT_CGSCC_NPM: for.inc35: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]] +; NOT_CGSCC_NPM: for.end37: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2 +; NOT_TUNIT_NPM-SAME: (i8* [[BYTES:%.*]]) { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] +; NOT_TUNIT_NPM: for.cond: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 +; NOT_TUNIT_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_END:%.*]] +; NOT_TUNIT_NPM: for.body: +; NOT_TUNIT_NPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]] +; NOT_TUNIT_NPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA15]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_INC]] +; NOT_TUNIT_NPM: for.inc: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP28:![0-9]+]] +; NOT_TUNIT_NPM: for.end: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND2:%.*]] +; NOT_TUNIT_NPM: for.cond2: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] +; NOT_TUNIT_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 +; NOT_TUNIT_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup4: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_END11:%.*]] +; NOT_TUNIT_NPM: for.body5: +; NOT_TUNIT_NPM-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float* +; NOT_TUNIT_NPM-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 +; NOT_TUNIT_NPM-NEXT: [[I17:%.*]] = or i64 [[I16]], 1 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]] +; NOT_TUNIT_NPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_INC9]] +; NOT_TUNIT_NPM: for.inc9: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP29:![0-9]+]] +; NOT_TUNIT_NPM: for.end11: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND13:%.*]] +; NOT_TUNIT_NPM: for.cond13: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] +; NOT_TUNIT_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 +; NOT_TUNIT_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup15: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_END23:%.*]] +; NOT_TUNIT_NPM: for.body16: +; NOT_TUNIT_NPM-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64* +; NOT_TUNIT_NPM-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 +; NOT_TUNIT_NPM-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2 +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]] +; NOT_TUNIT_NPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA20]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_INC21]] +; NOT_TUNIT_NPM: for.inc21: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]] +; NOT_TUNIT_NPM: for.end23: +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023 +; NOT_TUNIT_NPM-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA15]] +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500 +; NOT_TUNIT_NPM-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32* +; NOT_TUNIT_NPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I21]], i32 noundef 0) #[[ATTR11]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND27:%.*]] +; NOT_TUNIT_NPM: for.cond27: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ] +; NOT_TUNIT_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 +; NOT_TUNIT_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup29: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_END37:%.*]] +; NOT_TUNIT_NPM: for.body30: +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]] +; NOT_TUNIT_NPM-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]] +; NOT_TUNIT_NPM-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] +; NOT_TUNIT_NPM-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA15]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_INC35]] +; NOT_TUNIT_NPM: for.inc35: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]] +; NOT_TUNIT_NPM: for.end37: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: br label %for.cond @@ -2302,105 +1545,56 @@ ; } ; define i32 @local_alloca_not_simplifiable_1() { -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[X:%.*]] = alloca i32, align 4 -; IS__TUNIT_OPM-NEXT: [[Y:%.*]] = alloca i32, align 4 -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]] -; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR9]] -; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]] -; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]] -; IS__TUNIT_OPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8* -; IS__TUNIT_OPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]]) -; IS__TUNIT_OPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]]) -; IS__TUNIT_OPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]] -; IS__TUNIT_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0 -; IS__TUNIT_OPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1 -; IS__TUNIT_OPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]] -; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]] -; IS__TUNIT_OPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]] -; IS__TUNIT_OPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]]) -; IS__TUNIT_OPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8* -; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) -; IS__TUNIT_OPM-NEXT: ret i32 [[ADD1]] -; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[X:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: [[Y:%.*]] = alloca i32, align 4 -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR7]] -; IS__TUNIT_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR7]] -; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]] -; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]] -; IS__TUNIT_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8* -; IS__TUNIT_NPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]]) -; IS__TUNIT_NPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]]) -; IS__TUNIT_NPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]] -; IS__TUNIT_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0 -; IS__TUNIT_NPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1 -; IS__TUNIT_NPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]] -; IS__TUNIT_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]] -; IS__TUNIT_NPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]] -; IS__TUNIT_NPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]]) -; IS__TUNIT_NPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8* -; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) -; IS__TUNIT_NPM-NEXT: ret i32 [[ADD1]] -; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[X:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: [[Y:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]] -; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR11]] -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]] -; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]] -; IS__CGSCC_OPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8* -; IS__CGSCC_OPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]]) -; IS__CGSCC_OPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]]) -; IS__CGSCC_OPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]] -; IS__CGSCC_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0 -; IS__CGSCC_OPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1 -; IS__CGSCC_OPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]] -; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]] -; IS__CGSCC_OPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]] -; IS__CGSCC_OPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]]) -; IS__CGSCC_OPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8* -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) -; IS__CGSCC_OPM-NEXT: ret i32 [[ADD1]] -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[X:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[Y:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]] -; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR9]] -; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]] -; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]] -; IS__CGSCC_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8* -; IS__CGSCC_NPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]]) -; IS__CGSCC_NPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]]) -; IS__CGSCC_NPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]] -; IS__CGSCC_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0 -; IS__CGSCC_NPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1 -; IS__CGSCC_NPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]] -; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]] -; IS__CGSCC_NPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]] -; IS__CGSCC_NPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]]) -; IS__CGSCC_NPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8* -; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) -; IS__CGSCC_NPM-NEXT: ret i32 [[ADD1]] +; +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: [[Y:%.*]] = alloca i32, align 4 +; NOT_CGSCC_NPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR7]] +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]] +; NOT_CGSCC_NPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]] +; NOT_CGSCC_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]]) +; NOT_CGSCC_NPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]]) +; NOT_CGSCC_NPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]] +; NOT_CGSCC_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0 +; NOT_CGSCC_NPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1 +; NOT_CGSCC_NPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]] +; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]] +; NOT_CGSCC_NPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]] +; NOT_CGSCC_NPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]]) +; NOT_CGSCC_NPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8* +; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) +; NOT_CGSCC_NPM-NEXT: ret i32 [[ADD1]] +; +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[Y:%.*]] = alloca i32, align 4 +; NOT_TUNIT_NPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]] +; NOT_TUNIT_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR9]] +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]] +; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]] +; NOT_TUNIT_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]]) +; NOT_TUNIT_NPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]]) +; NOT_TUNIT_NPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]] +; NOT_TUNIT_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0 +; NOT_TUNIT_NPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1 +; NOT_TUNIT_NPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]] +; NOT_TUNIT_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]] +; NOT_TUNIT_NPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]] +; NOT_TUNIT_NPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]]) +; NOT_TUNIT_NPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8* +; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) +; NOT_TUNIT_NPM-NEXT: ret i32 [[ADD1]] ; entry: %X = alloca i32, align 4 @@ -2429,43 +1623,43 @@ ; We could simplify these if we separate accessed bins wrt. alignment (here mod 4). define i32 @unknown_access_mixed_simplifiable(i32 %arg1, i32 %arg2) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@unknown_access_mixed_simplifiable -; IS__TUNIT____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 -; IS__TUNIT____-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32* -; IS__TUNIT____-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__TUNIT____-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]] -; IS__TUNIT____-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]] -; IS__TUNIT____-NEXT: store i32 7, i32* [[GEP1]], align 4 -; IS__TUNIT____-NEXT: store i32 7, i32* [[GEP2]], align 4 -; IS__TUNIT____-NEXT: store i32 7, i32* [[GEP3]], align 4 -; IS__TUNIT____-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4 -; IS__TUNIT____-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4 -; IS__TUNIT____-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4 -; IS__TUNIT____-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] -; IS__TUNIT____-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] -; IS__TUNIT____-NEXT: ret i32 [[ADD2]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@unknown_access_mixed_simplifiable -; IS__CGSCC____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 -; IS__CGSCC____-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32* -; IS__CGSCC____-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__CGSCC____-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]] -; IS__CGSCC____-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]] -; IS__CGSCC____-NEXT: store i32 7, i32* [[GEP1]], align 4 -; IS__CGSCC____-NEXT: store i32 7, i32* [[GEP2]], align 4 -; IS__CGSCC____-NEXT: store i32 7, i32* [[GEP3]], align 4 -; IS__CGSCC____-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4 -; IS__CGSCC____-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4 -; IS__CGSCC____-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4 -; IS__CGSCC____-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] -; IS__CGSCC____-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] -; IS__CGSCC____-NEXT: ret i32 [[ADD2]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@unknown_access_mixed_simplifiable +; NOT_CGSCC_NPM-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 +; NOT_CGSCC_NPM-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32* +; NOT_CGSCC_NPM-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; NOT_CGSCC_NPM-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]] +; NOT_CGSCC_NPM-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]] +; NOT_CGSCC_NPM-NEXT: store i32 7, i32* [[GEP1]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32 7, i32* [[GEP2]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32 7, i32* [[GEP3]], align 4 +; NOT_CGSCC_NPM-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4 +; NOT_CGSCC_NPM-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4 +; NOT_CGSCC_NPM-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4 +; NOT_CGSCC_NPM-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] +; NOT_CGSCC_NPM-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[ADD2]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@unknown_access_mixed_simplifiable +; NOT_TUNIT_NPM-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 +; NOT_TUNIT_NPM-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32* +; NOT_TUNIT_NPM-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; NOT_TUNIT_NPM-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]] +; NOT_TUNIT_NPM-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]] +; NOT_TUNIT_NPM-NEXT: store i32 7, i32* [[GEP1]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32 7, i32* [[GEP2]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32 7, i32* [[GEP3]], align 4 +; NOT_TUNIT_NPM-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4 +; NOT_TUNIT_NPM-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4 +; NOT_TUNIT_NPM-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4 +; NOT_TUNIT_NPM-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] +; NOT_TUNIT_NPM-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[ADD2]] ; entry: %s = alloca %struct.S, align 4 @@ -2486,55 +1680,55 @@ ; The access to bc4b could go anywhere, nothing is simplifiable. define i32 @unknown_access_mixed_not_simplifiable(i32 %arg1, i32 %arg2, i32 %arg3) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@unknown_access_mixed_not_simplifiable -; IS__TUNIT____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR3]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 -; IS__TUNIT____-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32* -; IS__TUNIT____-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__TUNIT____-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]] -; IS__TUNIT____-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]] -; IS__TUNIT____-NEXT: [[BC4A:%.*]] = bitcast %struct.S* [[S]] to i8* -; IS__TUNIT____-NEXT: [[GEP4:%.*]] = getelementptr inbounds i8, i8* [[BC4A]], i32 [[ARG3]] -; IS__TUNIT____-NEXT: [[BC4B:%.*]] = bitcast i8* [[GEP4]] to i32* -; IS__TUNIT____-NEXT: store i32 7, i32* [[GEP1]], align 4 -; IS__TUNIT____-NEXT: store i32 7, i32* [[GEP2]], align 4 -; IS__TUNIT____-NEXT: store i32 7, i32* [[GEP3]], align 4 -; IS__TUNIT____-NEXT: store i32 7, i32* [[BC4B]], align 4 -; IS__TUNIT____-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4 -; IS__TUNIT____-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4 -; IS__TUNIT____-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4 -; IS__TUNIT____-NEXT: [[L4:%.*]] = load i32, i32* [[BC4B]], align 4 -; IS__TUNIT____-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] -; IS__TUNIT____-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] -; IS__TUNIT____-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[L4]] -; IS__TUNIT____-NEXT: ret i32 [[ADD3]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@unknown_access_mixed_not_simplifiable -; IS__CGSCC____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 -; IS__CGSCC____-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32* -; IS__CGSCC____-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__CGSCC____-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]] -; IS__CGSCC____-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]] -; IS__CGSCC____-NEXT: [[BC4A:%.*]] = bitcast %struct.S* [[S]] to i8* -; IS__CGSCC____-NEXT: [[GEP4:%.*]] = getelementptr inbounds i8, i8* [[BC4A]], i32 [[ARG3]] -; IS__CGSCC____-NEXT: [[BC4B:%.*]] = bitcast i8* [[GEP4]] to i32* -; IS__CGSCC____-NEXT: store i32 7, i32* [[GEP1]], align 4 -; IS__CGSCC____-NEXT: store i32 7, i32* [[GEP2]], align 4 -; IS__CGSCC____-NEXT: store i32 7, i32* [[GEP3]], align 4 -; IS__CGSCC____-NEXT: store i32 7, i32* [[BC4B]], align 4 -; IS__CGSCC____-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4 -; IS__CGSCC____-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4 -; IS__CGSCC____-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4 -; IS__CGSCC____-NEXT: [[L4:%.*]] = load i32, i32* [[BC4B]], align 4 -; IS__CGSCC____-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] -; IS__CGSCC____-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] -; IS__CGSCC____-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[L4]] -; IS__CGSCC____-NEXT: ret i32 [[ADD3]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@unknown_access_mixed_not_simplifiable +; NOT_CGSCC_NPM-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 +; NOT_CGSCC_NPM-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32* +; NOT_CGSCC_NPM-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; NOT_CGSCC_NPM-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]] +; NOT_CGSCC_NPM-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]] +; NOT_CGSCC_NPM-NEXT: [[BC4A:%.*]] = bitcast %struct.S* [[S]] to i8* +; NOT_CGSCC_NPM-NEXT: [[GEP4:%.*]] = getelementptr inbounds i8, i8* [[BC4A]], i32 [[ARG3]] +; NOT_CGSCC_NPM-NEXT: [[BC4B:%.*]] = bitcast i8* [[GEP4]] to i32* +; NOT_CGSCC_NPM-NEXT: store i32 7, i32* [[GEP1]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32 7, i32* [[GEP2]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32 7, i32* [[GEP3]], align 4 +; NOT_CGSCC_NPM-NEXT: store i32 7, i32* [[BC4B]], align 4 +; NOT_CGSCC_NPM-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4 +; NOT_CGSCC_NPM-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4 +; NOT_CGSCC_NPM-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4 +; NOT_CGSCC_NPM-NEXT: [[L4:%.*]] = load i32, i32* [[BC4B]], align 4 +; NOT_CGSCC_NPM-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] +; NOT_CGSCC_NPM-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] +; NOT_CGSCC_NPM-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[L4]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[ADD3]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@unknown_access_mixed_not_simplifiable +; NOT_TUNIT_NPM-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 +; NOT_TUNIT_NPM-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32* +; NOT_TUNIT_NPM-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; NOT_TUNIT_NPM-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]] +; NOT_TUNIT_NPM-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]] +; NOT_TUNIT_NPM-NEXT: [[BC4A:%.*]] = bitcast %struct.S* [[S]] to i8* +; NOT_TUNIT_NPM-NEXT: [[GEP4:%.*]] = getelementptr inbounds i8, i8* [[BC4A]], i32 [[ARG3]] +; NOT_TUNIT_NPM-NEXT: [[BC4B:%.*]] = bitcast i8* [[GEP4]] to i32* +; NOT_TUNIT_NPM-NEXT: store i32 7, i32* [[GEP1]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32 7, i32* [[GEP2]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32 7, i32* [[GEP3]], align 4 +; NOT_TUNIT_NPM-NEXT: store i32 7, i32* [[BC4B]], align 4 +; NOT_TUNIT_NPM-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4 +; NOT_TUNIT_NPM-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4 +; NOT_TUNIT_NPM-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4 +; NOT_TUNIT_NPM-NEXT: [[L4:%.*]] = load i32, i32* [[BC4B]], align 4 +; NOT_TUNIT_NPM-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] +; NOT_TUNIT_NPM-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] +; NOT_TUNIT_NPM-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[L4]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[ADD3]] ; entry: %s = alloca %struct.S, align 4 @@ -2567,26 +1761,20 @@ ; } ; define i32 @global_not_simplifiable_1(i32 %cnd) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@global_not_simplifiable_1 -; IS__TUNIT_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]] -; IS__TUNIT_OPM-NEXT: ret i32 [[I]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@global_not_simplifiable_1 -; IS__TUNIT_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]] -; IS__TUNIT_NPM-NEXT: ret i32 [[I]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@global_not_simplifiable_1 -; IS__CGSCC____-SAME: (i32 [[CND:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]] -; IS__CGSCC____-NEXT: ret i32 [[I]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@global_not_simplifiable_1 +; NOT_CGSCC_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR5:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[I]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@global_not_simplifiable_1 +; NOT_TUNIT_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR7:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[I]] ; entry: %i = load i32, i32* @Flag0, align 4, !tbaa !3 @@ -2670,292 +1858,215 @@ ; ; FIXME: We could replace these loads. define i32 @write_read_global() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_global -; IS__TUNIT_OPM-SAME: () #[[ATTR4]] { -; IS__TUNIT_OPM-NEXT: store i32 7, i32* @Gint1, align 4 -; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4 -; IS__TUNIT_OPM-NEXT: ret i32 [[L]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_read_global -; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: store i32 7, i32* @Gint1, align 4 -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4 -; IS__TUNIT_NPM-NEXT: ret i32 [[L]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_read_global -; IS__CGSCC____-SAME: () #[[ATTR5]] { -; IS__CGSCC____-NEXT: store i32 7, i32* @Gint1, align 4 -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@write_read_global +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: store i32 7, i32* @Gint1, align 4 +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4 +; NOT_CGSCC_NPM-NEXT: ret i32 [[L]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@write_read_global +; NOT_TUNIT_NPM-SAME: () #[[ATTR5]] { +; NOT_TUNIT_NPM-NEXT: store i32 7, i32* @Gint1, align 4 +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 [[L]] ; store i32 7, i32* @Gint1 %l = load i32, i32* @Gint1 ret i32 %l } define void @write_global() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_global -; IS__TUNIT_OPM-SAME: () #[[ATTR5]] { -; IS__TUNIT_OPM-NEXT: store i32 7, i32* @Gint2, align 4 -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_global -; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: store i32 7, i32* @Gint2, align 4 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_global -; IS__CGSCC____-SAME: () #[[ATTR4:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 7, i32* @Gint2, align 4 -; IS__CGSCC____-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@write_global +; NOT_CGSCC_NPM-SAME: () #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: store i32 7, i32* @Gint2, align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@write_global +; NOT_TUNIT_NPM-SAME: () #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: store i32 7, i32* @Gint2, align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32 7, i32* @Gint2 ret void } define i32 @read_global() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@read_global -; IS__TUNIT_OPM-SAME: () #[[ATTR7]] { -; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4 -; IS__TUNIT_OPM-NEXT: ret i32 [[L]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@read_global -; IS__TUNIT_NPM-SAME: () #[[ATTR5]] { -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4 -; IS__TUNIT_NPM-NEXT: ret i32 [[L]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@read_global -; IS__CGSCC____-SAME: () #[[ATTR7]] { -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@read_global +; NOT_CGSCC_NPM-SAME: () #[[ATTR5]] { +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4 +; NOT_CGSCC_NPM-NEXT: ret i32 [[L]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@read_global +; NOT_TUNIT_NPM-SAME: () #[[ATTR7]] { +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 [[L]] ; %l = load i32, i32* @Gint2 ret i32 %l } ; FIXME: We could replace these loads. define i32 @write_read_static_global() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_static_global -; IS__TUNIT_OPM-SAME: () #[[ATTR4]] { -; IS__TUNIT_OPM-NEXT: store i32 7, i32* @Gstatic_int1, align 4 -; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4 -; IS__TUNIT_OPM-NEXT: ret i32 [[L]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_read_static_global -; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: store i32 7, i32* @Gstatic_int1, align 4 -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4 -; IS__TUNIT_NPM-NEXT: ret i32 [[L]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_read_static_global -; IS__CGSCC____-SAME: () #[[ATTR5]] { -; IS__CGSCC____-NEXT: store i32 7, i32* @Gstatic_int1, align 4 -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@write_read_static_global +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: store i32 7, i32* @Gstatic_int1, align 4 +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4 +; NOT_CGSCC_NPM-NEXT: ret i32 [[L]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@write_read_static_global +; NOT_TUNIT_NPM-SAME: () #[[ATTR5]] { +; NOT_TUNIT_NPM-NEXT: store i32 7, i32* @Gstatic_int1, align 4 +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 [[L]] ; store i32 7, i32* @Gstatic_int1 %l = load i32, i32* @Gstatic_int1 ret i32 %l } define void @write_static_global() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_static_global -; IS__TUNIT_OPM-SAME: () #[[ATTR5]] { -; IS__TUNIT_OPM-NEXT: store i32 7, i32* @Gstatic_int2, align 4 -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_static_global -; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: store i32 7, i32* @Gstatic_int2, align 4 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_static_global -; IS__CGSCC____-SAME: () #[[ATTR4]] { -; IS__CGSCC____-NEXT: store i32 7, i32* @Gstatic_int2, align 4 -; IS__CGSCC____-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@write_static_global +; NOT_CGSCC_NPM-SAME: () #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: store i32 7, i32* @Gstatic_int2, align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@write_static_global +; NOT_TUNIT_NPM-SAME: () #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: store i32 7, i32* @Gstatic_int2, align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32 7, i32* @Gstatic_int2 ret void } define i32 @read_static_global() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@read_static_global -; IS__TUNIT_OPM-SAME: () #[[ATTR7]] { -; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4 -; IS__TUNIT_OPM-NEXT: ret i32 [[L]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@read_static_global -; IS__TUNIT_NPM-SAME: () #[[ATTR5]] { -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4 -; IS__TUNIT_NPM-NEXT: ret i32 [[L]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@read_static_global -; IS__CGSCC____-SAME: () #[[ATTR7]] { -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@read_static_global +; NOT_CGSCC_NPM-SAME: () #[[ATTR5]] { +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4 +; NOT_CGSCC_NPM-NEXT: ret i32 [[L]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@read_static_global +; NOT_TUNIT_NPM-SAME: () #[[ATTR7]] { +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4 +; NOT_TUNIT_NPM-NEXT: ret i32 [[L]] ; %l = load i32, i32* @Gstatic_int2 ret i32 %l } define i32 @write_read_static_undef_global() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_static_undef_global -; IS__TUNIT_OPM-SAME: () #[[ATTR5]] { -; IS__TUNIT_OPM-NEXT: ret i32 7 ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_read_static_undef_global -; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: ret i32 7 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@write_read_static_undef_global +; NOT_CGSCC_NPM-SAME: () #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: ret i32 7 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_read_static_undef_global -; IS__CGSCC____-SAME: () #[[ATTR4]] { -; IS__CGSCC____-NEXT: ret i32 7 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@write_read_static_undef_global +; NOT_TUNIT_NPM-SAME: () #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: ret i32 7 ; store i32 7, i32* @Gstatic_undef_int1 %l = load i32, i32* @Gstatic_undef_int1 ret i32 %l } define void @write_static_undef_global() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_static_undef_global -; IS__TUNIT_OPM-SAME: () #[[ATTR5]] { -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_static_undef_global -; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_static_undef_global -; IS__CGSCC____-SAME: () #[[ATTR4]] { -; IS__CGSCC____-NEXT: store i32 7, i32* @Gstatic_undef_int2, align 4 -; IS__CGSCC____-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@write_static_undef_global +; NOT_CGSCC_NPM-SAME: () #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@write_static_undef_global +; NOT_TUNIT_NPM-SAME: () #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: store i32 7, i32* @Gstatic_undef_int2, align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; store i32 7, i32* @Gstatic_undef_int2 ret void } define i32 @read_static_undef_global() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@read_static_undef_global -; IS__TUNIT____-SAME: () #[[ATTR3]] { -; IS__TUNIT____-NEXT: ret i32 7 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@read_static_undef_global +; NOT_CGSCC_NPM-SAME: () #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: ret i32 7 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@read_static_undef_global -; IS__CGSCC____-SAME: () #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret i32 7 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@read_static_undef_global +; NOT_TUNIT_NPM-SAME: () #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret i32 7 ; %l = load i32, i32* @Gstatic_undef_int2 ret i32 %l } define i32 @single_read_of_static_global() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@single_read_of_static_global -; IS__TUNIT____-SAME: () #[[ATTR3]] { -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@single_read_of_static_global +; NOT_CGSCC_NPM-SAME: () #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@single_read_of_static_global -; IS__CGSCC____-SAME: () #[[ATTR2]] { -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@single_read_of_static_global +; NOT_TUNIT_NPM-SAME: () #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; %l = load i32, i32* @Gstatic_int3 ret i32 %l } define i8 @phi_store() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@phi_store -; IS__TUNIT_OPM-SAME: () #[[ATTR8:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[A:%.*]] = alloca i16, align 2 -; IS__TUNIT_OPM-NEXT: [[B:%.*]] = bitcast i16* [[A]] to i8* -; IS__TUNIT_OPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_OPM: loop: -; IS__TUNIT_OPM-NEXT: [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__TUNIT_OPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 -; IS__TUNIT_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 2 -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1 -; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i8, i8* [[S]], align 1 -; IS__TUNIT_OPM-NEXT: ret i8 [[L]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@phi_store -; IS__TUNIT_NPM-SAME: () #[[ATTR3]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[A:%.*]] = alloca i16, align 2 -; IS__TUNIT_NPM-NEXT: [[B:%.*]] = bitcast i16* [[A]] to i8* -; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_NPM: loop: -; IS__TUNIT_NPM-NEXT: [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 -; IS__TUNIT_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 2 -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1 -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i8, i8* [[S]], align 1 -; IS__TUNIT_NPM-NEXT: ret i8 [[L]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@phi_store -; IS__CGSCC_OPM-SAME: () #[[ATTR8:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = alloca i16, align 2 -; IS__CGSCC_OPM-NEXT: [[B:%.*]] = bitcast i16* [[A]] to i8* -; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_OPM: loop: -; IS__CGSCC_OPM-NEXT: [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; IS__CGSCC_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__CGSCC_OPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 -; IS__CGSCC_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 2 -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1 -; IS__CGSCC_OPM-NEXT: [[L:%.*]] = load i8, i8* [[S]], align 1 -; IS__CGSCC_OPM-NEXT: ret i8 [[L]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@phi_store -; IS__CGSCC_NPM-SAME: () #[[ATTR2]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = alloca i16, align 2 -; IS__CGSCC_NPM-NEXT: [[B:%.*]] = bitcast i16* [[A]] to i8* -; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_NPM: loop: -; IS__CGSCC_NPM-NEXT: [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; IS__CGSCC_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__CGSCC_NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 -; IS__CGSCC_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 2 -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1 -; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i8, i8* [[S]], align 1 -; IS__CGSCC_NPM-NEXT: ret i8 [[L]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@phi_store +; NOT_CGSCC_NPM-SAME: () #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = alloca i16, align 2 +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = bitcast i16* [[A]] to i8* +; NOT_CGSCC_NPM-NEXT: br label [[LOOP:%.*]] +; NOT_CGSCC_NPM: loop: +; NOT_CGSCC_NPM-NEXT: [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] +; NOT_CGSCC_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; NOT_CGSCC_NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 +; NOT_CGSCC_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 2 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; NOT_CGSCC_NPM: end: +; NOT_CGSCC_NPM-NEXT: [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1 +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i8, i8* [[S]], align 1 +; NOT_CGSCC_NPM-NEXT: ret i8 [[L]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@phi_store +; NOT_TUNIT_NPM-SAME: () #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[A:%.*]] = alloca i16, align 2 +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = bitcast i16* [[A]] to i8* +; NOT_TUNIT_NPM-NEXT: br label [[LOOP:%.*]] +; NOT_TUNIT_NPM: loop: +; NOT_TUNIT_NPM-NEXT: [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] +; NOT_TUNIT_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; NOT_TUNIT_NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 +; NOT_TUNIT_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 2 +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1 +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = load i8, i8* [[S]], align 1 +; NOT_TUNIT_NPM-NEXT: ret i8 [[L]] ; entry: %a = alloca i16 @@ -2977,77 +2088,42 @@ ; FIXME: This function returns 1. define i8 @phi_no_store_1() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@phi_no_store_1 -; IS__TUNIT_OPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_OPM: loop: -; IS__TUNIT_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__TUNIT_OPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 -; IS__TUNIT_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 -; IS__TUNIT_OPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 -; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] -; IS__TUNIT_OPM-NEXT: ret i8 [[ADD]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@phi_no_store_1 -; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_NPM: loop: -; IS__TUNIT_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 -; IS__TUNIT_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 -; IS__TUNIT_NPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 -; IS__TUNIT_NPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] -; IS__TUNIT_NPM-NEXT: ret i8 [[ADD]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@phi_no_store_1 -; IS__CGSCC_OPM-SAME: () #[[ATTR9:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_OPM: loop: -; IS__CGSCC_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; IS__CGSCC_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__CGSCC_OPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 -; IS__CGSCC_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 -; IS__CGSCC_OPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 -; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] -; IS__CGSCC_OPM-NEXT: ret i8 [[ADD]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@phi_no_store_1 -; IS__CGSCC_NPM-SAME: () #[[ATTR5]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_NPM: loop: -; IS__CGSCC_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; IS__CGSCC_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__CGSCC_NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 -; IS__CGSCC_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 -; IS__CGSCC_NPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 -; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] -; IS__CGSCC_NPM-NEXT: ret i8 [[ADD]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@phi_no_store_1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[LOOP:%.*]] +; NOT_CGSCC_NPM: loop: +; NOT_CGSCC_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] +; NOT_CGSCC_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; NOT_CGSCC_NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 +; NOT_CGSCC_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; NOT_CGSCC_NPM: end: +; NOT_CGSCC_NPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 +; NOT_CGSCC_NPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 +; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] +; NOT_CGSCC_NPM-NEXT: ret i8 [[ADD]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@phi_no_store_1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR5]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[LOOP:%.*]] +; NOT_TUNIT_NPM: loop: +; NOT_TUNIT_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] +; NOT_TUNIT_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; NOT_TUNIT_NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 +; NOT_TUNIT_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 +; NOT_TUNIT_NPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 +; NOT_TUNIT_NPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] +; NOT_TUNIT_NPM-NEXT: ret i8 [[ADD]] ; entry: %b = bitcast i32* @a1 to i8* @@ -3071,71 +2147,38 @@ ; FIXME: This function returns 1. define i8 @phi_no_store_2() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@phi_no_store_2 -; IS__TUNIT_OPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_OPM: loop: -; IS__TUNIT_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ] -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__TUNIT_OPM-NEXT: store i8 1, i8* [[P]], align 2 -; IS__TUNIT_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2 -; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = add i8 [[L21]], 0 -; IS__TUNIT_OPM-NEXT: ret i8 [[ADD]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@phi_no_store_2 -; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_NPM: loop: -; IS__TUNIT_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: store i8 1, i8* [[P]], align 2 -; IS__TUNIT_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2 -; IS__TUNIT_NPM-NEXT: ret i8 [[L21]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@phi_no_store_2 -; IS__CGSCC_OPM-SAME: () #[[ATTR9]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_OPM: loop: -; IS__CGSCC_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ] -; IS__CGSCC_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__CGSCC_OPM-NEXT: store i8 1, i8* [[P]], align 2 -; IS__CGSCC_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2 -; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = add i8 [[L21]], 0 -; IS__CGSCC_OPM-NEXT: ret i8 [[ADD]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@phi_no_store_2 -; IS__CGSCC_NPM-SAME: () #[[ATTR5]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_NPM: loop: -; IS__CGSCC_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ] -; IS__CGSCC_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__CGSCC_NPM-NEXT: store i8 1, i8* [[P]], align 2 -; IS__CGSCC_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2 -; IS__CGSCC_NPM-NEXT: ret i8 [[L21]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@phi_no_store_2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[LOOP:%.*]] +; NOT_CGSCC_NPM: loop: +; NOT_CGSCC_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ] +; NOT_CGSCC_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; NOT_CGSCC_NPM-NEXT: store i8 1, i8* [[P]], align 2 +; NOT_CGSCC_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; NOT_CGSCC_NPM: end: +; NOT_CGSCC_NPM-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2 +; NOT_CGSCC_NPM-NEXT: ret i8 [[L21]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@phi_no_store_2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR5]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[LOOP:%.*]] +; NOT_TUNIT_NPM: loop: +; NOT_TUNIT_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ] +; NOT_TUNIT_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; NOT_TUNIT_NPM-NEXT: store i8 1, i8* [[P]], align 2 +; NOT_TUNIT_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2 +; NOT_TUNIT_NPM-NEXT: ret i8 [[L21]] ; entry: %b = bitcast i32* @a2 to i8* @@ -3158,61 +2201,34 @@ } define i8 @phi_no_store_3() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@phi_no_store_3 -; IS__TUNIT_OPM-SAME: () #[[ATTR6]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_OPM: loop: -; IS__TUNIT_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ] -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__TUNIT_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: ret i8 1 -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@phi_no_store_3 -; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_NPM: loop: -; IS__TUNIT_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: ret i8 1 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@phi_no_store_3 -; IS__CGSCC_OPM-SAME: () #[[ATTR10:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_OPM: loop: -; IS__CGSCC_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ] -; IS__CGSCC_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__CGSCC_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: ret i8 1 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@phi_no_store_3 -; IS__CGSCC_NPM-SAME: () #[[ATTR4]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_NPM: loop: -; IS__CGSCC_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ] -; IS__CGSCC_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__CGSCC_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret i8 1 +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@phi_no_store_3 +; NOT_CGSCC_NPM-SAME: () #[[ATTR4]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[LOOP:%.*]] +; NOT_CGSCC_NPM: loop: +; NOT_CGSCC_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ] +; NOT_CGSCC_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; NOT_CGSCC_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; NOT_CGSCC_NPM: end: +; NOT_CGSCC_NPM-NEXT: ret i8 1 +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@phi_no_store_3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[LOOP:%.*]] +; NOT_TUNIT_NPM: loop: +; NOT_TUNIT_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ] +; NOT_TUNIT_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; NOT_TUNIT_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: ret i8 1 ; entry: %b = bitcast i32* @a3 to i8* @@ -3237,26 +2253,20 @@ } define i8 @cast_and_load_1() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@cast_and_load_1 -; IS__TUNIT_OPM-SAME: () #[[ATTR4]] { -; IS__TUNIT_OPM-NEXT: store i32 42, i32* @bytes1, align 4 -; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4 -; IS__TUNIT_OPM-NEXT: ret i8 [[L]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@cast_and_load_1 -; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: store i32 42, i32* @bytes1, align 4 -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4 -; IS__TUNIT_NPM-NEXT: ret i8 [[L]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cast_and_load_1 -; IS__CGSCC____-SAME: () #[[ATTR5]] { -; IS__CGSCC____-NEXT: store i32 42, i32* @bytes1, align 4 -; IS__CGSCC____-NEXT: [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4 -; IS__CGSCC____-NEXT: ret i8 [[L]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@cast_and_load_1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: store i32 42, i32* @bytes1, align 4 +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4 +; NOT_CGSCC_NPM-NEXT: ret i8 [[L]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cast_and_load_1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR5]] { +; NOT_TUNIT_NPM-NEXT: store i32 42, i32* @bytes1, align 4 +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4 +; NOT_TUNIT_NPM-NEXT: ret i8 [[L]] ; store i32 42, i32* @bytes1 %bc = bitcast i32* @bytes1 to i8* @@ -3265,26 +2275,20 @@ } define i64 @cast_and_load_2() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@cast_and_load_2 -; IS__TUNIT_OPM-SAME: () #[[ATTR4]] { -; IS__TUNIT_OPM-NEXT: store i32 42, i32* @bytes2, align 4 -; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4 -; IS__TUNIT_OPM-NEXT: ret i64 [[L]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@cast_and_load_2 -; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: store i32 42, i32* @bytes2, align 4 -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4 -; IS__TUNIT_NPM-NEXT: ret i64 [[L]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cast_and_load_2 -; IS__CGSCC____-SAME: () #[[ATTR5]] { -; IS__CGSCC____-NEXT: store i32 42, i32* @bytes2, align 4 -; IS__CGSCC____-NEXT: [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4 -; IS__CGSCC____-NEXT: ret i64 [[L]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@cast_and_load_2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: store i32 42, i32* @bytes2, align 4 +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4 +; NOT_CGSCC_NPM-NEXT: ret i64 [[L]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cast_and_load_2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR5]] { +; NOT_TUNIT_NPM-NEXT: store i32 42, i32* @bytes2, align 4 +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4 +; NOT_TUNIT_NPM-NEXT: ret i64 [[L]] ; store i32 42, i32* @bytes2 %bc = bitcast i32* @bytes2 to i64* @@ -3293,50 +2297,35 @@ } define void @recursive_load_store(i64 %N, i32 %v) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_load_store -; IS__TUNIT____-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT____: for.cond: -; IS__TUNIT____-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__TUNIT____-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], [[N]] -; IS__TUNIT____-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_END:%.*]] -; IS__TUNIT____: for.body: -; IS__TUNIT____-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__TUNIT____-NEXT: br label [[FOR_COND]] -; IS__TUNIT____: for.end: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@recursive_load_store -; IS__CGSCC_OPM-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR10]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_OPM: for.cond: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], [[N]] -; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_END:%.*]] -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]] -; IS__CGSCC_OPM: for.end: -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_load_store -; IS__CGSCC_NPM-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_NPM: for.cond: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], [[N]] -; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_END:%.*]] -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND]] -; IS__CGSCC_NPM: for.end: -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@recursive_load_store +; NOT_CGSCC_NPM-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR6:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] +; NOT_CGSCC_NPM: for.cond: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], [[N]] +; NOT_CGSCC_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_END:%.*]] +; NOT_CGSCC_NPM: for.body: +; NOT_CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND]] +; NOT_CGSCC_NPM: for.end: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@recursive_load_store +; NOT_TUNIT_NPM-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR8:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] +; NOT_TUNIT_NPM: for.cond: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], [[N]] +; NOT_TUNIT_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_END:%.*]] +; NOT_TUNIT_NPM: for.body: +; NOT_TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND]] +; NOT_TUNIT_NPM: for.end: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: store i32 %v, i32* @rec_storage @@ -3395,117 +2384,91 @@ !30 = distinct !{!30, !17} !31 = distinct !{!31, !17} ;. -; IS__TUNIT_OPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind } -; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR6]] = { nofree nosync nounwind writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR7]] = { nofree nosync nounwind readonly willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR8]] = { nofree nosync nounwind readnone } -; IS__TUNIT_OPM: attributes #[[ATTR9]] = { willreturn } -;. -; IS__TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_NPM: attributes #[[ATTR5]] = { nofree nosync nounwind readonly willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR6]] = { nofree nosync nounwind writeonly } -; IS__TUNIT_NPM: attributes #[[ATTR7]] = { willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR11]] = { willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR12]] = { nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR13]] = { nounwind writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { nofree nosync nounwind readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { nofree nosync nounwind writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR9]] = { willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR10]] = { nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR11]] = { nounwind writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR9]] = { willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR10]] = { nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR11]] = { nounwind writeonly } ;. -; IS__TUNIT____: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} -; IS__TUNIT____: [[META1:![0-9]+]] = !{i32 7, !"uwtable", i32 1} -; IS__TUNIT____: [[META2:![0-9]+]] = !{!"clang version 13.0.0"} -; IS__TUNIT____: [[TBAA3]] = !{!4, !4, i64 0} -; IS__TUNIT____: [[META4:![0-9]+]] = !{!"int", !5, i64 0} -; IS__TUNIT____: [[META5:![0-9]+]] = !{!"omnipotent char", !6, i64 0} -; IS__TUNIT____: [[META6:![0-9]+]] = !{!"Simple C/C++ TBAA"} -; IS__TUNIT____: [[META7:![0-9]+]] = !{!8, !9, i64 12} -; IS__TUNIT____: [[META8:![0-9]+]] = !{!"S", !4, i64 0, !4, i64 4, !4, i64 8, !9, i64 12, !9, i64 16, !9, i64 20} -; IS__TUNIT____: [[META9:![0-9]+]] = !{!"float", !5, i64 0} -; IS__TUNIT____: [[META10:![0-9]+]] = !{!8, !9, i64 16} -; IS__TUNIT____: [[META11:![0-9]+]] = !{!8, !9, i64 20} -; IS__TUNIT____: [[META12:![0-9]+]] = !{!8, !4, i64 0} -; IS__TUNIT____: [[META13:![0-9]+]] = !{!8, !4, i64 4} -; IS__TUNIT____: [[META14:![0-9]+]] = !{!8, !4, i64 8} -; IS__TUNIT____: [[META15:![0-9]+]] = distinct !{!15, !16} -; IS__TUNIT____: [[META16:![0-9]+]] = !{!"llvm.loop.mustprogress"} -; IS__TUNIT____: [[META17:![0-9]+]] = distinct !{!17, !16} -; IS__TUNIT____: [[META18:![0-9]+]] = distinct !{!18, !16} -; IS__TUNIT____: [[META19:![0-9]+]] = !{!5, !5, i64 0} -; IS__TUNIT____: [[META20:![0-9]+]] = distinct !{!20, !16} -; IS__TUNIT____: [[META21:![0-9]+]] = distinct !{!21, !16} -; IS__TUNIT____: [[META22:![0-9]+]] = distinct !{!22, !16} -; IS__TUNIT____: [[META23:![0-9]+]] = distinct !{!23, !16} -; IS__TUNIT____: [[META24:![0-9]+]] = distinct !{!24, !16} -; IS__TUNIT____: [[META25:![0-9]+]] = distinct !{!25, !16} -; IS__TUNIT____: [[META26:![0-9]+]] = !{!9, !9, i64 0} -; IS__TUNIT____: [[META27:![0-9]+]] = distinct !{!27, !16} -; IS__TUNIT____: [[META28:![0-9]+]] = !{!29, !29, i64 0} -; IS__TUNIT____: [[META29:![0-9]+]] = !{!"long long", !5, i64 0} -; IS__TUNIT____: [[META30:![0-9]+]] = distinct !{!30, !16} -; IS__TUNIT____: [[META31:![0-9]+]] = distinct !{!31, !16} +; NOT_CGSCC_NPM: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} +; NOT_CGSCC_NPM: [[META1:![0-9]+]] = !{i32 7, !"uwtable", i32 1} +; NOT_CGSCC_NPM: [[META2:![0-9]+]] = !{!"clang version 13.0.0"} +; NOT_CGSCC_NPM: [[TBAA3]] = !{!4, !4, i64 0} +; NOT_CGSCC_NPM: [[META4:![0-9]+]] = !{!"int", !5, i64 0} +; NOT_CGSCC_NPM: [[META5:![0-9]+]] = !{!"omnipotent char", !6, i64 0} +; NOT_CGSCC_NPM: [[META6:![0-9]+]] = !{!"Simple C/C++ TBAA"} +; NOT_CGSCC_NPM: [[TBAA7]] = !{!8, !9, i64 12} +; NOT_CGSCC_NPM: [[META8:![0-9]+]] = !{!"S", !4, i64 0, !4, i64 4, !4, i64 8, !9, i64 12, !9, i64 16, !9, i64 20} +; NOT_CGSCC_NPM: [[META9:![0-9]+]] = !{!"float", !5, i64 0} +; NOT_CGSCC_NPM: [[TBAA10]] = !{!8, !9, i64 16} +; NOT_CGSCC_NPM: [[TBAA11]] = !{!8, !9, i64 20} +; NOT_CGSCC_NPM: [[TBAA12]] = !{!8, !4, i64 0} +; NOT_CGSCC_NPM: [[TBAA13]] = !{!8, !4, i64 4} +; NOT_CGSCC_NPM: [[TBAA14]] = !{!8, !4, i64 8} +; NOT_CGSCC_NPM: [[LOOP15]] = distinct !{!15, !16} +; NOT_CGSCC_NPM: [[META16:![0-9]+]] = !{!"llvm.loop.mustprogress"} +; NOT_CGSCC_NPM: [[LOOP17]] = distinct !{!17, !16} +; NOT_CGSCC_NPM: [[LOOP18]] = distinct !{!18, !16} +; NOT_CGSCC_NPM: [[TBAA19]] = !{!5, !5, i64 0} +; NOT_CGSCC_NPM: [[LOOP20]] = distinct !{!20, !16} +; NOT_CGSCC_NPM: [[LOOP21]] = distinct !{!21, !16} +; NOT_CGSCC_NPM: [[LOOP22]] = distinct !{!22, !16} +; NOT_CGSCC_NPM: [[LOOP23]] = distinct !{!23, !16} +; NOT_CGSCC_NPM: [[LOOP24]] = distinct !{!24, !16} +; NOT_CGSCC_NPM: [[LOOP25]] = distinct !{!25, !16} +; NOT_CGSCC_NPM: [[TBAA26]] = !{!9, !9, i64 0} +; NOT_CGSCC_NPM: [[LOOP27]] = distinct !{!27, !16} +; NOT_CGSCC_NPM: [[TBAA28]] = !{!29, !29, i64 0} +; NOT_CGSCC_NPM: [[META29:![0-9]+]] = !{!"long long", !5, i64 0} +; NOT_CGSCC_NPM: [[LOOP30]] = distinct !{!30, !16} +; NOT_CGSCC_NPM: [[LOOP31]] = distinct !{!31, !16} ;. -; IS__CGSCC____: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} -; IS__CGSCC____: [[META1:![0-9]+]] = !{i32 7, !"uwtable", i32 1} -; IS__CGSCC____: [[META2:![0-9]+]] = !{!"clang version 13.0.0"} -; IS__CGSCC____: [[TBAA3]] = !{!4, !4, i64 0} -; IS__CGSCC____: [[META4:![0-9]+]] = !{!"int", !5, i64 0} -; IS__CGSCC____: [[META5:![0-9]+]] = !{!"omnipotent char", !6, i64 0} -; IS__CGSCC____: [[META6:![0-9]+]] = !{!"Simple C/C++ TBAA"} -; IS__CGSCC____: [[META7:![0-9]+]] = !{!8, !9, i64 12} -; IS__CGSCC____: [[META8:![0-9]+]] = !{!"S", !4, i64 0, !4, i64 4, !4, i64 8, !9, i64 12, !9, i64 16, !9, i64 20} -; IS__CGSCC____: [[META9:![0-9]+]] = !{!"float", !5, i64 0} -; IS__CGSCC____: [[META10:![0-9]+]] = !{!8, !9, i64 16} -; IS__CGSCC____: [[META11:![0-9]+]] = !{!8, !9, i64 20} -; IS__CGSCC____: [[META12:![0-9]+]] = !{!8, !4, i64 0} -; IS__CGSCC____: [[META13:![0-9]+]] = !{!8, !4, i64 4} -; IS__CGSCC____: [[META14:![0-9]+]] = !{!8, !4, i64 8} -; IS__CGSCC____: [[META15:![0-9]+]] = !{!5, !5, i64 0} -; IS__CGSCC____: [[META16:![0-9]+]] = distinct !{!16, !17} -; IS__CGSCC____: [[META17:![0-9]+]] = !{!"llvm.loop.mustprogress"} -; IS__CGSCC____: [[META18:![0-9]+]] = !{!9, !9, i64 0} -; IS__CGSCC____: [[META19:![0-9]+]] = distinct !{!19, !17} -; IS__CGSCC____: [[META20:![0-9]+]] = !{!21, !21, i64 0} -; IS__CGSCC____: [[META21:![0-9]+]] = !{!"long long", !5, i64 0} -; IS__CGSCC____: [[META22:![0-9]+]] = distinct !{!22, !17} -; IS__CGSCC____: [[META23:![0-9]+]] = distinct !{!23, !17} -; IS__CGSCC____: [[META24:![0-9]+]] = distinct !{!24, !17} -; IS__CGSCC____: [[META25:![0-9]+]] = distinct !{!25, !17} -; IS__CGSCC____: [[META26:![0-9]+]] = distinct !{!26, !17} -; IS__CGSCC____: [[META27:![0-9]+]] = distinct !{!27, !17} -; IS__CGSCC____: [[META28:![0-9]+]] = distinct !{!28, !17} -; IS__CGSCC____: [[META29:![0-9]+]] = distinct !{!29, !17} -; IS__CGSCC____: [[META30:![0-9]+]] = distinct !{!30, !17} -; IS__CGSCC____: [[META31:![0-9]+]] = distinct !{!31, !17} +; NOT_TUNIT_NPM: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} +; NOT_TUNIT_NPM: [[META1:![0-9]+]] = !{i32 7, !"uwtable", i32 1} +; NOT_TUNIT_NPM: [[META2:![0-9]+]] = !{!"clang version 13.0.0"} +; NOT_TUNIT_NPM: [[TBAA3]] = !{!4, !4, i64 0} +; NOT_TUNIT_NPM: [[META4:![0-9]+]] = !{!"int", !5, i64 0} +; NOT_TUNIT_NPM: [[META5:![0-9]+]] = !{!"omnipotent char", !6, i64 0} +; NOT_TUNIT_NPM: [[META6:![0-9]+]] = !{!"Simple C/C++ TBAA"} +; NOT_TUNIT_NPM: [[TBAA7]] = !{!8, !9, i64 12} +; NOT_TUNIT_NPM: [[META8:![0-9]+]] = !{!"S", !4, i64 0, !4, i64 4, !4, i64 8, !9, i64 12, !9, i64 16, !9, i64 20} +; NOT_TUNIT_NPM: [[META9:![0-9]+]] = !{!"float", !5, i64 0} +; NOT_TUNIT_NPM: [[TBAA10]] = !{!8, !9, i64 16} +; NOT_TUNIT_NPM: [[TBAA11]] = !{!8, !9, i64 20} +; NOT_TUNIT_NPM: [[TBAA12]] = !{!8, !4, i64 0} +; NOT_TUNIT_NPM: [[TBAA13]] = !{!8, !4, i64 4} +; NOT_TUNIT_NPM: [[TBAA14]] = !{!8, !4, i64 8} +; NOT_TUNIT_NPM: [[TBAA15]] = !{!5, !5, i64 0} +; NOT_TUNIT_NPM: [[LOOP16]] = distinct !{!16, !17} +; NOT_TUNIT_NPM: [[META17:![0-9]+]] = !{!"llvm.loop.mustprogress"} +; NOT_TUNIT_NPM: [[TBAA18]] = !{!9, !9, i64 0} +; NOT_TUNIT_NPM: [[LOOP19]] = distinct !{!19, !17} +; NOT_TUNIT_NPM: [[TBAA20]] = !{!21, !21, i64 0} +; NOT_TUNIT_NPM: [[META21:![0-9]+]] = !{!"long long", !5, i64 0} +; NOT_TUNIT_NPM: [[LOOP22]] = distinct !{!22, !17} +; NOT_TUNIT_NPM: [[LOOP23]] = distinct !{!23, !17} +; NOT_TUNIT_NPM: [[LOOP24]] = distinct !{!24, !17} +; NOT_TUNIT_NPM: [[LOOP25]] = distinct !{!25, !17} +; NOT_TUNIT_NPM: [[LOOP26]] = distinct !{!26, !17} +; NOT_TUNIT_NPM: [[LOOP27]] = distinct !{!27, !17} +; NOT_TUNIT_NPM: [[LOOP28]] = distinct !{!28, !17} +; NOT_TUNIT_NPM: [[LOOP29]] = distinct !{!29, !17} +; NOT_TUNIT_NPM: [[LOOP30]] = distinct !{!30, !17} +; NOT_TUNIT_NPM: [[LOOP31]] = distinct !{!31, !17} ;. diff --git a/llvm/test/Transforms/Attributor/value-simplify.ll b/llvm/test/Transforms/Attributor/value-simplify.ll --- a/llvm/test/Transforms/Attributor/value-simplify.ll +++ b/llvm/test/Transforms/Attributor/value-simplify.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=16 -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=16 -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:o-i64:64-f80:128-n8:16:32:64-S128" @@ -17,18 +15,18 @@ ; CHECK: @[[G:[a-zA-Z0-9_$"\\.-]+]] = internal constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (void (i8***)* @f1 to i8*), i8* bitcast (void (i1 (i8*)*)* @f2 to i8*)] } ;. define internal i32 addrspace(3)* @const_ptr_return_as3() { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@const_ptr_return_as3 -; IS__CGSCC____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: ret i32 addrspace(3)* undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@const_ptr_return_as3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret i32 addrspace(3)* undef ; ret i32 addrspace(3)* @ConstAS3Ptr } define internal i32* @const_ptr_return() { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@const_ptr_return -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32* undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@const_ptr_return +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i32* undef ; ret i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*) } @@ -54,59 +52,59 @@ ; TEST 2 : Simplify return value define i32 @return0() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@return0 -; IS__TUNIT____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@return0 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret i32 0 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@return0 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@return0 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; ret i32 0 } define i32 @return1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@return1 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32 1 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@return1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i32 1 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@return1 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 1 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@return1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i32 1 ; ret i32 1 } define i32 @test2_1(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2_1 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] -; IS__TUNIT____: if.true: -; IS__TUNIT____-NEXT: [[RET0:%.*]] = add i32 0, 1 -; IS__TUNIT____-NEXT: br label [[END:%.*]] -; IS__TUNIT____: if.false: -; IS__TUNIT____-NEXT: br label [[END]] -; IS__TUNIT____: end: -; IS__TUNIT____-NEXT: [[RET:%.*]] = phi i32 [ [[RET0]], [[IF_TRUE]] ], [ 1, [[IF_FALSE]] ] -; IS__TUNIT____-NEXT: ret i32 1 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2_1 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] -; IS__CGSCC____: if.true: -; IS__CGSCC____-NEXT: [[RET0:%.*]] = add i32 0, 1 -; IS__CGSCC____-NEXT: br label [[END:%.*]] -; IS__CGSCC____: if.false: -; IS__CGSCC____-NEXT: br label [[END]] -; IS__CGSCC____: end: -; IS__CGSCC____-NEXT: [[RET:%.*]] = phi i32 [ [[RET0]], [[IF_TRUE]] ], [ 1, [[IF_FALSE]] ] -; IS__CGSCC____-NEXT: ret i32 1 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2_1 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] +; NOT_CGSCC_NPM: if.true: +; NOT_CGSCC_NPM-NEXT: [[RET0:%.*]] = add i32 0, 1 +; NOT_CGSCC_NPM-NEXT: br label [[END:%.*]] +; NOT_CGSCC_NPM: if.false: +; NOT_CGSCC_NPM-NEXT: br label [[END]] +; NOT_CGSCC_NPM: end: +; NOT_CGSCC_NPM-NEXT: [[RET:%.*]] = phi i32 [ [[RET0]], [[IF_TRUE]] ], [ 1, [[IF_FALSE]] ] +; NOT_CGSCC_NPM-NEXT: ret i32 1 +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test2_1 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] +; NOT_TUNIT_NPM: if.true: +; NOT_TUNIT_NPM-NEXT: [[RET0:%.*]] = add i32 0, 1 +; NOT_TUNIT_NPM-NEXT: br label [[END:%.*]] +; NOT_TUNIT_NPM: if.false: +; NOT_TUNIT_NPM-NEXT: br label [[END]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: [[RET:%.*]] = phi i32 [ [[RET0]], [[IF_TRUE]] ], [ 1, [[IF_FALSE]] ] +; NOT_TUNIT_NPM-NEXT: ret i32 1 ; br i1 %c, label %if.true, label %if.false if.true: @@ -126,15 +124,15 @@ define i32 @test2_2(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test2_2 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32 1 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test2_2 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i32 1 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test2_2 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 1 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test2_2 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i32 1 ; %ret = tail call i32 @test2_1(i1 %c) ret i32 %ret @@ -225,23 +223,23 @@ } define i32 @ipccp1(i32 %a) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp1 -; IS__TUNIT____-SAME: (i32 returned [[A:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: br i1 true, label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: ret i32 [[A]] -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp1 -; IS__CGSCC____-SAME: (i32 returned [[A:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: br i1 true, label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i32 [[A]] -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ipccp1 +; NOT_CGSCC_NPM-SAME: (i32 returned [[A:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: br i1 true, label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: ret i32 [[A]] +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ipccp1 +; NOT_TUNIT_NPM-SAME: (i32 returned [[A:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: br i1 true, label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: ret i32 [[A]] +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: unreachable ; br i1 true, label %t, label %f t: @@ -252,14 +250,14 @@ } define internal i1 @ipccp2i(i1 %a) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp2i -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: br label [[T:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i1 undef -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ipccp2i +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: br label [[T:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: ret i1 undef +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: unreachable ; br i1 %a, label %t, label %f t: @@ -270,29 +268,29 @@ } define i1 @ipccp2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp2 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 true +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ipccp2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i1 true ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp2 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 true +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ipccp2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i1 true ; %r = call i1 @ipccp2i(i1 true) ret i1 %r } define internal i1 @ipccp2ib(i1 %a) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp2ib -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: br label [[T:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i1 undef -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ipccp2ib +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: br label [[T:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: ret i1 undef +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: unreachable ; br i1 %a, label %t, label %f t: @@ -303,29 +301,29 @@ } define i1 @ipccp2b() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp2b -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 true +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ipccp2b +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i1 true ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp2b -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 true +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ipccp2b +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i1 true ; %r = call i1 @ipccp2ib(i1 true) ret i1 %r } define internal i32 @ipccp3i(i32 %a) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp3i -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: br label [[T:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ipccp3i +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: br label [[T:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: unreachable ; %c = icmp eq i32 %a, 7 br i1 %c, label %t, label %f @@ -337,29 +335,29 @@ } define i32 @ipccp3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp3 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32 7 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ipccp3 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i32 7 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp3 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 7 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ipccp3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i32 7 ; %r = call i32 @ipccp3i(i32 7) ret i32 %r } define internal i32 @ipccp4ia(i1 %c) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp4ia -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: br label [[T:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ipccp4ia +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: br label [[T:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: unreachable ; br i1 %c, label %t, label %f t: @@ -368,15 +366,15 @@ ret i32 1 } define internal i32 @ipccp4ib(i32 %a) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp4ib -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: [[C:%.*]] = icmp eq i32 7, 7 -; IS__CGSCC____-NEXT: br i1 true, label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i32 undef -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ipccp4ib +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i32 7, 7 +; NOT_TUNIT_NPM-NEXT: br i1 true, label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: ret i32 undef +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: unreachable ; %c = icmp eq i32 %a, 7 br i1 %c, label %t, label %f @@ -388,23 +386,23 @@ } define i32 @ipccp4(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp4 -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: br label [[F]] -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp4 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: br label [[F]] -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ipccp4 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: br label [[F]] +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: ret i32 0 +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@ipccp4 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: br label [[F]] +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; br i1 %c, label %t, label %f t: @@ -418,73 +416,61 @@ ; Do not touch complicated arguments (for now) %struct.X = type { i8* } define internal i32* @test_inalloca(i32* inalloca(i32) %a) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_inalloca -; IS__TUNIT____-SAME: (i32* noalias nofree nonnull returned writeonly inalloca(i32) dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32* [[A]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_inalloca +; NOT_CGSCC_NPM-SAME: (i32* noalias nofree nonnull returned writeonly inalloca(i32) dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i32* [[A]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_inalloca -; IS__CGSCC____-SAME: (i32* noalias nofree noundef nonnull returned writeonly inalloca(i32) dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32* [[A]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_inalloca +; NOT_TUNIT_NPM-SAME: (i32* noalias nofree noundef nonnull returned writeonly inalloca(i32) dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i32* [[A]] ; ret i32* %a } define i32* @complicated_args_inalloca(i32* %arg) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@complicated_args_inalloca -; IS__TUNIT____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: [[CALL:%.*]] = call nonnull dereferenceable(4) i32* @test_inalloca(i32* noalias nofree writeonly inalloca(i32) "no-capture-maybe-returned" [[ARG]]) #[[ATTR1]] -; IS__TUNIT____-NEXT: ret i32* [[CALL]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_inalloca +; NOT_CGSCC_NPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call nonnull dereferenceable(4) i32* @test_inalloca(i32* noalias nofree writeonly inalloca(i32) "no-capture-maybe-returned" [[ARG]]) #[[ATTR1]] +; NOT_CGSCC_NPM-NEXT: ret i32* [[CALL]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@complicated_args_inalloca -; IS__CGSCC____-SAME: (i32* nofree noundef nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32* [[ARG]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_inalloca +; NOT_TUNIT_NPM-SAME: (i32* nofree noundef nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i32* [[ARG]] ; %call = call i32* @test_inalloca(i32* inalloca(i32) %arg) ret i32* %call } define internal i32* @test_preallocated(i32* preallocated(i32) %a) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_preallocated -; IS__TUNIT____-SAME: (i32* noalias nofree noundef nonnull returned writeonly preallocated(i32) align 4294967296 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32* [[A]] +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_preallocated +; NOT_CGSCC_NPM-SAME: (i32* noalias nofree noundef nonnull returned writeonly preallocated(i32) align 4294967296 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i32* [[A]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_preallocated -; IS__CGSCC____-SAME: (i32* noalias nofree noundef nonnull returned writeonly preallocated(i32) align 4294967296 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32* [[A]] +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_preallocated +; NOT_TUNIT_NPM-SAME: (i32* noalias nofree noundef nonnull returned writeonly preallocated(i32) align 4294967296 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i32* [[A]] ; ret i32* %a } define i32* @complicated_args_preallocated() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_preallocated -; IS__TUNIT_OPM-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR5:[0-9]+]] -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call noundef nonnull align 4294967296 dereferenceable(4) i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 4294967296 null) #[[ATTR1]] [ "preallocated"(token [[C]]) ] -; IS__TUNIT_OPM-NEXT: ret i32* [[CALL]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_preallocated -; IS__TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR4:[0-9]+]] -; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call noundef nonnull align 4294967296 dereferenceable(4) i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 4294967296 null) #[[ATTR1]] [ "preallocated"(token [[C]]) ] -; IS__TUNIT_NPM-NEXT: ret i32* [[CALL]] -; -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_preallocated -; IS__CGSCC_OPM-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR5:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32* null -; -; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_preallocated -; IS__CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR4:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32* null +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_preallocated +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR4:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call noundef nonnull align 4294967296 dereferenceable(4) i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 4294967296 null) #[[ATTR1]] [ "preallocated"(token [[C]]) ] +; NOT_CGSCC_NPM-NEXT: ret i32* [[CALL]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_preallocated +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR4:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret i32* null ; %c = call token @llvm.call.preallocated.setup(i32 1) %call = call i32* @test_preallocated(i32* preallocated(i32) null) ["preallocated"(token %c)] @@ -493,17 +479,17 @@ define internal void @test_sret(%struct.X* sret(%struct.X) %a, %struct.X** %b) { ; -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_sret -; IS__TUNIT____-SAME: (%struct.X* noalias nofree noundef nonnull writeonly sret([[STRUCT_X:%.*]]) align 4294967296 dereferenceable(8) [[A:%.*]], %struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__TUNIT____-NEXT: store %struct.X* [[A]], %struct.X** [[B]], align 8 -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_sret +; NOT_CGSCC_NPM-SAME: (%struct.X* noalias nofree noundef nonnull writeonly sret([[STRUCT_X:%.*]]) align 4294967296 dereferenceable(8) [[A:%.*]], %struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: store %struct.X* [[A]], %struct.X** [[B]], align 8 +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_sret -; IS__CGSCC____-SAME: (%struct.X* noalias nofree noundef nonnull writeonly sret([[STRUCT_X:%.*]]) align 4294967296 dereferenceable(8) [[A:%.*]], %struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: store %struct.X* [[A]], %struct.X** [[B]], align 8 -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_sret +; NOT_TUNIT_NPM-SAME: (%struct.X* noalias nofree noundef nonnull writeonly sret([[STRUCT_X:%.*]]) align 4294967296 dereferenceable(8) [[A:%.*]], %struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: store %struct.X* [[A]], %struct.X** [[B]], align 8 +; NOT_TUNIT_NPM-NEXT: ret void ; store %struct.X* %a, %struct.X** %b ret void @@ -512,39 +498,39 @@ define void @complicated_args_sret(%struct.X** %b) { ; ; -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@complicated_args_sret -; IS__TUNIT____-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly sret([[STRUCT_X:%.*]]) align 4294967296 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) #[[ATTR3:[0-9]+]] -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_sret +; NOT_CGSCC_NPM-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly sret([[STRUCT_X:%.*]]) align 4294967296 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) #[[ATTR3:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@complicated_args_sret -; IS__CGSCC____-SAME: (%struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_sret +; NOT_TUNIT_NPM-SAME: (%struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: unreachable ; call void @test_sret(%struct.X* sret(%struct.X) null, %struct.X** %b) ret void } define internal %struct.X* @test_nest(%struct.X* nest %a) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_nest -; IS__CGSCC____-SAME: (%struct.X* nest noalias nocapture nofree readnone align 4294967296 [[A:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret %struct.X* undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_nest +; NOT_TUNIT_NPM-SAME: (%struct.X* nest noalias nocapture nofree readnone align 4294967296 [[A:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret %struct.X* undef ; ret %struct.X* %a } define %struct.X* @complicated_args_nest() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@complicated_args_nest -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret %struct.X* null +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_nest +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret %struct.X* null ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@complicated_args_nest -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret %struct.X* null +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_nest +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret %struct.X* null ; %call = call %struct.X* @test_nest(%struct.X* null) ret %struct.X* %call @@ -552,67 +538,43 @@ @S = external global %struct.X define internal void @test_byval(%struct.X* byval(%struct.X) %a) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test_byval -; IS__TUNIT_OPM-SAME: (%struct.X* noalias nocapture nofree noundef nonnull writeonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A]], i32 0, i32 0 -; IS__TUNIT_OPM-NEXT: store i8* null, i8** [[G0]], align 8 -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test_byval -; IS__TUNIT_NPM-SAME: (i8* [[TMP0:%.*]]) #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8 -; IS__TUNIT_NPM-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8** -; IS__TUNIT_NPM-NEXT: store i8* [[TMP0]], i8** [[A_PRIV_CAST]], align 8 -; IS__TUNIT_NPM-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0 -; IS__TUNIT_NPM-NEXT: store i8* null, i8** [[G0]], align 8 -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_byval -; IS__CGSCC_OPM-SAME: (%struct.X* noalias nocapture nofree noundef nonnull writeonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A]], i32 0, i32 0 -; IS__CGSCC_OPM-NEXT: store i8* null, i8** [[G0]], align 8 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_byval -; IS__CGSCC_NPM-SAME: (i8* noalias nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8 -; IS__CGSCC_NPM-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8** -; IS__CGSCC_NPM-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0 -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_byval +; NOT_CGSCC_NPM-SAME: (i8* [[TMP0:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8 +; NOT_CGSCC_NPM-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8** +; NOT_CGSCC_NPM-NEXT: store i8* [[TMP0]], i8** [[A_PRIV_CAST]], align 8 +; NOT_CGSCC_NPM-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: store i8* null, i8** [[G0]], align 8 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_byval +; NOT_TUNIT_NPM-SAME: (i8* noalias nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8 +; NOT_TUNIT_NPM-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8** +; NOT_TUNIT_NPM-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: ret void ; %g0 = getelementptr %struct.X, %struct.X* %a, i32 0, i32 0 store i8* null, i8** %g0 ret void } define void @complicated_args_byval() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_byval -; IS__TUNIT_OPM-SAME: () #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: call void @test_byval(%struct.X* nocapture nofree noundef nonnull readonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) @S) #[[ATTR3]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_byval -; IS__TUNIT_NPM-SAME: () #[[ATTR3]] { -; IS__TUNIT_NPM-NEXT: [[S_CAST:%.*]] = bitcast %struct.X* @S to i8** -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i8*, i8** [[S_CAST]], align 8 -; IS__TUNIT_NPM-NEXT: call void @test_byval(i8* [[TMP1]]) #[[ATTR3]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_byval -; IS__CGSCC_OPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: call void @test_byval(%struct.X* noalias nocapture nofree noundef nonnull readnone byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) @S) #[[ATTR6:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_byval -; IS__CGSCC_NPM-SAME: () #[[ATTR1]] { -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_byval +; NOT_CGSCC_NPM-SAME: () #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: [[S_CAST:%.*]] = bitcast %struct.X* @S to i8** +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i8*, i8** [[S_CAST]], align 8 +; NOT_CGSCC_NPM-NEXT: call void @test_byval(i8* [[TMP1]]) #[[ATTR3]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_byval +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret void ; call void @test_byval(%struct.X* byval(%struct.X) @S) ret void @@ -621,32 +583,26 @@ declare void @sync() ; Make sure we *do not* load @S here! define internal i8*@test_byval2(%struct.X* byval(%struct.X) %a) { -; IS________OPM-LABEL: define {{[^@]+}}@test_byval2 -; IS________OPM-SAME: (%struct.X* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) [[A:%.*]]) { -; IS________OPM-NEXT: call void @sync() -; IS________OPM-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A]], i32 0, i32 0 -; IS________OPM-NEXT: [[L:%.*]] = load i8*, i8** [[G0]], align 8 -; IS________OPM-NEXT: ret i8* [[L]] -; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test_byval2 -; IS__TUNIT_NPM-SAME: (i8* [[TMP0:%.*]]) { -; IS__TUNIT_NPM-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8 -; IS__TUNIT_NPM-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8** -; IS__TUNIT_NPM-NEXT: store i8* [[TMP0]], i8** [[A_PRIV_CAST]], align 8 -; IS__TUNIT_NPM-NEXT: call void @sync() -; IS__TUNIT_NPM-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0 -; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i8*, i8** [[G0]], align 8 -; IS__TUNIT_NPM-NEXT: ret i8* [[L]] -; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_byval2 -; IS__CGSCC_NPM-SAME: (i8* noalias nofree readnone returned "no-capture-maybe-returned" [[TMP0:%.*]]) { -; IS__CGSCC_NPM-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8 -; IS__CGSCC_NPM-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8** -; IS__CGSCC_NPM-NEXT: store i8* [[TMP0]], i8** [[A_PRIV_CAST]], align 8 -; IS__CGSCC_NPM-NEXT: call void @sync() -; IS__CGSCC_NPM-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0 -; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i8*, i8** [[G0]], align 8 -; IS__CGSCC_NPM-NEXT: ret i8* [[TMP0]] +; +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_byval2 +; NOT_CGSCC_NPM-SAME: (i8* [[TMP0:%.*]]) { +; NOT_CGSCC_NPM-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8 +; NOT_CGSCC_NPM-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8** +; NOT_CGSCC_NPM-NEXT: store i8* [[TMP0]], i8** [[A_PRIV_CAST]], align 8 +; NOT_CGSCC_NPM-NEXT: call void @sync() +; NOT_CGSCC_NPM-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i8*, i8** [[G0]], align 8 +; NOT_CGSCC_NPM-NEXT: ret i8* [[L]] +; +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_byval2 +; NOT_TUNIT_NPM-SAME: (i8* noalias nofree readnone returned "no-capture-maybe-returned" [[TMP0:%.*]]) { +; NOT_TUNIT_NPM-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8 +; NOT_TUNIT_NPM-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8** +; NOT_TUNIT_NPM-NEXT: store i8* [[TMP0]], i8** [[A_PRIV_CAST]], align 8 +; NOT_TUNIT_NPM-NEXT: call void @sync() +; NOT_TUNIT_NPM-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: [[L:%.*]] = load i8*, i8** [[G0]], align 8 +; NOT_TUNIT_NPM-NEXT: ret i8* [[TMP0]] ; call void @sync() %g0 = getelementptr %struct.X, %struct.X* %a, i32 0, i32 0 @@ -655,121 +611,69 @@ } define i8* @complicated_args_byval2() { ; -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_byval2() { -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = call i8* @test_byval2(%struct.X* nocapture nofree noundef nonnull readonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) @S) -; IS__TUNIT_OPM-NEXT: ret i8* [[C]] -; -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_byval2() { -; IS__TUNIT_NPM-NEXT: [[S_CAST:%.*]] = bitcast %struct.X* @S to i8** -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i8*, i8** [[S_CAST]], align 8 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = call i8* @test_byval2(i8* [[TMP1]]) -; IS__TUNIT_NPM-NEXT: ret i8* [[C]] ; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_byval2() { -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call i8* @test_byval2(%struct.X* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) @S) -; IS__CGSCC_OPM-NEXT: ret i8* [[C]] +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_byval2() { +; NOT_CGSCC_NPM-NEXT: [[S_CAST:%.*]] = bitcast %struct.X* @S to i8** +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i8*, i8** [[S_CAST]], align 8 +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = call i8* @test_byval2(i8* [[TMP1]]) +; NOT_CGSCC_NPM-NEXT: ret i8* [[C]] ; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_byval2() { -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = load i8*, i8** getelementptr inbounds ([[STRUCT_X:%.*]], %struct.X* @S, i32 0, i32 0), align 8 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call i8* @test_byval2(i8* noalias nofree readnone "no-capture-maybe-returned" [[TMP1]]) -; IS__CGSCC_NPM-NEXT: ret i8* [[TMP1]] +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_byval2() { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i8*, i8** getelementptr inbounds ([[STRUCT_X:%.*]], %struct.X* @S, i32 0, i32 0), align 8 +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = call i8* @test_byval2(i8* noalias nofree readnone "no-capture-maybe-returned" [[TMP1]]) +; NOT_TUNIT_NPM-NEXT: ret i8* [[TMP1]] ; %c = call i8* @test_byval2(%struct.X* byval(%struct.X) @S) ret i8* %c } define void @fixpoint_changed(i32* %p) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fixpoint_changed -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_OPM: for.cond: -; IS__TUNIT_OPM-NEXT: [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[J_0]], 30 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]] -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: switch i32 [[J_0]], label [[SW_EPILOG]] [ -; IS__TUNIT_OPM-NEXT: i32 1, label [[SW_BB:%.*]] -; IS__TUNIT_OPM-NEXT: ] -; IS__TUNIT_OPM: sw.bb: -; IS__TUNIT_OPM-NEXT: br label [[SW_EPILOG]] -; IS__TUNIT_OPM: sw.epilog: -; IS__TUNIT_OPM-NEXT: [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ] -; IS__TUNIT_OPM-NEXT: store i32 [[X_0]], i32* [[P]], align 4 -; IS__TUNIT_OPM-NEXT: [[INC]] = add nsw i32 [[J_0]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND]] -; IS__TUNIT_OPM: for.end: -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fixpoint_changed -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_NPM: for.cond: -; IS__TUNIT_NPM-NEXT: [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[J_0]], 30 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]] -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: switch i32 [[J_0]], label [[SW_EPILOG]] [ -; IS__TUNIT_NPM-NEXT: i32 1, label [[SW_BB:%.*]] -; IS__TUNIT_NPM-NEXT: ] -; IS__TUNIT_NPM: sw.bb: -; IS__TUNIT_NPM-NEXT: br label [[SW_EPILOG]] -; IS__TUNIT_NPM: sw.epilog: -; IS__TUNIT_NPM-NEXT: [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ] -; IS__TUNIT_NPM-NEXT: store i32 [[X_0]], i32* [[P]], align 4 -; IS__TUNIT_NPM-NEXT: [[INC]] = add nsw i32 [[J_0]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND]] -; IS__TUNIT_NPM: for.end: -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fixpoint_changed -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_OPM: for.cond: -; IS__CGSCC_OPM-NEXT: [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[J_0]], 30 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]] -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: switch i32 [[J_0]], label [[SW_EPILOG]] [ -; IS__CGSCC_OPM-NEXT: i32 1, label [[SW_BB:%.*]] -; IS__CGSCC_OPM-NEXT: ] -; IS__CGSCC_OPM: sw.bb: -; IS__CGSCC_OPM-NEXT: br label [[SW_EPILOG]] -; IS__CGSCC_OPM: sw.epilog: -; IS__CGSCC_OPM-NEXT: [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ] -; IS__CGSCC_OPM-NEXT: store i32 [[X_0]], i32* [[P]], align 4 -; IS__CGSCC_OPM-NEXT: [[INC]] = add nsw i32 [[J_0]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]] -; IS__CGSCC_OPM: for.end: -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fixpoint_changed -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR2]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_NPM: for.cond: -; IS__CGSCC_NPM-NEXT: [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[J_0]], 30 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]] -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: switch i32 [[J_0]], label [[SW_EPILOG]] [ -; IS__CGSCC_NPM-NEXT: i32 1, label [[SW_BB:%.*]] -; IS__CGSCC_NPM-NEXT: ] -; IS__CGSCC_NPM: sw.bb: -; IS__CGSCC_NPM-NEXT: br label [[SW_EPILOG]] -; IS__CGSCC_NPM: sw.epilog: -; IS__CGSCC_NPM-NEXT: [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ] -; IS__CGSCC_NPM-NEXT: store i32 [[X_0]], i32* [[P]], align 4 -; IS__CGSCC_NPM-NEXT: [[INC]] = add nsw i32 [[J_0]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND]] -; IS__CGSCC_NPM: for.end: -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@fixpoint_changed +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] +; NOT_CGSCC_NPM: for.cond: +; NOT_CGSCC_NPM-NEXT: [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[J_0]], 30 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]] +; NOT_CGSCC_NPM: for.body: +; NOT_CGSCC_NPM-NEXT: switch i32 [[J_0]], label [[SW_EPILOG]] [ +; NOT_CGSCC_NPM-NEXT: i32 1, label [[SW_BB:%.*]] +; NOT_CGSCC_NPM-NEXT: ] +; NOT_CGSCC_NPM: sw.bb: +; NOT_CGSCC_NPM-NEXT: br label [[SW_EPILOG]] +; NOT_CGSCC_NPM: sw.epilog: +; NOT_CGSCC_NPM-NEXT: [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ] +; NOT_CGSCC_NPM-NEXT: store i32 [[X_0]], i32* [[P]], align 4 +; NOT_CGSCC_NPM-NEXT: [[INC]] = add nsw i32 [[J_0]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND]] +; NOT_CGSCC_NPM: for.end: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fixpoint_changed +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] +; NOT_TUNIT_NPM: for.cond: +; NOT_TUNIT_NPM-NEXT: [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[J_0]], 30 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]] +; NOT_TUNIT_NPM: for.body: +; NOT_TUNIT_NPM-NEXT: switch i32 [[J_0]], label [[SW_EPILOG]] [ +; NOT_TUNIT_NPM-NEXT: i32 1, label [[SW_BB:%.*]] +; NOT_TUNIT_NPM-NEXT: ] +; NOT_TUNIT_NPM: sw.bb: +; NOT_TUNIT_NPM-NEXT: br label [[SW_EPILOG]] +; NOT_TUNIT_NPM: sw.epilog: +; NOT_TUNIT_NPM-NEXT: [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ] +; NOT_TUNIT_NPM-NEXT: store i32 [[X_0]], i32* [[P]], align 4 +; NOT_TUNIT_NPM-NEXT: [[INC]] = add nsw i32 [[J_0]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND]] +; NOT_TUNIT_NPM: for.end: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: br label %for.cond @@ -799,140 +703,128 @@ ; Check we merge undef and a constant properly. define i8 @caller0() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller0 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 49 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller0 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i8 49 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller0 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 49 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller0 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i8 49 ; %c = call i8 @callee(i8 undef) ret i8 %c } define i8 @caller1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller1 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 49 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i8 49 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller1 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 49 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i8 49 ; %c = call i8 @callee(i8 undef) ret i8 %c } define i8 @caller2() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller2 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 49 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i8 49 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller2 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 49 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i8 49 ; %c = call i8 @callee(i8 undef) ret i8 %c } define i8 @caller_middle() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller_middle -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 49 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller_middle +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i8 49 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller_middle -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 49 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller_middle +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i8 49 ; %c = call i8 @callee(i8 42) ret i8 %c } define i8 @caller3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller3 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 49 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller3 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i8 49 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller3 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 49 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i8 49 ; %c = call i8 @callee(i8 undef) ret i8 %c } define i8 @caller4() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@caller4 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 49 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller4 +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i8 49 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@caller4 -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 49 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@caller4 +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i8 49 ; %c = call i8 @callee(i8 undef) ret i8 %c } define internal i8 @callee(i8 %a) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@callee -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i8 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callee +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i8 undef ; %c = add i8 %a, 7 ret i8 %c } define void @user_as3() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@user_as3 -; IS__TUNIT____-SAME: () #[[ATTR3]] { -; IS__TUNIT____-NEXT: store i32 0, i32 addrspace(3)* @ConstAS3Ptr, align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@user_as3 -; IS__CGSCC_OPM-SAME: () #[[ATTR4:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: store i32 0, i32 addrspace(3)* @ConstAS3Ptr, align 4 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@user_as3 -; IS__CGSCC_NPM-SAME: () #[[ATTR3:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: store i32 0, i32 addrspace(3)* @ConstAS3Ptr, align 4 -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@user_as3 +; NOT_CGSCC_NPM-SAME: () #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: store i32 0, i32 addrspace(3)* @ConstAS3Ptr, align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@user_as3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR3:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: store i32 0, i32 addrspace(3)* @ConstAS3Ptr, align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; %call = call fastcc i32 addrspace(3)* @const_ptr_return_as3() store i32 0, i32 addrspace(3)* %call ret void } define void @user() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@user -; IS__TUNIT____-SAME: () #[[ATTR3]] { -; IS__TUNIT____-NEXT: store i32 0, i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*), align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@user -; IS__CGSCC_OPM-SAME: () #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: store i32 0, i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*), align 4 -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@user -; IS__CGSCC_NPM-SAME: () #[[ATTR3]] { -; IS__CGSCC_NPM-NEXT: store i32 0, i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*), align 4 -; IS__CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@user +; NOT_CGSCC_NPM-SAME: () #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: store i32 0, i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*), align 4 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@user +; NOT_TUNIT_NPM-SAME: () #[[ATTR3]] { +; NOT_TUNIT_NPM-NEXT: store i32 0, i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*), align 4 +; NOT_TUNIT_NPM-NEXT: ret void ; %call = call fastcc i32* @const_ptr_return() store i32 0, i32* %call @@ -941,28 +833,28 @@ define i1 @test_merge_with_undef_values_ptr(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 false +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i1 false ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 false +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i1 false ; %r1 = call i1 @undef_then_null(i1 %c, i32* undef, i32* undef) ret i1 %r1 } define internal i1 @undef_then_null(i1 %c, i32* %i32Aptr, i32* %i32Bptr) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@undef_then_null -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] -; IS__CGSCC____: a: -; IS__CGSCC____-NEXT: ret i1 undef -; IS__CGSCC____: b: -; IS__CGSCC____-NEXT: ret i1 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@undef_then_null +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] +; NOT_TUNIT_NPM: a: +; NOT_TUNIT_NPM-NEXT: ret i1 undef +; NOT_TUNIT_NPM: b: +; NOT_TUNIT_NPM-NEXT: ret i1 undef ; %cmp1 = icmp eq i32* %i32Aptr, %i32Bptr %cmp2 = icmp eq i1 %cmp1, false @@ -976,29 +868,29 @@ } define i1 @test_merge_with_undef_values(i1 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_merge_with_undef_values -; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 false +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i1 false ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_merge_with_undef_values -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 false +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i1 false ; %r1 = call i1 @undef_then_1(i1 %c, i32 undef, i32 undef) ret i1 %r1 } define internal i1 @undef_then_1(i1 %c, i32 %i32A, i32 %i32B) { ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@undef_then_1 -; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] -; IS__CGSCC____: a: -; IS__CGSCC____-NEXT: ret i1 undef -; IS__CGSCC____: b: -; IS__CGSCC____-NEXT: ret i1 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@undef_then_1 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] +; NOT_TUNIT_NPM: a: +; NOT_TUNIT_NPM-NEXT: ret i1 undef +; NOT_TUNIT_NPM: b: +; NOT_TUNIT_NPM-NEXT: ret i1 undef ; %cmp1 = icmp eq i32 %i32A, %i32B %cmp2 = icmp eq i1 %cmp1, false @@ -1012,55 +904,55 @@ } define i32 @test_select(i32 %c) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_select -; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i32 42 +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_select +; NOT_CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i32 42 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_select -; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 42 +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_select +; NOT_TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i32 42 ; %call = call i32 @select(i1 1, i32 42, i32 %c) ret i32 %call } define internal i32 @select(i1 %a, i32 %b, i32 %c) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@select -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i32 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@select +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i32 undef ; %s = select i1 %a, i32 %b, i32 %c ret i32 %s } define i1 @icmp() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@icmp -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 true +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@icmp +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i1 true ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@icmp -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 true +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@icmp +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i1 true ; %c = icmp eq i8* null, null ret i1 %c } define void @test_callee_is_undef(void (i32)* %fn) { -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_callee_is_undef -; IS__TUNIT____-SAME: (void (i32)* nocapture nofree [[FN:%.*]]) { -; IS__TUNIT____-NEXT: call void @callee_is_undef() -; IS__TUNIT____-NEXT: call void @unknown_calle_arg_is_undef(void (i32)* nocapture nofree [[FN]]) -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_callee_is_undef +; NOT_CGSCC_NPM-SAME: (void (i32)* nocapture nofree [[FN:%.*]]) { +; NOT_CGSCC_NPM-NEXT: call void @callee_is_undef() +; NOT_CGSCC_NPM-NEXT: call void @unknown_calle_arg_is_undef(void (i32)* nocapture nofree [[FN]]) +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_callee_is_undef -; IS__CGSCC____-SAME: (void (i32)* nocapture nofree [[FN:%.*]]) { -; IS__CGSCC____-NEXT: unreachable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_callee_is_undef +; NOT_TUNIT_NPM-SAME: (void (i32)* nocapture nofree [[FN:%.*]]) { +; NOT_TUNIT_NPM-NEXT: unreachable ; call void @callee_is_undef(void ()* undef) call void @unknown_calle_arg_is_undef(void (i32)* %fn, i32 undef) @@ -1068,14 +960,14 @@ } define internal void @callee_is_undef(void ()* %fn) { ; -; IS__TUNIT____-LABEL: define {{[^@]+}}@callee_is_undef() { -; IS__TUNIT____-NEXT: call void undef() -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@callee_is_undef() { +; NOT_CGSCC_NPM-NEXT: call void undef() +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@callee_is_undef -; IS__CGSCC____-SAME: (void ()* nocapture nofree noundef nonnull [[FN:%.*]]) { -; IS__CGSCC____-NEXT: call void [[FN]]() -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callee_is_undef +; NOT_TUNIT_NPM-SAME: (void ()* nocapture nofree noundef nonnull [[FN:%.*]]) { +; NOT_TUNIT_NPM-NEXT: call void [[FN]]() +; NOT_TUNIT_NPM-NEXT: ret void ; call void %fn() ret void @@ -1097,21 +989,21 @@ @g = internal constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (void (i8***)* @f1 to i8*), i8* bitcast (void (i1 (i8*)*)* @f2 to i8*)] } define internal void @f1(i8*** %a) { -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@f1 -; IS__TUNIT____-SAME: (i8*** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[X:%.*]] = getelementptr { [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0 -; IS__TUNIT____-NEXT: store i8** [[X]], i8*** [[A]], align 8 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC____-SAME: (i8*** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR2]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[X:%.*]] = getelementptr { [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0 -; IS__CGSCC____-NEXT: store i8** [[X]], i8*** [[A]], align 8 -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f1 +; NOT_CGSCC_NPM-SAME: (i8*** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR2]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[X:%.*]] = getelementptr { [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0 +; NOT_CGSCC_NPM-NEXT: store i8** [[X]], i8*** [[A]], align 8 +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f1 +; NOT_TUNIT_NPM-SAME: (i8*** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR2]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = getelementptr { [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0 +; NOT_TUNIT_NPM-NEXT: store i8** [[X]], i8*** [[A]], align 8 +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %x = getelementptr { [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0 @@ -1170,24 +1062,24 @@ define i1 @test_cmp_null_after_cast() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@test_cmp_null_after_cast -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 true +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_cmp_null_after_cast +; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: ret i1 true ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_cmp_null_after_cast -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 true +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@test_cmp_null_after_cast +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i1 true ; %c = call i1 @cmp_null_after_cast(i32 0, i8 0) ret i1 %c } define internal i1 @cmp_null_after_cast(i32 %a, i8 %b) { -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@cmp_null_after_cast -; IS__CGSCC____-SAME: () #[[ATTR1]] { -; IS__CGSCC____-NEXT: ret i1 undef +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@cmp_null_after_cast +; NOT_TUNIT_NPM-SAME: () #[[ATTR1]] { +; NOT_TUNIT_NPM-NEXT: ret i1 undef ; %t = trunc i32 %a to i8 %c = icmp eq i8 %t, %b @@ -1270,32 +1162,17 @@ } ;. -; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind writeonly } -; IS__TUNIT_OPM: attributes #[[ATTR5]] = { willreturn } -;. -; IS__TUNIT_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn writeonly } -; IS__TUNIT_NPM: attributes #[[ATTR4]] = { willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_OPM: attributes #[[ATTR5]] = { willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR6]] = { nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC_NPM: attributes #[[ATTR4]] = { willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind willreturn writeonly } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { willreturn } ;. ; CHECK: [[RNG0]] = !{i32 0, i32 -2147483648} ;. diff --git a/llvm/test/Transforms/Attributor/willreturn.ll b/llvm/test/Transforms/Attributor/willreturn.ll --- a/llvm/test/Transforms/Attributor/willreturn.ll +++ b/llvm/test/Transforms/Attributor/willreturn.ll @@ -1,7 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=16 -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=16 -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-i54:64-f80:128-n8:16:32:64-S128" @@ -12,15 +10,15 @@ ; TEST 1 (positive case) define void @only_return() #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@only_return -; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@only_return +; NOT_CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@only_return -; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@only_return +; NOT_TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: ret void ; ret void } @@ -35,65 +33,36 @@ ; FIXME: missing willreturn define i32 @fib(i32 %0) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fib -; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] -; IS__TUNIT_OPM: 3: -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR15:[0-9]+]] -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR15]] -; IS__TUNIT_OPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP8]] -; IS__TUNIT_OPM: 9: -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP0]] -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fib -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] -; IS__TUNIT_NPM: 3: -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR16:[0-9]+]] -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR16]] -; IS__TUNIT_NPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP8]] -; IS__TUNIT_NPM: 9: -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP0]] -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fib -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR26:[0-9]+]] -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR26]] -; IS__CGSCC_OPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP8]] -; IS__CGSCC_OPM: 9: -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP0]] -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fib -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR28:[0-9]+]] -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR28]] -; IS__CGSCC_NPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP8]] -; IS__CGSCC_NPM: 9: -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP0]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@fib +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] +; NOT_CGSCC_NPM: 3: +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 +; NOT_CGSCC_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR16:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 +; NOT_CGSCC_NPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR16]] +; NOT_CGSCC_NPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP8]] +; NOT_CGSCC_NPM: 9: +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP0]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fib +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] +; NOT_TUNIT_NPM: 3: +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 +; NOT_TUNIT_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR28:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 +; NOT_TUNIT_NPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR28]] +; NOT_TUNIT_NPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP8]] +; NOT_TUNIT_NPM: 9: +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP0]] ; %2 = icmp slt i32 %0, 2 br i1 %2, label %9, label %3 @@ -121,41 +90,41 @@ ; fact_maybe_not(-1) doesn't stop. define i32 @fact_maybe_not_halt(i32 %0) local_unnamed_addr #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@fact_maybe_not_halt -; IS__TUNIT____-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__TUNIT____-NEXT: br i1 [[TMP2]], label [[TMP11:%.*]], label [[TMP3:%.*]] -; IS__TUNIT____: 3: -; IS__TUNIT____-NEXT: [[TMP4:%.*]] = phi i32 [ [[TMP8:%.*]], [[TMP3]] ], [ [[TMP0]], [[TMP1:%.*]] ] -; IS__TUNIT____-NEXT: [[TMP5:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP3]] ], [ 1, [[TMP1]] ] -; IS__TUNIT____-NEXT: [[TMP6:%.*]] = icmp sgt i32 [[TMP4]], 0 -; IS__TUNIT____-NEXT: [[TMP7:%.*]] = sext i1 [[TMP6]] to i32 -; IS__TUNIT____-NEXT: [[TMP8]] = add nsw i32 [[TMP4]], [[TMP7]] -; IS__TUNIT____-NEXT: [[TMP9]] = mul nsw i32 [[TMP4]], [[TMP5]] -; IS__TUNIT____-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP8]], 0 -; IS__TUNIT____-NEXT: br i1 [[TMP10]], label [[TMP11]], label [[TMP3]] -; IS__TUNIT____: 11: -; IS__TUNIT____-NEXT: [[TMP12:%.*]] = phi i32 [ 1, [[TMP1]] ], [ [[TMP9]], [[TMP3]] ] -; IS__TUNIT____-NEXT: ret i32 [[TMP12]] -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@fact_maybe_not_halt -; IS__CGSCC____-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__CGSCC____-NEXT: br i1 [[TMP2]], label [[TMP11:%.*]], label [[TMP3:%.*]] -; IS__CGSCC____: 3: -; IS__CGSCC____-NEXT: [[TMP4:%.*]] = phi i32 [ [[TMP8:%.*]], [[TMP3]] ], [ [[TMP0]], [[TMP1:%.*]] ] -; IS__CGSCC____-NEXT: [[TMP5:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP3]] ], [ 1, [[TMP1]] ] -; IS__CGSCC____-NEXT: [[TMP6:%.*]] = icmp sgt i32 [[TMP4]], 0 -; IS__CGSCC____-NEXT: [[TMP7:%.*]] = sext i1 [[TMP6]] to i32 -; IS__CGSCC____-NEXT: [[TMP8]] = add nsw i32 [[TMP4]], [[TMP7]] -; IS__CGSCC____-NEXT: [[TMP9]] = mul nsw i32 [[TMP4]], [[TMP5]] -; IS__CGSCC____-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP8]], 0 -; IS__CGSCC____-NEXT: br i1 [[TMP10]], label [[TMP11]], label [[TMP3]] -; IS__CGSCC____: 11: -; IS__CGSCC____-NEXT: [[TMP12:%.*]] = phi i32 [ 1, [[TMP1]] ], [ [[TMP9]], [[TMP3]] ] -; IS__CGSCC____-NEXT: ret i32 [[TMP12]] +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@fact_maybe_not_halt +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP2]], label [[TMP11:%.*]], label [[TMP3:%.*]] +; NOT_CGSCC_NPM: 3: +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ [[TMP8:%.*]], [[TMP3]] ], [ [[TMP0]], [[TMP1:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP5:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP3]] ], [ 1, [[TMP1]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP6:%.*]] = icmp sgt i32 [[TMP4]], 0 +; NOT_CGSCC_NPM-NEXT: [[TMP7:%.*]] = sext i1 [[TMP6]] to i32 +; NOT_CGSCC_NPM-NEXT: [[TMP8]] = add nsw i32 [[TMP4]], [[TMP7]] +; NOT_CGSCC_NPM-NEXT: [[TMP9]] = mul nsw i32 [[TMP4]], [[TMP5]] +; NOT_CGSCC_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP8]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP10]], label [[TMP11]], label [[TMP3]] +; NOT_CGSCC_NPM: 11: +; NOT_CGSCC_NPM-NEXT: [[TMP12:%.*]] = phi i32 [ 1, [[TMP1]] ], [ [[TMP9]], [[TMP3]] ] +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP12]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fact_maybe_not_halt +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP2]], label [[TMP11:%.*]], label [[TMP3:%.*]] +; NOT_TUNIT_NPM: 3: +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ [[TMP8:%.*]], [[TMP3]] ], [ [[TMP0]], [[TMP1:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP5:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP3]] ], [ 1, [[TMP1]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP6:%.*]] = icmp sgt i32 [[TMP4]], 0 +; NOT_TUNIT_NPM-NEXT: [[TMP7:%.*]] = sext i1 [[TMP6]] to i32 +; NOT_TUNIT_NPM-NEXT: [[TMP8]] = add nsw i32 [[TMP4]], [[TMP7]] +; NOT_TUNIT_NPM-NEXT: [[TMP9]] = mul nsw i32 [[TMP4]], [[TMP5]] +; NOT_TUNIT_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP8]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP10]], label [[TMP11]], label [[TMP3]] +; NOT_TUNIT_NPM: 11: +; NOT_TUNIT_NPM-NEXT: [[TMP12:%.*]] = phi i32 [ 1, [[TMP1]] ], [ [[TMP9]], [[TMP3]] ] +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP12]] ; %2 = icmp eq i32 %0, 0 br i1 %2, label %11, label %3 @@ -187,69 +156,38 @@ ; } define i32 @fact_loop(i32 %0) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fact_loop -; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__TUNIT_OPM: 3: -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP4]] -; IS__TUNIT_OPM: 5: -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_OPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__TUNIT_OPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__TUNIT_OPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__TUNIT_OPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fact_loop -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__TUNIT_NPM: 3: -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP4]] -; IS__TUNIT_NPM: 5: -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__TUNIT_NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__TUNIT_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__TUNIT_NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fact_loop -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP4]] -; IS__CGSCC_OPM: 5: -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_OPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__CGSCC_OPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fact_loop -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP4]] -; IS__CGSCC_NPM: 5: -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__CGSCC_NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__CGSCC_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__CGSCC_NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@fact_loop +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; NOT_CGSCC_NPM: 3: +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP4]] +; NOT_CGSCC_NPM: 5: +; NOT_CGSCC_NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] +; NOT_CGSCC_NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 +; NOT_CGSCC_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@fact_loop +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; NOT_TUNIT_NPM: 3: +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP4]] +; NOT_TUNIT_NPM: 5: +; NOT_TUNIT_NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] +; NOT_TUNIT_NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 +; NOT_TUNIT_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] ; %2 = icmp slt i32 %0, 1 br i1 %2, label %3, label %5 @@ -279,49 +217,28 @@ declare void @sink() nounwind willreturn nosync nofree define void @mutual_recursion1(i1 %c) #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__TUNIT_OPM: rec: -; IS__TUNIT_OPM-NEXT: call void @sink() #[[ATTR11:[0-9]+]] -; IS__TUNIT_OPM-NEXT: call void @mutual_recursion2(i1 [[C]]) #[[ATTR23:[0-9]+]] -; IS__TUNIT_OPM-NEXT: br label [[END]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__TUNIT_NPM: rec: -; IS__TUNIT_NPM-NEXT: call void @sink() #[[ATTR11:[0-9]+]] -; IS__TUNIT_NPM-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) #[[ATTR25:[0-9]+]] -; IS__TUNIT_NPM-NEXT: br label [[END]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__CGSCC_OPM: rec: -; IS__CGSCC_OPM-NEXT: call void @sink() #[[ATTR14:[0-9]+]] -; IS__CGSCC_OPM-NEXT: call void @mutual_recursion2(i1 [[C]]) #[[ATTR27:[0-9]+]] -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__CGSCC_NPM: rec: -; IS__CGSCC_NPM-NEXT: call void @sink() #[[ATTR14:[0-9]+]] -; IS__CGSCC_NPM-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) #[[ATTR29:[0-9]+]] -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion1 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR3:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] +; NOT_CGSCC_NPM: rec: +; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR11:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) #[[ATTR25:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: br label [[END]] +; NOT_CGSCC_NPM: end: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@mutual_recursion1 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR4:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] +; NOT_TUNIT_NPM: rec: +; NOT_TUNIT_NPM-NEXT: call void @sink() #[[ATTR14:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) #[[ATTR29:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: br label [[END]] +; NOT_TUNIT_NPM: end: +; NOT_TUNIT_NPM-NEXT: ret void ; br i1 %c, label %rec, label %end rec: @@ -334,29 +251,18 @@ define void @mutual_recursion2(i1 %c) #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR23]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__TUNIT_NPM-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR25]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR27]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { -; IS__CGSCC_NPM-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR29]] -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion2 +; NOT_CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; NOT_CGSCC_NPM-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR25]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@mutual_recursion2 +; NOT_TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { +; NOT_TUNIT_NPM-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR29]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @mutual_recursion1(i1 %c) ret void @@ -370,17 +276,17 @@ declare void @exit(i32 %0) local_unnamed_addr noreturn define void @only_exit() local_unnamed_addr #0 { -; IS__TUNIT____: Function Attrs: noinline noreturn nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@only_exit -; IS__TUNIT____-SAME: () local_unnamed_addr #[[ATTR5:[0-9]+]] { -; IS__TUNIT____-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR4:[0-9]+]] -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: noinline noreturn nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@only_exit -; IS__CGSCC____-SAME: () local_unnamed_addr #[[ATTR6:[0-9]+]] { -; IS__CGSCC____-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5:[0-9]+]] -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: noinline noreturn nounwind uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@only_exit +; NOT_CGSCC_NPM-SAME: () local_unnamed_addr #[[ATTR5:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR4:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: noinline noreturn nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@only_exit +; NOT_TUNIT_NPM-SAME: () local_unnamed_addr #[[ATTR6:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: unreachable ; tail call void @exit(i32 0) unreachable @@ -397,41 +303,41 @@ ; return; ; } define void @conditional_exit(i32 %0, i32* nocapture readonly %1) local_unnamed_addr #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@conditional_exit -; IS__TUNIT____-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR6:[0-9]+]] { -; IS__TUNIT____-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__TUNIT____-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] -; IS__TUNIT____: 4: -; IS__TUNIT____-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR4]] -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: 5: -; IS__TUNIT____-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP1]], align 4 -; IS__TUNIT____-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 0 -; IS__TUNIT____-NEXT: br i1 [[TMP7]], label [[TMP9:%.*]], label [[TMP8:%.*]] -; IS__TUNIT____: 8: -; IS__TUNIT____-NEXT: tail call void @exit(i32 noundef 1) #[[ATTR4]] -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: 9: -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: noinline nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@conditional_exit -; IS__CGSCC____-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 -; IS__CGSCC____-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] -; IS__CGSCC____: 4: -; IS__CGSCC____-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5]] -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: 5: -; IS__CGSCC____-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP1]], align 4 -; IS__CGSCC____-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 0 -; IS__CGSCC____-NEXT: br i1 [[TMP7]], label [[TMP9:%.*]], label [[TMP8:%.*]] -; IS__CGSCC____: 8: -; IS__CGSCC____-NEXT: tail call void @exit(i32 noundef 1) #[[ATTR5]] -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: 9: -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: noinline nounwind uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@conditional_exit +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR6:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] +; NOT_CGSCC_NPM: 4: +; NOT_CGSCC_NPM-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: 5: +; NOT_CGSCC_NPM-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP1]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP7]], label [[TMP9:%.*]], label [[TMP8:%.*]] +; NOT_CGSCC_NPM: 8: +; NOT_CGSCC_NPM-NEXT: tail call void @exit(i32 noundef 1) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: 9: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: noinline nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@conditional_exit +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] +; NOT_TUNIT_NPM: 4: +; NOT_TUNIT_NPM-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5]] +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: 5: +; NOT_TUNIT_NPM-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP1]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP7]], label [[TMP9:%.*]], label [[TMP8:%.*]] +; NOT_TUNIT_NPM: 8: +; NOT_TUNIT_NPM-NEXT: tail call void @exit(i32 noundef 1) #[[ATTR5]] +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: 9: +; NOT_TUNIT_NPM-NEXT: ret void ; %3 = icmp eq i32 %0, 0 br i1 %3, label %5, label %4 @@ -460,44 +366,33 @@ declare float @llvm.floor.f32(float) define void @call_floor(float %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@call_floor -; IS__TUNIT____-SAME: (float [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret void +; 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:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_floor -; IS__CGSCC____-SAME: (float [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: ret void +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@call_floor +; NOT_TUNIT_NPM-SAME: (float [[A:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: ret void ; tail call float @llvm.floor.f32(float %a) ret void } define float @call_floor2(float %a) #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@call_floor2 -; IS__TUNIT_OPM-SAME: (float [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR24:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret float [[C]] -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@call_floor2 -; IS__TUNIT_NPM-SAME: (float [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR26:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret float [[C]] -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@call_floor2 -; IS__CGSCC_OPM-SAME: (float [[A:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR28:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret float [[C]] -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@call_floor2 -; IS__CGSCC_NPM-SAME: (float [[A:%.*]]) #[[ATTR9:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR30:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret float [[C]] +; +; 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:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR26:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret float [[C]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@call_floor2 +; NOT_TUNIT_NPM-SAME: (float [[A:%.*]]) #[[ATTR9:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR30:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret float [[C]] ; %c = tail call float @llvm.floor.f32(float %a) ret float %c @@ -513,29 +408,18 @@ declare void @maybe_noreturn() #0 define void @call_maybe_noreturn() #0 { -; IS__TUNIT_OPM: Function Attrs: noinline nounwind uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@call_maybe_noreturn -; IS__TUNIT_OPM-SAME: () #[[ATTR6]] { -; IS__TUNIT_OPM-NEXT: tail call void @maybe_noreturn() #[[ATTR25:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: noinline nounwind uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@call_maybe_noreturn -; IS__TUNIT_NPM-SAME: () #[[ATTR6]] { -; IS__TUNIT_NPM-NEXT: tail call void @maybe_noreturn() #[[ATTR27:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@call_maybe_noreturn -; IS__CGSCC_OPM-SAME: () #[[ATTR7]] { -; IS__CGSCC_OPM-NEXT: tail call void @maybe_noreturn() #[[ATTR29:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@call_maybe_noreturn -; IS__CGSCC_NPM-SAME: () #[[ATTR7]] { -; IS__CGSCC_NPM-NEXT: tail call void @maybe_noreturn() #[[ATTR31:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: noinline nounwind uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@call_maybe_noreturn +; NOT_CGSCC_NPM-SAME: () #[[ATTR6]] { +; NOT_CGSCC_NPM-NEXT: tail call void @maybe_noreturn() #[[ATTR27:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: noinline nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@call_maybe_noreturn +; NOT_TUNIT_NPM-SAME: () #[[ATTR7]] { +; NOT_TUNIT_NPM-NEXT: tail call void @maybe_noreturn() #[[ATTR31:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret void ; tail call void @maybe_noreturn() ret void @@ -550,46 +434,35 @@ declare void @will_return() willreturn norecurse define void @f1() #0 { -; IS__TUNIT_OPM: Function Attrs: noinline nounwind uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@f1 -; IS__TUNIT_OPM-SAME: () #[[ATTR9:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: tail call void @will_return() #[[ATTR26:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: noinline nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@f1 -; IS__TUNIT_NPM-SAME: () #[[ATTR9:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: tail call void @will_return() #[[ATTR28:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: noinline norecurse nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC_OPM-SAME: () #[[ATTR11:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: tail call void @will_return() #[[ATTR30:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: noinline norecurse nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f1 -; IS__CGSCC_NPM-SAME: () #[[ATTR11:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: tail call void @will_return() #[[ATTR32:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: noinline nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR9:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: tail call void @will_return() #[[ATTR28:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: noinline norecurse nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR11:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: tail call void @will_return() #[[ATTR32:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret void ; tail call void @will_return() ret void } define void @f2() #0 { -; IS__TUNIT____: Function Attrs: noinline nounwind uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@f2 -; IS__TUNIT____-SAME: () #[[ATTR9:[0-9]+]] { -; IS__TUNIT____-NEXT: tail call void @f1() #[[ATTR11:[0-9]+]] -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: noinline norecurse nounwind uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@f2 -; IS__CGSCC____-SAME: () #[[ATTR11:[0-9]+]] { -; IS__CGSCC____-NEXT: tail call void @f1() #[[ATTR14:[0-9]+]] -; IS__CGSCC____-NEXT: ret void +; NOT_CGSCC_NPM: Function Attrs: noinline nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@f2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR9]] { +; NOT_CGSCC_NPM-NEXT: tail call void @f1() #[[ATTR11]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: noinline norecurse nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@f2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR11]] { +; NOT_TUNIT_NPM-NEXT: tail call void @f1() #[[ATTR14]] +; NOT_TUNIT_NPM-NEXT: ret void ; tail call void @f1() ret void @@ -600,25 +473,25 @@ ; call willreturn function in endless loop. define void @call_will_return_but_has_loop() #0 { -; IS__TUNIT____: Function Attrs: noinline noreturn nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@call_will_return_but_has_loop -; IS__TUNIT____-SAME: () #[[ATTR5]] { -; IS__TUNIT____-NEXT: br label [[LABEL1:%.*]] -; IS__TUNIT____: label1: -; IS__TUNIT____-NEXT: tail call void @will_return() -; IS__TUNIT____-NEXT: br label [[LABEL2:%.*]] -; IS__TUNIT____: label2: -; IS__TUNIT____-NEXT: br label [[LABEL1]] -; -; IS__CGSCC____: Function Attrs: noinline norecurse noreturn nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_will_return_but_has_loop -; IS__CGSCC____-SAME: () #[[ATTR12:[0-9]+]] { -; IS__CGSCC____-NEXT: br label [[LABEL1:%.*]] -; IS__CGSCC____: label1: -; IS__CGSCC____-NEXT: tail call void @will_return() -; IS__CGSCC____-NEXT: br label [[LABEL2:%.*]] -; IS__CGSCC____: label2: -; IS__CGSCC____-NEXT: br label [[LABEL1]] +; NOT_CGSCC_NPM: Function Attrs: noinline noreturn nounwind uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@call_will_return_but_has_loop +; NOT_CGSCC_NPM-SAME: () #[[ATTR5]] { +; NOT_CGSCC_NPM-NEXT: br label [[LABEL1:%.*]] +; NOT_CGSCC_NPM: label1: +; NOT_CGSCC_NPM-NEXT: tail call void @will_return() +; NOT_CGSCC_NPM-NEXT: br label [[LABEL2:%.*]] +; NOT_CGSCC_NPM: label2: +; NOT_CGSCC_NPM-NEXT: br label [[LABEL1]] +; +; NOT_TUNIT_NPM: Function Attrs: noinline norecurse noreturn nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@call_will_return_but_has_loop +; NOT_TUNIT_NPM-SAME: () #[[ATTR12:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: br label [[LABEL1:%.*]] +; NOT_TUNIT_NPM: label1: +; NOT_TUNIT_NPM-NEXT: tail call void @will_return() +; NOT_TUNIT_NPM-NEXT: br label [[LABEL2:%.*]] +; NOT_TUNIT_NPM: label2: +; NOT_TUNIT_NPM-NEXT: br label [[LABEL1]] ; br label %label1 label1: @@ -637,53 +510,30 @@ declare i1 @maybe_raise_exception() #1 willreturn define void @invoke_test() personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT_OPM: Function Attrs: nounwind willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@invoke_test -; IS__TUNIT_OPM-SAME: () #[[ATTR11]] personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR26]] -; IS__TUNIT_OPM-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] -; IS__TUNIT_OPM: N: -; IS__TUNIT_OPM-NEXT: ret void -; IS__TUNIT_OPM: F: -; IS__TUNIT_OPM-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } -; IS__TUNIT_OPM-NEXT: catch i8* null -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@invoke_test -; IS__TUNIT_NPM-SAME: () #[[ATTR11]] personality i32 (...)* @__gxx_personality_v0 { -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR28]] -; IS__TUNIT_NPM-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] -; IS__TUNIT_NPM: N: -; IS__TUNIT_NPM-NEXT: ret void -; IS__TUNIT_NPM: F: -; IS__TUNIT_NPM-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } -; IS__TUNIT_NPM-NEXT: catch i8* null -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nounwind willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@invoke_test -; IS__CGSCC_OPM-SAME: () #[[ATTR14]] personality i32 (...)* @__gxx_personality_v0 { -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR30]] -; IS__CGSCC_OPM-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] -; IS__CGSCC_OPM: N: -; IS__CGSCC_OPM-NEXT: ret void -; IS__CGSCC_OPM: F: -; IS__CGSCC_OPM-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } -; IS__CGSCC_OPM-NEXT: catch i8* null -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@invoke_test -; IS__CGSCC_NPM-SAME: () #[[ATTR14]] personality i32 (...)* @__gxx_personality_v0 { -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR32]] -; IS__CGSCC_NPM-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] -; IS__CGSCC_NPM: N: -; IS__CGSCC_NPM-NEXT: ret void -; IS__CGSCC_NPM: F: -; IS__CGSCC_NPM-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } -; IS__CGSCC_NPM-NEXT: catch i8* null -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: nounwind willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@invoke_test +; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] personality i32 (...)* @__gxx_personality_v0 { +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR28]] +; NOT_CGSCC_NPM-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] +; NOT_CGSCC_NPM: N: +; NOT_CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: F: +; NOT_CGSCC_NPM-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } +; NOT_CGSCC_NPM-NEXT: catch i8* null +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nounwind willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@invoke_test +; NOT_TUNIT_NPM-SAME: () #[[ATTR14]] personality i32 (...)* @__gxx_personality_v0 { +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR32]] +; NOT_TUNIT_NPM-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] +; NOT_TUNIT_NPM: N: +; NOT_TUNIT_NPM-NEXT: ret void +; NOT_TUNIT_NPM: F: +; NOT_TUNIT_NPM-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } +; NOT_TUNIT_NPM-NEXT: catch i8* null +; NOT_TUNIT_NPM-NEXT: ret void ; invoke i1 @maybe_raise_exception() to label %N unwind label %F @@ -709,69 +559,38 @@ ; } define i32 @loop_constant_trip_count(i32* nocapture readonly %0) #0 { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@loop_constant_trip_count -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly [[TMP0:%.*]]) #[[ATTR12:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: br label [[TMP3:%.*]] -; IS__TUNIT_OPM: 2: -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP8:%.*]] -; IS__TUNIT_OPM: 3: -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__TUNIT_OPM-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 -; IS__TUNIT_OPM-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@loop_constant_trip_count -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) #[[ATTR12:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: br label [[TMP3:%.*]] -; IS__TUNIT_NPM: 2: -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP8:%.*]] -; IS__TUNIT_NPM: 3: -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__TUNIT_NPM-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 -; IS__TUNIT_NPM-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@loop_constant_trip_count -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readonly [[TMP0:%.*]]) #[[ATTR15:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br label [[TMP3:%.*]] -; IS__CGSCC_OPM: 2: -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP8:%.*]] -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__CGSCC_OPM-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@loop_constant_trip_count -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) #[[ATTR15:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br label [[TMP3:%.*]] -; IS__CGSCC_NPM: 2: -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP8:%.*]] -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__CGSCC_NPM-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 -; IS__CGSCC_NPM-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@loop_constant_trip_count +; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) #[[ATTR12:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: br label [[TMP3:%.*]] +; NOT_CGSCC_NPM: 2: +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP8:%.*]] +; NOT_CGSCC_NPM: 3: +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] +; NOT_CGSCC_NPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] +; NOT_CGSCC_NPM-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 +; NOT_CGSCC_NPM-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@loop_constant_trip_count +; NOT_TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) #[[ATTR15:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: br label [[TMP3:%.*]] +; NOT_TUNIT_NPM: 2: +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP8:%.*]] +; NOT_TUNIT_NPM: 3: +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] +; NOT_TUNIT_NPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] +; NOT_TUNIT_NPM-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 +; NOT_TUNIT_NPM-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] ; br label %3 @@ -801,81 +620,44 @@ ; return ans; ; } define i32 @loop_trip_count_unbound(i32 %0, i32 %1, i32* nocapture readonly %2, i32 %3) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@loop_trip_count_unbound -; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR12]] { -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] -; IS__TUNIT_OPM-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] -; IS__TUNIT_OPM: 6: -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP7]] -; IS__TUNIT_OPM: 8: -; IS__TUNIT_OPM-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] -; IS__TUNIT_OPM-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] -; IS__TUNIT_OPM-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 -; IS__TUNIT_OPM-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] -; IS__TUNIT_OPM-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] -; IS__TUNIT_OPM-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] -; IS__TUNIT_OPM-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] -; IS__TUNIT_OPM-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@loop_trip_count_unbound -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR13:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] -; IS__TUNIT_NPM-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] -; IS__TUNIT_NPM: 6: -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP7]] -; IS__TUNIT_NPM: 8: -; IS__TUNIT_NPM-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] -; IS__TUNIT_NPM-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] -; IS__TUNIT_NPM-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 -; IS__TUNIT_NPM-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] -; IS__TUNIT_NPM-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] -; IS__TUNIT_NPM-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] -; IS__TUNIT_NPM-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] -; IS__TUNIT_NPM-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@loop_trip_count_unbound -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR15]] { -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] -; IS__CGSCC_OPM: 6: -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP7]] -; IS__CGSCC_OPM: 8: -; IS__CGSCC_OPM-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] -; IS__CGSCC_OPM-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 -; IS__CGSCC_OPM-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] -; IS__CGSCC_OPM-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] -; IS__CGSCC_OPM-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] -; IS__CGSCC_OPM-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@loop_trip_count_unbound -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR16:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] -; IS__CGSCC_NPM-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] -; IS__CGSCC_NPM: 6: -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP7]] -; IS__CGSCC_NPM: 8: -; IS__CGSCC_NPM-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] -; IS__CGSCC_NPM-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] -; IS__CGSCC_NPM-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 -; IS__CGSCC_NPM-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] -; IS__CGSCC_NPM-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] -; IS__CGSCC_NPM-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] -; IS__CGSCC_NPM-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] -; IS__CGSCC_NPM-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@loop_trip_count_unbound +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR13:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] +; NOT_CGSCC_NPM: 6: +; NOT_CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP7]] +; NOT_CGSCC_NPM: 8: +; NOT_CGSCC_NPM-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 +; NOT_CGSCC_NPM-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] +; NOT_CGSCC_NPM-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] +; NOT_CGSCC_NPM-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] +; NOT_CGSCC_NPM-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@loop_trip_count_unbound +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR16:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] +; NOT_TUNIT_NPM: 6: +; NOT_TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP7]] +; NOT_TUNIT_NPM: 8: +; NOT_TUNIT_NPM-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 +; NOT_TUNIT_NPM-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] +; NOT_TUNIT_NPM-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] +; NOT_TUNIT_NPM-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] +; NOT_TUNIT_NPM-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] ; %5 = icmp eq i32 %0, %1 br i1 %5, label %6, label %8 @@ -909,89 +691,48 @@ define i32 @loop_trip_dec(i32 %0, i32* nocapture readonly %1) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@loop_trip_dec -; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR12]] { -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] -; IS__TUNIT_OPM: 4: -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 -; IS__TUNIT_OPM-NEXT: br label [[TMP6:%.*]] -; IS__TUNIT_OPM: 6: -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] -; IS__TUNIT_OPM-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] -; IS__TUNIT_OPM-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] -; IS__TUNIT_OPM-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] -; IS__TUNIT_OPM-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 -; IS__TUNIT_OPM-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] -; IS__TUNIT_OPM: 14: -; IS__TUNIT_OPM-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP15]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@loop_trip_dec -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR12]] { -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] -; IS__TUNIT_NPM: 4: -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 -; IS__TUNIT_NPM-NEXT: br label [[TMP6:%.*]] -; IS__TUNIT_NPM: 6: -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] -; IS__TUNIT_NPM-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] -; IS__TUNIT_NPM-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] -; IS__TUNIT_NPM-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] -; IS__TUNIT_NPM-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 -; IS__TUNIT_NPM-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] -; IS__TUNIT_NPM: 14: -; IS__TUNIT_NPM-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP15]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@loop_trip_dec -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR15]] { -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] -; IS__CGSCC_OPM: 4: -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 -; IS__CGSCC_OPM-NEXT: br label [[TMP6:%.*]] -; IS__CGSCC_OPM: 6: -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] -; IS__CGSCC_OPM-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] -; IS__CGSCC_OPM-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] -; IS__CGSCC_OPM-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 -; IS__CGSCC_OPM-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] -; IS__CGSCC_OPM: 14: -; IS__CGSCC_OPM-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP15]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@loop_trip_dec -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR15]] { -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] -; IS__CGSCC_NPM: 4: -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 -; IS__CGSCC_NPM-NEXT: br label [[TMP6:%.*]] -; IS__CGSCC_NPM: 6: -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] -; IS__CGSCC_NPM-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] -; IS__CGSCC_NPM-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] -; IS__CGSCC_NPM-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] -; IS__CGSCC_NPM-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 -; IS__CGSCC_NPM-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] -; IS__CGSCC_NPM: 14: -; IS__CGSCC_NPM-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP15]] +; +; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@loop_trip_dec +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR12]] { +; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] +; NOT_CGSCC_NPM: 4: +; NOT_CGSCC_NPM-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 +; NOT_CGSCC_NPM-NEXT: br label [[TMP6:%.*]] +; NOT_CGSCC_NPM: 6: +; NOT_CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] +; NOT_CGSCC_NPM-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 +; NOT_CGSCC_NPM-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] +; NOT_CGSCC_NPM-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 +; NOT_CGSCC_NPM-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] +; NOT_CGSCC_NPM: 14: +; NOT_CGSCC_NPM-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP15]] +; +; NOT_TUNIT_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@loop_trip_dec +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR15]] { +; NOT_TUNIT_NPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] +; NOT_TUNIT_NPM: 4: +; NOT_TUNIT_NPM-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 +; NOT_TUNIT_NPM-NEXT: br label [[TMP6:%.*]] +; NOT_TUNIT_NPM: 6: +; NOT_TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] +; NOT_TUNIT_NPM-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 +; NOT_TUNIT_NPM-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] +; NOT_TUNIT_NPM-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 +; NOT_TUNIT_NPM-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] +; NOT_TUNIT_NPM: 14: +; NOT_TUNIT_NPM-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP15]] ; %3 = icmp sgt i32 %0, -1 br i1 %3, label %4, label %14 @@ -1019,25 +760,25 @@ ; multiple return define i32 @multiple_return(i32 %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@multiple_return -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: [[B:%.*]] = icmp eq i32 [[A]], 0 -; IS__TUNIT____-NEXT: br i1 [[B]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT____: t: -; IS__TUNIT____-NEXT: ret i32 1 -; IS__TUNIT____: f: -; IS__TUNIT____-NEXT: ret i32 0 -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@multiple_return -; IS__CGSCC____-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[B:%.*]] = icmp eq i32 [[A]], 0 -; IS__CGSCC____-NEXT: br i1 [[B]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC____: t: -; IS__CGSCC____-NEXT: ret i32 1 -; IS__CGSCC____: f: -; IS__CGSCC____-NEXT: ret i32 0 +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@multiple_return +; NOT_CGSCC_NPM-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = icmp eq i32 [[A]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[B]], label [[T:%.*]], label [[F:%.*]] +; NOT_CGSCC_NPM: t: +; NOT_CGSCC_NPM-NEXT: ret i32 1 +; NOT_CGSCC_NPM: f: +; NOT_CGSCC_NPM-NEXT: ret i32 0 +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@multiple_return +; NOT_TUNIT_NPM-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = icmp eq i32 [[A]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[B]], label [[T:%.*]], label [[F:%.*]] +; NOT_TUNIT_NPM: t: +; NOT_TUNIT_NPM-NEXT: ret i32 1 +; NOT_TUNIT_NPM: f: +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; %b = icmp eq i32 %a, 0 br i1 %b, label %t, label %f @@ -1053,37 +794,22 @@ ; 15.1 (positive case) define void @unreachable_exit_positive1() #0 { -; IS__TUNIT_OPM: Function Attrs: noinline nounwind uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@unreachable_exit_positive1 -; IS__TUNIT_OPM-SAME: () #[[ATTR9]] { -; IS__TUNIT_OPM-NEXT: tail call void @will_return() #[[ATTR26]] -; IS__TUNIT_OPM-NEXT: ret void -; IS__TUNIT_OPM: unreachable_label: -; IS__TUNIT_OPM-NEXT: unreachable -; -; IS__TUNIT_NPM: Function Attrs: noinline nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive1 -; IS__TUNIT_NPM-SAME: () #[[ATTR9]] { -; IS__TUNIT_NPM-NEXT: tail call void @will_return() #[[ATTR28]] -; IS__TUNIT_NPM-NEXT: ret void -; IS__TUNIT_NPM: unreachable_label: -; IS__TUNIT_NPM-NEXT: unreachable -; -; IS__CGSCC_OPM: Function Attrs: noinline norecurse nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@unreachable_exit_positive1 -; IS__CGSCC_OPM-SAME: () #[[ATTR11]] { -; IS__CGSCC_OPM-NEXT: tail call void @will_return() #[[ATTR30]] -; IS__CGSCC_OPM-NEXT: ret void -; IS__CGSCC_OPM: unreachable_label: -; IS__CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: noinline norecurse nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive1 -; IS__CGSCC_NPM-SAME: () #[[ATTR11]] { -; IS__CGSCC_NPM-NEXT: tail call void @will_return() #[[ATTR32]] -; IS__CGSCC_NPM-NEXT: ret void -; IS__CGSCC_NPM: unreachable_label: -; IS__CGSCC_NPM-NEXT: unreachable +; +; NOT_CGSCC_NPM: Function Attrs: noinline nounwind uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR9]] { +; NOT_CGSCC_NPM-NEXT: tail call void @will_return() #[[ATTR28]] +; NOT_CGSCC_NPM-NEXT: ret void +; NOT_CGSCC_NPM: unreachable_label: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: noinline norecurse nounwind uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR11]] { +; NOT_TUNIT_NPM-NEXT: tail call void @will_return() #[[ATTR32]] +; NOT_TUNIT_NPM-NEXT: ret void +; NOT_TUNIT_NPM: unreachable_label: +; NOT_TUNIT_NPM-NEXT: unreachable ; tail call void @will_return() ret void @@ -1094,77 +820,42 @@ } define i32 @unreachable_exit_positive2(i32) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@unreachable_exit_positive2 -; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__TUNIT_OPM: 3: -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP4]] -; IS__TUNIT_OPM: 5: -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_OPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__TUNIT_OPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__TUNIT_OPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__TUNIT_OPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; IS__TUNIT_OPM: unreachable_label: -; IS__TUNIT_OPM-NEXT: unreachable -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive2 -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__TUNIT_NPM: 3: -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP4]] -; IS__TUNIT_NPM: 5: -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__TUNIT_NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__TUNIT_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__TUNIT_NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; IS__TUNIT_NPM: unreachable_label: -; IS__TUNIT_NPM-NEXT: unreachable -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@unreachable_exit_positive2 -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP4]] -; IS__CGSCC_OPM: 5: -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_OPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__CGSCC_OPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; IS__CGSCC_OPM: unreachable_label: -; IS__CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive2 -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP4]] -; IS__CGSCC_NPM: 5: -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__CGSCC_NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__CGSCC_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__CGSCC_NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; IS__CGSCC_NPM: unreachable_label: -; IS__CGSCC_NPM-NEXT: unreachable +; +; NOT_CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive2 +; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; NOT_CGSCC_NPM: 3: +; NOT_CGSCC_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] +; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP4]] +; NOT_CGSCC_NPM: 5: +; NOT_CGSCC_NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] +; NOT_CGSCC_NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 +; NOT_CGSCC_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] +; NOT_CGSCC_NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] +; NOT_CGSCC_NPM: unreachable_label: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive2 +; NOT_TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; NOT_TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; NOT_TUNIT_NPM: 3: +; NOT_TUNIT_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] +; NOT_TUNIT_NPM-NEXT: ret i32 [[TMP4]] +; NOT_TUNIT_NPM: 5: +; NOT_TUNIT_NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] +; NOT_TUNIT_NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 +; NOT_TUNIT_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] +; NOT_TUNIT_NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] +; NOT_TUNIT_NPM: unreachable_label: +; NOT_TUNIT_NPM-NEXT: unreachable ; %2 = icmp slt i32 %0, 1 br i1 %2, label %3, label %5 @@ -1190,21 +881,21 @@ ;15.2 define void @unreachable_exit_negative1() #0 { -; IS__TUNIT____: Function Attrs: noinline noreturn nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@unreachable_exit_negative1 -; IS__TUNIT____-SAME: () #[[ATTR5]] { -; IS__TUNIT____-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR4]] -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: unreachable_label: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: noinline noreturn nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@unreachable_exit_negative1 -; IS__CGSCC____-SAME: () #[[ATTR6]] { -; IS__CGSCC____-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5]] -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: unreachable_label: -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: noinline noreturn nounwind uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@unreachable_exit_negative1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR5]] { +; NOT_CGSCC_NPM-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: unreachable_label: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: noinline noreturn nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@unreachable_exit_negative1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5]] +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: unreachable_label: +; NOT_TUNIT_NPM-NEXT: unreachable ; tail call void @exit(i32 0) ret void @@ -1215,49 +906,28 @@ } define void @unreachable_exit_negative2() #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@unreachable_exit_negative2 -; IS__TUNIT_OPM-SAME: () #[[ATTR13:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: br label [[L1:%.*]] -; IS__TUNIT_OPM: L1: -; IS__TUNIT_OPM-NEXT: br label [[L2:%.*]] -; IS__TUNIT_OPM: L2: -; IS__TUNIT_OPM-NEXT: br label [[L1]] -; IS__TUNIT_OPM: unreachable_label: -; IS__TUNIT_OPM-NEXT: unreachable -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unreachable_exit_negative2 -; IS__TUNIT_NPM-SAME: () #[[ATTR14:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: br label [[L1:%.*]] -; IS__TUNIT_NPM: L1: -; IS__TUNIT_NPM-NEXT: br label [[L2:%.*]] -; IS__TUNIT_NPM: L2: -; IS__TUNIT_NPM-NEXT: br label [[L1]] -; IS__TUNIT_NPM: unreachable_label: -; IS__TUNIT_NPM-NEXT: unreachable -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@unreachable_exit_negative2 -; IS__CGSCC_OPM-SAME: () #[[ATTR16:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br label [[L1:%.*]] -; IS__CGSCC_OPM: L1: -; IS__CGSCC_OPM-NEXT: br label [[L2:%.*]] -; IS__CGSCC_OPM: L2: -; IS__CGSCC_OPM-NEXT: br label [[L1]] -; IS__CGSCC_OPM: unreachable_label: -; IS__CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@unreachable_exit_negative2 -; IS__CGSCC_NPM-SAME: () #[[ATTR17:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br label [[L1:%.*]] -; IS__CGSCC_NPM: L1: -; IS__CGSCC_NPM-NEXT: br label [[L2:%.*]] -; IS__CGSCC_NPM: L2: -; IS__CGSCC_NPM-NEXT: br label [[L1]] -; IS__CGSCC_NPM: unreachable_label: -; IS__CGSCC_NPM-NEXT: unreachable +; +; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@unreachable_exit_negative2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR14:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: br label [[L1:%.*]] +; NOT_CGSCC_NPM: L1: +; NOT_CGSCC_NPM-NEXT: br label [[L2:%.*]] +; NOT_CGSCC_NPM: L2: +; NOT_CGSCC_NPM-NEXT: br label [[L1]] +; NOT_CGSCC_NPM: unreachable_label: +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@unreachable_exit_negative2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR17:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: br label [[L1:%.*]] +; NOT_TUNIT_NPM: L1: +; NOT_TUNIT_NPM-NEXT: br label [[L2:%.*]] +; NOT_TUNIT_NPM: L2: +; NOT_TUNIT_NPM-NEXT: br label [[L1]] +; NOT_TUNIT_NPM: unreachable_label: +; NOT_TUNIT_NPM-NEXT: unreachable ; br label %L1 L1: @@ -1275,17 +945,17 @@ declare void @llvm.eh.sjlj.longjmp(i8*) define void @call_longjmp(i8* nocapture readnone %0) local_unnamed_addr #0 { -; IS__TUNIT____: Function Attrs: noinline noreturn nounwind uwtable -; IS__TUNIT____-LABEL: define {{[^@]+}}@call_longjmp -; IS__TUNIT____-SAME: (i8* nocapture readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR5]] { -; IS__TUNIT____-NEXT: tail call void @llvm.eh.sjlj.longjmp(i8* noalias readnone [[TMP0]]) #[[ATTR4]] -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: noinline noreturn nounwind uwtable -; IS__CGSCC____-LABEL: define {{[^@]+}}@call_longjmp -; IS__CGSCC____-SAME: (i8* nocapture readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR6]] { -; IS__CGSCC____-NEXT: tail call void @llvm.eh.sjlj.longjmp(i8* noalias readnone [[TMP0]]) #[[ATTR5]] -; IS__CGSCC____-NEXT: unreachable +; NOT_CGSCC_NPM: Function Attrs: noinline noreturn nounwind uwtable +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@call_longjmp +; NOT_CGSCC_NPM-SAME: (i8* nocapture readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR5]] { +; NOT_CGSCC_NPM-NEXT: tail call void @llvm.eh.sjlj.longjmp(i8* noalias readnone [[TMP0]]) #[[ATTR4]] +; NOT_CGSCC_NPM-NEXT: unreachable +; +; NOT_TUNIT_NPM: Function Attrs: noinline noreturn nounwind uwtable +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@call_longjmp +; NOT_TUNIT_NPM-SAME: (i8* nocapture readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR6]] { +; NOT_TUNIT_NPM-NEXT: tail call void @llvm.eh.sjlj.longjmp(i8* noalias readnone [[TMP0]]) #[[ATTR5]] +; NOT_TUNIT_NPM-NEXT: unreachable ; tail call void @llvm.eh.sjlj.longjmp(i8* %0) ret void @@ -1303,89 +973,48 @@ ; } define i32 @infinite_loop_inside_bounded_loop(i32 %n) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR15]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_OPM: for.cond: -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_OPM: while.cond: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_BODY:%.*]] -; IS__TUNIT_OPM: while.body: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_OPM: for.inc: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: for.end: -; IS__TUNIT_OPM-NEXT: ret i32 0 -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_NPM: for.cond: -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_NPM: while.cond: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_BODY:%.*]] -; IS__TUNIT_NPM: while.body: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_NPM: for.inc: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: for.end: -; IS__TUNIT_NPM-NEXT: ret i32 0 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR18:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_OPM: for.cond: -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_OPM: while.cond: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_BODY:%.*]] -; IS__CGSCC_OPM: while.body: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_OPM: for.inc: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: for.end: -; IS__CGSCC_OPM-NEXT: ret i32 0 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR19:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_NPM: for.cond: -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_NPM: while.cond: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_BODY:%.*]] -; IS__CGSCC_NPM: while.body: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_NPM: for.inc: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: for.end: -; IS__CGSCC_NPM-NEXT: ret i32 0 +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop +; NOT_CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] +; NOT_CGSCC_NPM: for.cond: +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_END:%.*]] +; NOT_CGSCC_NPM: for.body: +; NOT_CGSCC_NPM-NEXT: br label [[WHILE_COND:%.*]] +; NOT_CGSCC_NPM: while.cond: +; NOT_CGSCC_NPM-NEXT: br label [[WHILE_BODY:%.*]] +; NOT_CGSCC_NPM: while.body: +; NOT_CGSCC_NPM-NEXT: br label [[WHILE_COND]] +; NOT_CGSCC_NPM: for.inc: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: for.end: +; NOT_CGSCC_NPM-NEXT: ret i32 0 +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop +; NOT_TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR19:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] +; NOT_TUNIT_NPM: for.cond: +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_END:%.*]] +; NOT_TUNIT_NPM: for.body: +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_COND:%.*]] +; NOT_TUNIT_NPM: while.cond: +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_BODY:%.*]] +; NOT_TUNIT_NPM: while.body: +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_COND]] +; NOT_TUNIT_NPM: for.inc: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: for.end: +; NOT_TUNIT_NPM-NEXT: ret i32 0 ; entry: br label %for.cond @@ -1427,121 +1056,64 @@ ; } define i32 @bounded_nested_loops(i32 %n) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@bounded_nested_loops -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR15]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_OPM: for.cond: -; IS__TUNIT_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] -; IS__TUNIT_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] -; IS__TUNIT_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_OPM: while.cond: -; IS__TUNIT_OPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_OPM: while.body: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: while.end: -; IS__TUNIT_OPM-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_INC]] -; IS__TUNIT_OPM: for.inc: -; IS__TUNIT_OPM-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND]] -; IS__TUNIT_OPM: for.end: -; IS__TUNIT_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@bounded_nested_loops -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR17:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_NPM: for.cond: -; IS__TUNIT_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] -; IS__TUNIT_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] -; IS__TUNIT_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_NPM: while.cond: -; IS__TUNIT_NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_NPM: while.body: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: while.end: -; IS__TUNIT_NPM-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_INC]] -; IS__TUNIT_NPM: for.inc: -; IS__TUNIT_NPM-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND]] -; IS__TUNIT_NPM: for.end: -; IS__TUNIT_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bounded_nested_loops -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_OPM: for.cond: -; IS__CGSCC_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] -; IS__CGSCC_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] -; IS__CGSCC_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_OPM: while.cond: -; IS__CGSCC_OPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_OPM: while.body: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: while.end: -; IS__CGSCC_OPM-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_INC]] -; IS__CGSCC_OPM: for.inc: -; IS__CGSCC_OPM-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]] -; IS__CGSCC_OPM: for.end: -; IS__CGSCC_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bounded_nested_loops -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR20:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_NPM: for.cond: -; IS__CGSCC_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] -; IS__CGSCC_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] -; IS__CGSCC_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_NPM: while.cond: -; IS__CGSCC_NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_NPM: while.body: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: while.end: -; IS__CGSCC_NPM-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_INC]] -; IS__CGSCC_NPM: for.inc: -; IS__CGSCC_NPM-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND]] -; IS__CGSCC_NPM: for.end: -; IS__CGSCC_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bounded_nested_loops +; NOT_CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR17:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] +; NOT_CGSCC_NPM: for.cond: +; NOT_CGSCC_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] +; NOT_CGSCC_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup: +; NOT_CGSCC_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_END:%.*]] +; NOT_CGSCC_NPM: for.body: +; NOT_CGSCC_NPM-NEXT: br label [[WHILE_COND:%.*]] +; NOT_CGSCC_NPM: while.cond: +; NOT_CGSCC_NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] +; NOT_CGSCC_NPM: while.body: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: while.end: +; NOT_CGSCC_NPM-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_INC]] +; NOT_CGSCC_NPM: for.inc: +; NOT_CGSCC_NPM-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND]] +; NOT_CGSCC_NPM: for.end: +; NOT_CGSCC_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bounded_nested_loops +; NOT_TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR20:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] +; NOT_TUNIT_NPM: for.cond: +; NOT_TUNIT_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] +; NOT_TUNIT_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup: +; NOT_TUNIT_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_END:%.*]] +; NOT_TUNIT_NPM: for.body: +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_COND:%.*]] +; NOT_TUNIT_NPM: while.cond: +; NOT_TUNIT_NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] +; NOT_TUNIT_NPM: while.body: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: while.end: +; NOT_TUNIT_NPM-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_INC]] +; NOT_TUNIT_NPM: for.inc: +; NOT_TUNIT_NPM-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND]] +; NOT_TUNIT_NPM: for.end: +; NOT_TUNIT_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] ; entry: br label %for.cond @@ -1591,129 +1163,68 @@ ; } define i32 @bounded_loop_inside_unbounded_loop(i32 %n) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR15]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_OPM: while.cond: -; IS__TUNIT_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 -; IS__TUNIT_OPM-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 -; IS__TUNIT_OPM-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 -; IS__TUNIT_OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_OPM: while.body: -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_OPM: for.cond: -; IS__TUNIT_OPM-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_END]] -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: for.inc: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: for.end: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_OPM: while.end: -; IS__TUNIT_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_NPM: while.cond: -; IS__TUNIT_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 -; IS__TUNIT_NPM-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 -; IS__TUNIT_NPM-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 -; IS__TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_NPM: while.body: -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_NPM: for.cond: -; IS__TUNIT_NPM-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_END]] -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: for.inc: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: for.end: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_NPM: while.end: -; IS__TUNIT_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_OPM: while.cond: -; IS__CGSCC_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 -; IS__CGSCC_OPM-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 -; IS__CGSCC_OPM-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 -; IS__CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_OPM: while.body: -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_OPM: for.cond: -; IS__CGSCC_OPM-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_END]] -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: for.inc: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: for.end: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_OPM: while.end: -; IS__CGSCC_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR19]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_NPM: while.cond: -; IS__CGSCC_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 -; IS__CGSCC_NPM-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 -; IS__CGSCC_NPM-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 -; IS__CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_NPM: while.body: -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_NPM: for.cond: -; IS__CGSCC_NPM-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_END]] -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: for.inc: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: for.end: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_NPM: while.end: -; IS__CGSCC_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop +; NOT_CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[WHILE_COND:%.*]] +; NOT_CGSCC_NPM: while.cond: +; NOT_CGSCC_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 +; NOT_CGSCC_NPM-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 +; NOT_CGSCC_NPM-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 +; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] +; NOT_CGSCC_NPM: while.body: +; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 +; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] +; NOT_CGSCC_NPM: for.cond: +; NOT_CGSCC_NPM-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] +; NOT_CGSCC_NPM: for.cond.cleanup: +; NOT_CGSCC_NPM-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] +; NOT_CGSCC_NPM-NEXT: br label [[FOR_END]] +; NOT_CGSCC_NPM: for.body: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: for.inc: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: for.end: +; NOT_CGSCC_NPM-NEXT: br label [[WHILE_COND]] +; NOT_CGSCC_NPM: while.end: +; NOT_CGSCC_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] +; NOT_CGSCC_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop +; NOT_TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR19]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_COND:%.*]] +; NOT_TUNIT_NPM: while.cond: +; NOT_TUNIT_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 +; NOT_TUNIT_NPM-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 +; NOT_TUNIT_NPM-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 +; NOT_TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] +; NOT_TUNIT_NPM: while.body: +; NOT_TUNIT_NPM-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 +; NOT_TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] +; NOT_TUNIT_NPM: for.cond: +; NOT_TUNIT_NPM-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] +; NOT_TUNIT_NPM: for.cond.cleanup: +; NOT_TUNIT_NPM-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] +; NOT_TUNIT_NPM-NEXT: br label [[FOR_END]] +; NOT_TUNIT_NPM: for.body: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: for.inc: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: for.end: +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_COND]] +; NOT_TUNIT_NPM: while.end: +; NOT_TUNIT_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] +; NOT_TUNIT_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] ; entry: br label %while.cond @@ -1768,125 +1279,66 @@ ; } define i32 @nested_unbounded_loops(i32 %n) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@nested_unbounded_loops -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR15]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_OPM: while.cond: -; IS__TUNIT_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] -; IS__TUNIT_OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_OPM: while.body: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND1:%.*]] -; IS__TUNIT_OPM: while.cond1: -; IS__TUNIT_OPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] -; IS__TUNIT_OPM: while.body4: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: while.end: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND5:%.*]] -; IS__TUNIT_OPM: while.cond5: -; IS__TUNIT_OPM-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] -; IS__TUNIT_OPM: while.body8: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: while.end10: -; IS__TUNIT_OPM-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_OPM: while.end11: -; IS__TUNIT_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@nested_unbounded_loops -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_NPM: while.cond: -; IS__TUNIT_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] -; IS__TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_NPM: while.body: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND1:%.*]] -; IS__TUNIT_NPM: while.cond1: -; IS__TUNIT_NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] -; IS__TUNIT_NPM: while.body4: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: while.end: -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND5:%.*]] -; IS__TUNIT_NPM: while.cond5: -; IS__TUNIT_NPM-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] -; IS__TUNIT_NPM: while.body8: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: while.end10: -; IS__TUNIT_NPM-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_NPM: while.end11: -; IS__TUNIT_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nested_unbounded_loops -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_OPM: while.cond: -; IS__CGSCC_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] -; IS__CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_OPM: while.body: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND1:%.*]] -; IS__CGSCC_OPM: while.cond1: -; IS__CGSCC_OPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] -; IS__CGSCC_OPM: while.body4: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: while.end: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND5:%.*]] -; IS__CGSCC_OPM: while.cond5: -; IS__CGSCC_OPM-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] -; IS__CGSCC_OPM: while.body8: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: while.end10: -; IS__CGSCC_OPM-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_OPM: while.end11: -; IS__CGSCC_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@nested_unbounded_loops -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR19]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_NPM: while.cond: -; IS__CGSCC_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] -; IS__CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_NPM: while.body: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND1:%.*]] -; IS__CGSCC_NPM: while.cond1: -; IS__CGSCC_NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] -; IS__CGSCC_NPM: while.body4: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: while.end: -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND5:%.*]] -; IS__CGSCC_NPM: while.cond5: -; IS__CGSCC_NPM-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] -; IS__CGSCC_NPM: while.body8: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: while.end10: -; IS__CGSCC_NPM-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_NPM: while.end11: -; IS__CGSCC_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nested_unbounded_loops +; NOT_CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: br label [[WHILE_COND:%.*]] +; NOT_CGSCC_NPM: while.cond: +; NOT_CGSCC_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] +; NOT_CGSCC_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] +; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 +; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] +; NOT_CGSCC_NPM: while.body: +; NOT_CGSCC_NPM-NEXT: br label [[WHILE_COND1:%.*]] +; NOT_CGSCC_NPM: while.cond1: +; NOT_CGSCC_NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] +; NOT_CGSCC_NPM: while.body4: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: while.end: +; NOT_CGSCC_NPM-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 +; NOT_CGSCC_NPM-NEXT: br label [[WHILE_COND5:%.*]] +; NOT_CGSCC_NPM: while.cond5: +; NOT_CGSCC_NPM-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] +; NOT_CGSCC_NPM: while.body8: +; NOT_CGSCC_NPM-NEXT: unreachable +; NOT_CGSCC_NPM: while.end10: +; NOT_CGSCC_NPM-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] +; NOT_CGSCC_NPM-NEXT: br label [[WHILE_COND]] +; NOT_CGSCC_NPM: while.end11: +; NOT_CGSCC_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] +; NOT_CGSCC_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@nested_unbounded_loops +; NOT_TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR19]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_COND:%.*]] +; NOT_TUNIT_NPM: while.cond: +; NOT_TUNIT_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] +; NOT_TUNIT_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] +; NOT_TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 +; NOT_TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] +; NOT_TUNIT_NPM: while.body: +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_COND1:%.*]] +; NOT_TUNIT_NPM: while.cond1: +; NOT_TUNIT_NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] +; NOT_TUNIT_NPM: while.body4: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: while.end: +; NOT_TUNIT_NPM-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_COND5:%.*]] +; NOT_TUNIT_NPM: while.cond5: +; NOT_TUNIT_NPM-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] +; NOT_TUNIT_NPM: while.body8: +; NOT_TUNIT_NPM-NEXT: unreachable +; NOT_TUNIT_NPM: while.end10: +; NOT_TUNIT_NPM-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] +; NOT_TUNIT_NPM-NEXT: br label [[WHILE_COND]] +; NOT_TUNIT_NPM: while.end11: +; NOT_TUNIT_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] +; NOT_TUNIT_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] ; entry: br label %while.cond @@ -1948,125 +1400,66 @@ ; } define void @non_loop_cycle(i32 %n) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@non_loop_cycle -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR15]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR15]] -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CALL]], 5 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__TUNIT_OPM: if.then: -; IS__TUNIT_OPM-NEXT: br label [[ENTRY1:%.*]] -; IS__TUNIT_OPM: if.else: -; IS__TUNIT_OPM-NEXT: br label [[ENTRY2:%.*]] -; IS__TUNIT_OPM: entry1: -; IS__TUNIT_OPM-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR15]] -; IS__TUNIT_OPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[CALL1]], 5 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_ELSE4:%.*]] -; IS__TUNIT_OPM: if.then3: -; IS__TUNIT_OPM-NEXT: br label [[EXIT:%.*]] -; IS__TUNIT_OPM: if.else4: -; IS__TUNIT_OPM-NEXT: br label [[ENTRY2]] -; IS__TUNIT_OPM: entry2: -; IS__TUNIT_OPM-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR15]] -; IS__TUNIT_OPM-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[CALL5]], 5 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP6]], label [[IF_THEN7:%.*]], label [[IF_ELSE8:%.*]] -; IS__TUNIT_OPM: if.then7: -; IS__TUNIT_OPM-NEXT: br label [[EXIT]] -; IS__TUNIT_OPM: if.else8: -; IS__TUNIT_OPM-NEXT: br label [[ENTRY1]] -; IS__TUNIT_OPM: exit: -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@non_loop_cycle -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR16]] -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CALL]], 5 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__TUNIT_NPM: if.then: -; IS__TUNIT_NPM-NEXT: br label [[ENTRY1:%.*]] -; IS__TUNIT_NPM: if.else: -; IS__TUNIT_NPM-NEXT: br label [[ENTRY2:%.*]] -; IS__TUNIT_NPM: entry1: -; IS__TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR16]] -; IS__TUNIT_NPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[CALL1]], 5 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_ELSE4:%.*]] -; IS__TUNIT_NPM: if.then3: -; IS__TUNIT_NPM-NEXT: br label [[EXIT:%.*]] -; IS__TUNIT_NPM: if.else4: -; IS__TUNIT_NPM-NEXT: br label [[ENTRY2]] -; IS__TUNIT_NPM: entry2: -; IS__TUNIT_NPM-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR16]] -; IS__TUNIT_NPM-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[CALL5]], 5 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP6]], label [[IF_THEN7:%.*]], label [[IF_ELSE8:%.*]] -; IS__TUNIT_NPM: if.then7: -; IS__TUNIT_NPM-NEXT: br label [[EXIT]] -; IS__TUNIT_NPM: if.else8: -; IS__TUNIT_NPM-NEXT: br label [[ENTRY1]] -; IS__TUNIT_NPM: exit: -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@non_loop_cycle -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR31:[0-9]+]] -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CALL]], 5 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__CGSCC_OPM: if.then: -; IS__CGSCC_OPM-NEXT: br label [[ENTRY1:%.*]] -; IS__CGSCC_OPM: if.else: -; IS__CGSCC_OPM-NEXT: br label [[ENTRY2:%.*]] -; IS__CGSCC_OPM: entry1: -; IS__CGSCC_OPM-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR31]] -; IS__CGSCC_OPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[CALL1]], 5 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_ELSE4:%.*]] -; IS__CGSCC_OPM: if.then3: -; IS__CGSCC_OPM-NEXT: br label [[EXIT:%.*]] -; IS__CGSCC_OPM: if.else4: -; IS__CGSCC_OPM-NEXT: br label [[ENTRY2]] -; IS__CGSCC_OPM: entry2: -; IS__CGSCC_OPM-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR31]] -; IS__CGSCC_OPM-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[CALL5]], 5 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP6]], label [[IF_THEN7:%.*]], label [[IF_ELSE8:%.*]] -; IS__CGSCC_OPM: if.then7: -; IS__CGSCC_OPM-NEXT: br label [[EXIT]] -; IS__CGSCC_OPM: if.else8: -; IS__CGSCC_OPM-NEXT: br label [[ENTRY1]] -; IS__CGSCC_OPM: exit: -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@non_loop_cycle -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR19]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CALL]], 5 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] -; IS__CGSCC_NPM: if.then: -; IS__CGSCC_NPM-NEXT: br label [[ENTRY1:%.*]] -; IS__CGSCC_NPM: if.else: -; IS__CGSCC_NPM-NEXT: br label [[ENTRY2:%.*]] -; IS__CGSCC_NPM: entry1: -; IS__CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) -; IS__CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[CALL1]], 5 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_ELSE4:%.*]] -; IS__CGSCC_NPM: if.then3: -; IS__CGSCC_NPM-NEXT: br label [[EXIT:%.*]] -; IS__CGSCC_NPM: if.else4: -; IS__CGSCC_NPM-NEXT: br label [[ENTRY2]] -; IS__CGSCC_NPM: entry2: -; IS__CGSCC_NPM-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) -; IS__CGSCC_NPM-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[CALL5]], 5 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP6]], label [[IF_THEN7:%.*]], label [[IF_ELSE8:%.*]] -; IS__CGSCC_NPM: if.then7: -; IS__CGSCC_NPM-NEXT: br label [[EXIT]] -; IS__CGSCC_NPM: if.else8: -; IS__CGSCC_NPM-NEXT: br label [[ENTRY1]] -; IS__CGSCC_NPM: exit: -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_loop_cycle +; NOT_CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { +; NOT_CGSCC_NPM-NEXT: entry: +; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR16]] +; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CALL]], 5 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; NOT_CGSCC_NPM: if.then: +; NOT_CGSCC_NPM-NEXT: br label [[ENTRY1:%.*]] +; NOT_CGSCC_NPM: if.else: +; NOT_CGSCC_NPM-NEXT: br label [[ENTRY2:%.*]] +; NOT_CGSCC_NPM: entry1: +; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR16]] +; NOT_CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[CALL1]], 5 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_ELSE4:%.*]] +; NOT_CGSCC_NPM: if.then3: +; NOT_CGSCC_NPM-NEXT: br label [[EXIT:%.*]] +; NOT_CGSCC_NPM: if.else4: +; NOT_CGSCC_NPM-NEXT: br label [[ENTRY2]] +; NOT_CGSCC_NPM: entry2: +; NOT_CGSCC_NPM-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR16]] +; NOT_CGSCC_NPM-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[CALL5]], 5 +; NOT_CGSCC_NPM-NEXT: br i1 [[CMP6]], label [[IF_THEN7:%.*]], label [[IF_ELSE8:%.*]] +; NOT_CGSCC_NPM: if.then7: +; NOT_CGSCC_NPM-NEXT: br label [[EXIT]] +; NOT_CGSCC_NPM: if.else8: +; NOT_CGSCC_NPM-NEXT: br label [[ENTRY1]] +; NOT_CGSCC_NPM: exit: +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@non_loop_cycle +; NOT_TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR19]] { +; NOT_TUNIT_NPM-NEXT: entry: +; NOT_TUNIT_NPM-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) +; NOT_TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CALL]], 5 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; NOT_TUNIT_NPM: if.then: +; NOT_TUNIT_NPM-NEXT: br label [[ENTRY1:%.*]] +; NOT_TUNIT_NPM: if.else: +; NOT_TUNIT_NPM-NEXT: br label [[ENTRY2:%.*]] +; NOT_TUNIT_NPM: entry1: +; NOT_TUNIT_NPM-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) +; NOT_TUNIT_NPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[CALL1]], 5 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_ELSE4:%.*]] +; NOT_TUNIT_NPM: if.then3: +; NOT_TUNIT_NPM-NEXT: br label [[EXIT:%.*]] +; NOT_TUNIT_NPM: if.else4: +; NOT_TUNIT_NPM-NEXT: br label [[ENTRY2]] +; NOT_TUNIT_NPM: entry2: +; NOT_TUNIT_NPM-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) +; NOT_TUNIT_NPM-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[CALL5]], 5 +; NOT_TUNIT_NPM-NEXT: br i1 [[CMP6]], label [[IF_THEN7:%.*]], label [[IF_ELSE8:%.*]] +; NOT_TUNIT_NPM: if.then7: +; NOT_TUNIT_NPM-NEXT: br label [[EXIT]] +; NOT_TUNIT_NPM: if.else8: +; NOT_TUNIT_NPM-NEXT: br label [[ENTRY1]] +; NOT_TUNIT_NPM: exit: +; NOT_TUNIT_NPM-NEXT: ret void ; entry: %call = call i32 @fact_loop(i32 %n) @@ -2112,85 +1505,52 @@ declare void @readonly_mustprogress() readonly mustprogress define void @willreturn_mustprogress_caller_1() mustprogress { -; IS__TUNIT_OPM: Function Attrs: mustprogress -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 -; IS__TUNIT_OPM-SAME: () #[[ATTR18:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: call void @unknown() -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: mustprogress -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 -; IS__TUNIT_NPM-SAME: () #[[ATTR20:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: call void @unknown() -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: mustprogress -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 -; IS__CGSCC_OPM-SAME: () #[[ATTR21:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @unknown() -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: mustprogress -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 -; IS__CGSCC_NPM-SAME: () #[[ATTR23:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: call void @unknown() -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: mustprogress +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 +; NOT_CGSCC_NPM-SAME: () #[[ATTR20:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: call void @unknown() +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: mustprogress +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 +; NOT_TUNIT_NPM-SAME: () #[[ATTR23:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: call void @unknown() +; NOT_TUNIT_NPM-NEXT: ret void ; call void @unknown() ret void } define void @willreturn_mustprogress_caller_2() mustprogress { -; IS__TUNIT_OPM: Function Attrs: mustprogress readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2 -; IS__TUNIT_OPM-SAME: () #[[ATTR20:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: call void @readonly() #[[ATTR16:[0-9]+]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: mustprogress readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2 -; IS__TUNIT_NPM-SAME: () #[[ATTR22:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: call void @readonly() #[[ATTR18:[0-9]+]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: mustprogress readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2 -; IS__CGSCC_OPM-SAME: () #[[ATTR23:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @readonly() #[[ATTR19:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: mustprogress readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2 -; IS__CGSCC_NPM-SAME: () #[[ATTR25:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: call void @readonly() #[[ATTR21:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: mustprogress readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR22:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: call void @readonly() #[[ATTR18:[0-9]+]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: mustprogress readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR25:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: call void @readonly() #[[ATTR21:[0-9]+]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @readonly() ret void } define void @willreturn_mustprogress_caller_3() mustprogress { -; IS__TUNIT_OPM: Function Attrs: mustprogress nosync readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3 -; IS__TUNIT_OPM-SAME: () #[[ATTR21:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: call void @readnone() -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: mustprogress nosync readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3 -; IS__TUNIT_NPM-SAME: () #[[ATTR23:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: call void @readnone() -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: mustprogress nosync readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3 -; IS__CGSCC_OPM-SAME: () #[[ATTR24:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @readnone() -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: mustprogress nosync readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3 -; IS__CGSCC_NPM-SAME: () #[[ATTR26:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: call void @readnone() -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: mustprogress nosync readnone willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3 +; NOT_CGSCC_NPM-SAME: () #[[ATTR23:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: call void @readnone() +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: mustprogress nosync readnone willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3 +; NOT_TUNIT_NPM-SAME: () #[[ATTR26:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: call void @readnone() +; NOT_TUNIT_NPM-NEXT: ret void ; call void @readnone() ret void @@ -2204,29 +1564,18 @@ ret void } define void @willreturn_mustprogress_callee_2() { -; IS__TUNIT_OPM: Function Attrs: readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 -; IS__TUNIT_OPM-SAME: () #[[ATTR22:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: call void @readonly_mustprogress() #[[ATTR22]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 -; IS__TUNIT_NPM-SAME: () #[[ATTR24:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: call void @readonly_mustprogress() #[[ATTR24]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 -; IS__CGSCC_OPM-SAME: () #[[ATTR25:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @readonly_mustprogress() #[[ATTR25]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 -; IS__CGSCC_NPM-SAME: () #[[ATTR27:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: call void @readonly_mustprogress() #[[ATTR27]] -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 +; NOT_CGSCC_NPM-SAME: () #[[ATTR24:[0-9]+]] { +; NOT_CGSCC_NPM-NEXT: call void @readonly_mustprogress() #[[ATTR24]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 +; NOT_TUNIT_NPM-SAME: () #[[ATTR27:[0-9]+]] { +; NOT_TUNIT_NPM-NEXT: call void @readonly_mustprogress() #[[ATTR27]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @readonly_mustprogress() ret void @@ -2240,29 +1589,18 @@ ret void } define void @willreturn_mustprogress_callee_4() { -; IS__TUNIT_OPM: Function Attrs: readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 -; IS__TUNIT_OPM-SAME: () #[[ATTR22]] { -; IS__TUNIT_OPM-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR22]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 -; IS__TUNIT_NPM-SAME: () #[[ATTR24]] { -; IS__TUNIT_NPM-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR24]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 -; IS__CGSCC_OPM-SAME: () #[[ATTR25]] { -; IS__CGSCC_OPM-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR25]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 -; IS__CGSCC_NPM-SAME: () #[[ATTR27]] { -; IS__CGSCC_NPM-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR27]] -; IS__CGSCC_NPM-NEXT: ret void +; +; NOT_CGSCC_NPM: Function Attrs: readonly willreturn +; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 +; NOT_CGSCC_NPM-SAME: () #[[ATTR24]] { +; NOT_CGSCC_NPM-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR24]] +; NOT_CGSCC_NPM-NEXT: ret void +; +; NOT_TUNIT_NPM: Function Attrs: readonly willreturn +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 +; NOT_TUNIT_NPM-SAME: () #[[ATTR27]] { +; NOT_TUNIT_NPM-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR27]] +; NOT_TUNIT_NPM-NEXT: ret void ; call void @willreturn_mustprogress_callee_2() ret void @@ -2271,128 +1609,67 @@ attributes #0 = { nounwind uwtable noinline } attributes #1 = { uwtable noinline } ;. -; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } -; IS__TUNIT_OPM: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree noinline nosync nounwind uwtable } -; IS__TUNIT_OPM: attributes #[[ATTR4]] = { noreturn } -; IS__TUNIT_OPM: attributes #[[ATTR5]] = { noinline noreturn nounwind uwtable } -; IS__TUNIT_OPM: attributes #[[ATTR6]] = { noinline nounwind uwtable } -; IS__TUNIT_OPM: attributes #[[ATTR7:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR8:[0-9]+]] = { norecurse willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR9]] = { noinline nounwind uwtable willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR10:[0-9]+]] = { noinline uwtable willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR11]] = { nounwind willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR12]] = { argmemonly nofree noinline nosync nounwind readonly uwtable } -; IS__TUNIT_OPM: attributes #[[ATTR13]] = { nofree noinline noreturn nosync nounwind readnone uwtable } -; IS__TUNIT_OPM: attributes #[[ATTR14:[0-9]+]] = { noreturn nounwind } -; IS__TUNIT_OPM: attributes #[[ATTR15]] = { nofree nosync nounwind readnone } -; IS__TUNIT_OPM: attributes #[[ATTR16]] = { readonly } -; IS__TUNIT_OPM: attributes #[[ATTR17:[0-9]+]] = { readnone } -; IS__TUNIT_OPM: attributes #[[ATTR18]] = { mustprogress } -; IS__TUNIT_OPM: attributes #[[ATTR19:[0-9]+]] = { mustprogress readonly } -; IS__TUNIT_OPM: attributes #[[ATTR20]] = { mustprogress readonly willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR21]] = { mustprogress nosync readnone willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR22]] = { readonly willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR23]] = { nofree nosync nounwind } -; IS__TUNIT_OPM: attributes #[[ATTR24]] = { readnone willreturn } -; IS__TUNIT_OPM: attributes #[[ATTR25]] = { nounwind } -; IS__TUNIT_OPM: attributes #[[ATTR26]] = { willreturn } -;. -; IS__TUNIT_NPM: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } -; IS__TUNIT_NPM: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR3]] = { nofree noinline nosync nounwind uwtable } -; IS__TUNIT_NPM: attributes #[[ATTR4]] = { noreturn } -; IS__TUNIT_NPM: attributes #[[ATTR5]] = { noinline noreturn nounwind uwtable } -; IS__TUNIT_NPM: attributes #[[ATTR6]] = { noinline nounwind uwtable } -; IS__TUNIT_NPM: attributes #[[ATTR7:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR8:[0-9]+]] = { norecurse willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR9]] = { noinline nounwind uwtable willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR10:[0-9]+]] = { noinline uwtable willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR11]] = { nounwind willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR12]] = { argmemonly nofree noinline nosync nounwind readonly uwtable willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR13]] = { argmemonly nofree noinline nosync nounwind readonly uwtable } -; IS__TUNIT_NPM: attributes #[[ATTR14]] = { nofree noinline noreturn nosync nounwind readnone uwtable } -; IS__TUNIT_NPM: attributes #[[ATTR15:[0-9]+]] = { noreturn nounwind } -; IS__TUNIT_NPM: attributes #[[ATTR16]] = { nofree nosync nounwind readnone } -; IS__TUNIT_NPM: attributes #[[ATTR17]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR18]] = { readonly } -; IS__TUNIT_NPM: attributes #[[ATTR19:[0-9]+]] = { readnone } -; IS__TUNIT_NPM: attributes #[[ATTR20]] = { mustprogress } -; IS__TUNIT_NPM: attributes #[[ATTR21:[0-9]+]] = { mustprogress readonly } -; IS__TUNIT_NPM: attributes #[[ATTR22]] = { mustprogress readonly willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR23]] = { mustprogress nosync readnone willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR24]] = { readonly willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR25]] = { nofree nosync nounwind } -; IS__TUNIT_NPM: attributes #[[ATTR26]] = { readnone willreturn } -; IS__TUNIT_NPM: attributes #[[ATTR27]] = { nounwind } -; IS__TUNIT_NPM: attributes #[[ATTR28]] = { willreturn } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree noinline norecurse nosync nounwind readnone uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nofree noinline nosync nounwind uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR5]] = { noreturn } -; IS__CGSCC_OPM: attributes #[[ATTR6]] = { noinline noreturn nounwind uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR7]] = { noinline nounwind uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR8:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR9]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR10:[0-9]+]] = { norecurse willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR11]] = { noinline norecurse nounwind uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR12]] = { noinline norecurse noreturn nounwind uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR13:[0-9]+]] = { noinline uwtable willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR14]] = { nounwind willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR15]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR16]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } -; IS__CGSCC_OPM: attributes #[[ATTR17:[0-9]+]] = { noreturn nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR18]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC_OPM: attributes #[[ATTR19]] = { readonly } -; IS__CGSCC_OPM: attributes #[[ATTR20:[0-9]+]] = { readnone } -; IS__CGSCC_OPM: attributes #[[ATTR21]] = { mustprogress } -; IS__CGSCC_OPM: attributes #[[ATTR22:[0-9]+]] = { mustprogress readonly } -; IS__CGSCC_OPM: attributes #[[ATTR23]] = { mustprogress readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR24]] = { mustprogress nosync readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR25]] = { readonly willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR26]] = { nofree nosync nounwind readnone } -; IS__CGSCC_OPM: attributes #[[ATTR27]] = { nofree nosync nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR28]] = { readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR29]] = { nounwind } -; IS__CGSCC_OPM: attributes #[[ATTR30]] = { willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR31]] = { nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } +; NOT_CGSCC_NPM: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { nofree noinline nosync nounwind uwtable } +; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { noreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { noinline noreturn nounwind uwtable } +; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { noinline nounwind uwtable } +; NOT_CGSCC_NPM: attributes #[[ATTR7:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR8:[0-9]+]] = { norecurse willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { noinline nounwind uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR10:[0-9]+]] = { noinline uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR11]] = { nounwind willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR12]] = { argmemonly nofree noinline nosync nounwind readonly uwtable willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR13]] = { argmemonly nofree noinline nosync nounwind readonly uwtable } +; NOT_CGSCC_NPM: attributes #[[ATTR14]] = { nofree noinline noreturn nosync nounwind readnone uwtable } +; NOT_CGSCC_NPM: attributes #[[ATTR15:[0-9]+]] = { noreturn nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR16]] = { nofree nosync nounwind readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR17]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR18]] = { readonly } +; NOT_CGSCC_NPM: attributes #[[ATTR19:[0-9]+]] = { readnone } +; NOT_CGSCC_NPM: attributes #[[ATTR20]] = { mustprogress } +; NOT_CGSCC_NPM: attributes #[[ATTR21:[0-9]+]] = { mustprogress readonly } +; NOT_CGSCC_NPM: attributes #[[ATTR22]] = { mustprogress readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR23]] = { mustprogress nosync readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR24]] = { readonly willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR25]] = { nofree nosync nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR26]] = { readnone willreturn } +; NOT_CGSCC_NPM: attributes #[[ATTR27]] = { nounwind } +; NOT_CGSCC_NPM: attributes #[[ATTR28]] = { willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree noinline norecurse nosync nounwind readnone uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nofree noinline nosync nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR5]] = { noreturn } -; IS__CGSCC_NPM: attributes #[[ATTR6]] = { noinline noreturn nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR7]] = { noinline nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR8:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR9]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR10:[0-9]+]] = { norecurse willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR11]] = { noinline norecurse nounwind uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR12]] = { noinline norecurse noreturn nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR13:[0-9]+]] = { noinline uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR14]] = { nounwind willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR15]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR16]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR17]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR18:[0-9]+]] = { noreturn nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR19]] = { nofree norecurse nosync nounwind readnone } -; IS__CGSCC_NPM: attributes #[[ATTR20]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR21]] = { readonly } -; IS__CGSCC_NPM: attributes #[[ATTR22:[0-9]+]] = { readnone } -; IS__CGSCC_NPM: attributes #[[ATTR23]] = { mustprogress } -; IS__CGSCC_NPM: attributes #[[ATTR24:[0-9]+]] = { mustprogress readonly } -; IS__CGSCC_NPM: attributes #[[ATTR25]] = { mustprogress readonly willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR26]] = { mustprogress nosync readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR27]] = { readonly willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR28]] = { nofree nosync nounwind readnone } -; IS__CGSCC_NPM: attributes #[[ATTR29]] = { nofree nosync nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR30]] = { readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR31]] = { nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR32]] = { willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR2]] = { nofree noinline norecurse nosync nounwind readnone uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR4]] = { nofree noinline nosync nounwind uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR5]] = { noreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR6]] = { noinline noreturn nounwind uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR7]] = { noinline nounwind uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR8:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR9]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR10:[0-9]+]] = { norecurse willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR11]] = { noinline norecurse nounwind uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR12]] = { noinline norecurse noreturn nounwind uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR13:[0-9]+]] = { noinline uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR14]] = { nounwind willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR15]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR16]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR17]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } +; NOT_TUNIT_NPM: attributes #[[ATTR18:[0-9]+]] = { noreturn nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR19]] = { nofree norecurse nosync nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR20]] = { nofree norecurse nosync nounwind readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR21]] = { readonly } +; NOT_TUNIT_NPM: attributes #[[ATTR22:[0-9]+]] = { readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR23]] = { mustprogress } +; NOT_TUNIT_NPM: attributes #[[ATTR24:[0-9]+]] = { mustprogress readonly } +; NOT_TUNIT_NPM: attributes #[[ATTR25]] = { mustprogress readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR26]] = { mustprogress nosync readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR27]] = { readonly willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR28]] = { nofree nosync nounwind readnone } +; NOT_TUNIT_NPM: attributes #[[ATTR29]] = { nofree nosync nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR30]] = { readnone willreturn } +; NOT_TUNIT_NPM: attributes #[[ATTR31]] = { nounwind } +; NOT_TUNIT_NPM: attributes #[[ATTR32]] = { willreturn } ;.